]> git.saurik.com Git - wxWidgets.git/blame - src/xrc/xh_tglbtn.cpp
added XRC handler for wxFileCtrl (closes #10785)
[wxWidgets.git] / src / xrc / xh_tglbtn.cpp
CommitLineData
3e265680
JS
1/////////////////////////////////////////////////////////////////////////////
2// Name: xh_tglbtn.cpp
dd47af27 3// Purpose: XRC resource for wxToggleButton
3e265680
JS
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
3e265680
JS
11// For compilers that support precompilation, includes "wx.h".
12#include "wx/wxprec.h"
13
14#ifdef __BORLANDC__
15 #pragma hdrstop
16#endif
17
621be1ec 18#if wxUSE_XRC && wxUSE_TOGGLEBTN
a1e4ec87 19
3e265680
JS
20#include "wx/xrc/xh_tglbtn.h"
21#include "wx/tglbtn.h"
491016e5 22#include "wx/button.h" // solely for wxBU_EXACTFIT
3e265680 23
3e265680
JS
24IMPLEMENT_DYNAMIC_CLASS(wxToggleButtonXmlHandler, wxXmlResourceHandler)
25
26wxToggleButtonXmlHandler::wxToggleButtonXmlHandler()
61a9bd42 27 : wxXmlResourceHandler()
3e265680 28{
61a9bd42
VZ
29 XRC_ADD_STYLE(wxBU_EXACTFIT);
30
3e265680
JS
31 AddWindowStyles();
32}
33
34wxObject *wxToggleButtonXmlHandler::DoCreateResource()
35{
36 XRC_MAKE_INSTANCE(control, wxToggleButton)
37
38 control->Create(m_parentAsWindow,
39 GetID(),
40 GetText(wxT("label")),
41 GetPosition(), GetSize(),
42 GetStyle(),
43 wxDefaultValidator,
44 GetName());
45
46 control->SetValue(GetBool( wxT("checked")));
47 SetupWindow(control);
48
49 return control;
50}
51
52bool wxToggleButtonXmlHandler::CanHandle(wxXmlNode *node)
53{
54 return IsOfClass(node, wxT("wxToggleButton"));
55}
56
621be1ec 57#endif // wxUSE_XRC && wxUSE_TOGGLEBTN