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