]> git.saurik.com Git - wxWidgets.git/blame - src/xrc/xh_tglbtn.cpp
set command int (indicating whether the item is checked) correctly for the menu event...
[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"
22
3e265680
JS
23IMPLEMENT_DYNAMIC_CLASS(wxToggleButtonXmlHandler, wxXmlResourceHandler)
24
25wxToggleButtonXmlHandler::wxToggleButtonXmlHandler()
26: wxXmlResourceHandler()
27{
28 AddWindowStyles();
29}
30
31wxObject *wxToggleButtonXmlHandler::DoCreateResource()
32{
33 XRC_MAKE_INSTANCE(control, wxToggleButton)
34
35 control->Create(m_parentAsWindow,
36 GetID(),
37 GetText(wxT("label")),
38 GetPosition(), GetSize(),
39 GetStyle(),
40 wxDefaultValidator,
41 GetName());
42
43 control->SetValue(GetBool( wxT("checked")));
44 SetupWindow(control);
45
46 return control;
47}
48
49bool wxToggleButtonXmlHandler::CanHandle(wxXmlNode *node)
50{
51 return IsOfClass(node, wxT("wxToggleButton"));
52}
53
621be1ec 54#endif // wxUSE_XRC && wxUSE_TOGGLEBTN