]> git.saurik.com Git - wxWidgets.git/blob - src/xrc/xh_chckb.cpp
fixing focus, fixes #9985
[wxWidgets.git] / src / xrc / xh_chckb.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/xrc/xh_chckb.cpp
3 // Purpose: XRC resource for wxCheckBox
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_CHECKBOX
19
20 #include "wx/xrc/xh_chckb.h"
21
22 #ifndef WX_PRECOMP
23 #include "wx/checkbox.h"
24 #endif
25
26 IMPLEMENT_DYNAMIC_CLASS(wxCheckBoxXmlHandler, wxXmlResourceHandler)
27
28 wxCheckBoxXmlHandler::wxCheckBoxXmlHandler()
29 : wxXmlResourceHandler()
30 {
31 XRC_ADD_STYLE(wxCHK_2STATE);
32 XRC_ADD_STYLE(wxCHK_3STATE);
33 XRC_ADD_STYLE(wxCHK_ALLOW_3RD_STATE_FOR_USER);
34 XRC_ADD_STYLE(wxALIGN_RIGHT);
35 AddWindowStyles();
36 }
37
38 wxObject *wxCheckBoxXmlHandler::DoCreateResource()
39 {
40 XRC_MAKE_INSTANCE(control, wxCheckBox)
41
42 control->Create(m_parentAsWindow,
43 GetID(),
44 GetText(wxT("label")),
45 GetPosition(), GetSize(),
46 GetStyle(),
47 wxDefaultValidator,
48 GetName());
49
50 control->SetValue(GetBool( wxT("checked")));
51 SetupWindow(control);
52
53 return control;
54 }
55
56 bool wxCheckBoxXmlHandler::CanHandle(wxXmlNode *node)
57 {
58 return IsOfClass(node, wxT("wxCheckBox"));
59 }
60
61 #endif // wxUSE_XRC && wxUSE_CHECKBOX