| 1 | ///////////////////////////////////////////////////////////////////////////// |
| 2 | // Name: xh_radbt.cpp |
| 3 | // Purpose: XRC resource for wxRadioButton |
| 4 | // Author: Bob Mitchell |
| 5 | // Created: 2000/03/21 |
| 6 | // RCS-ID: $Id$ |
| 7 | // Copyright: (c) 2000 Bob Mitchell and Verant Interactive |
| 8 | // Licence: wxWindows licence |
| 9 | ///////////////////////////////////////////////////////////////////////////// |
| 10 | |
| 11 | // For compilers that support precompilation, includes "wx.h". |
| 12 | #include "wx/wxprec.h" |
| 13 | |
| 14 | #ifdef __BORLANDC__ |
| 15 | #pragma hdrstop |
| 16 | #endif |
| 17 | |
| 18 | #if wxUSE_XRC && wxUSE_RADIOBTN |
| 19 | |
| 20 | #include "wx/xrc/xh_radbt.h" |
| 21 | #include "wx/radiobut.h" |
| 22 | |
| 23 | IMPLEMENT_DYNAMIC_CLASS(wxRadioButtonXmlHandler, wxXmlResourceHandler) |
| 24 | |
| 25 | wxRadioButtonXmlHandler::wxRadioButtonXmlHandler() |
| 26 | : wxXmlResourceHandler() |
| 27 | { |
| 28 | XRC_ADD_STYLE(wxRB_GROUP); |
| 29 | XRC_ADD_STYLE(wxRB_SINGLE); |
| 30 | AddWindowStyles(); |
| 31 | } |
| 32 | |
| 33 | wxObject *wxRadioButtonXmlHandler::DoCreateResource() |
| 34 | { |
| 35 | /* BOBM - implementation note. |
| 36 | * once the wxBitmapRadioButton is implemented. |
| 37 | * look for a bitmap property. If not null, |
| 38 | * make it a wxBitmapRadioButton instead of the |
| 39 | * normal radio button. |
| 40 | */ |
| 41 | |
| 42 | XRC_MAKE_INSTANCE(control, wxRadioButton) |
| 43 | |
| 44 | control->Create(m_parentAsWindow, |
| 45 | GetID(), |
| 46 | GetText(wxT("label")), |
| 47 | GetPosition(), GetSize(), |
| 48 | GetStyle(), |
| 49 | wxDefaultValidator, |
| 50 | GetName()); |
| 51 | |
| 52 | control->SetValue(GetBool(wxT("value"), 0)); |
| 53 | SetupWindow(control); |
| 54 | |
| 55 | return control; |
| 56 | } |
| 57 | |
| 58 | bool wxRadioButtonXmlHandler::CanHandle(wxXmlNode *node) |
| 59 | { |
| 60 | return IsOfClass(node, wxT("wxRadioButton")); |
| 61 | } |
| 62 | |
| 63 | #endif // wxUSE_XRC && wxUSE_RADIOBTN |