]> git.saurik.com Git - wxWidgets.git/blame - src/xrc/xh_chckb.cpp
wxUniversal positioning fix [#1040625]
[wxWidgets.git] / src / xrc / xh_chckb.cpp
CommitLineData
78d14f80
VS
1/////////////////////////////////////////////////////////////////////////////
2// Name: xh_chckb.cpp
b5d6954b 3// Purpose: XRC resource for wxCheckBox
78d14f80
VS
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/////////////////////////////////////////////////////////////////////////////
f80ea77b 10
c575e45a 11#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
78d14f80
VS
12#pragma implementation "xh_chckb.h"
13#endif
14
15// For compilers that support precompilation, includes "wx.h".
16#include "wx/wxprec.h"
17
18#ifdef __BORLANDC__
19 #pragma hdrstop
20#endif
21
621be1ec 22#if wxUSE_XRC && wxUSE_CHECKBOX
a1e4ec87 23
78d14f80
VS
24#include "wx/xrc/xh_chckb.h"
25#include "wx/checkbox.h"
26
854e189f
VS
27IMPLEMENT_DYNAMIC_CLASS(wxCheckBoxXmlHandler, wxXmlResourceHandler)
28
f80ea77b
WS
29wxCheckBoxXmlHandler::wxCheckBoxXmlHandler()
30: wxXmlResourceHandler()
78d14f80 31{
4ac23d05
RD
32 XRC_ADD_STYLE(wxCHK_2STATE);
33 XRC_ADD_STYLE(wxCHK_3STATE);
34 XRC_ADD_STYLE(wxCHK_ALLOW_3RD_STATE_FOR_USER);
35 XRC_ADD_STYLE(wxALIGN_RIGHT);
78d14f80
VS
36 AddWindowStyles();
37}
38
39wxObject *wxCheckBoxXmlHandler::DoCreateResource()
f80ea77b 40{
544fee32 41 XRC_MAKE_INSTANCE(control, wxCheckBox)
f2588180
VS
42
43 control->Create(m_parentAsWindow,
44 GetID(),
45 GetText(wxT("label")),
46 GetPosition(), GetSize(),
47 GetStyle(),
48 wxDefaultValidator,
49 GetName());
78d14f80 50
544fee32 51 control->SetValue(GetBool( wxT("checked")));
78d14f80 52 SetupWindow(control);
f80ea77b 53
78d14f80
VS
54 return control;
55}
56
78d14f80
VS
57bool wxCheckBoxXmlHandler::CanHandle(wxXmlNode *node)
58{
59 return IsOfClass(node, wxT("wxCheckBox"));
60}
61
621be1ec 62#endif // wxUSE_XRC && wxUSE_CHECKBOX