]> git.saurik.com Git - wxWidgets.git/blob - src/xrc/xh_radbt.cpp
Factor our hash function used for XRC ids hash map.
[wxWidgets.git] / src / xrc / xh_radbt.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/xrc/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
22 #ifndef WX_PRECOMP
23 #include "wx/radiobut.h"
24 #endif
25
26 IMPLEMENT_DYNAMIC_CLASS(wxRadioButtonXmlHandler, wxXmlResourceHandler)
27
28 wxRadioButtonXmlHandler::wxRadioButtonXmlHandler()
29 : wxXmlResourceHandler()
30 {
31 XRC_ADD_STYLE(wxRB_GROUP);
32 XRC_ADD_STYLE(wxRB_SINGLE);
33 AddWindowStyles();
34 }
35
36 wxObject *wxRadioButtonXmlHandler::DoCreateResource()
37 {
38 /* BOBM - implementation note.
39 * once the wxBitmapRadioButton is implemented.
40 * look for a bitmap property. If not null,
41 * make it a wxBitmapRadioButton instead of the
42 * normal radio button.
43 */
44
45 XRC_MAKE_INSTANCE(control, wxRadioButton)
46
47 control->Create(m_parentAsWindow,
48 GetID(),
49 GetText(wxT("label")),
50 GetPosition(), GetSize(),
51 GetStyle(),
52 wxDefaultValidator,
53 GetName());
54
55 control->SetValue(GetBool(wxT("value"), 0));
56 SetupWindow(control);
57
58 return control;
59 }
60
61 bool wxRadioButtonXmlHandler::CanHandle(wxXmlNode *node)
62 {
63 return IsOfClass(node, wxT("wxRadioButton"));
64 }
65
66 #endif // wxUSE_XRC && wxUSE_RADIOBTN