]> git.saurik.com Git - wxWidgets.git/blob - contrib/src/xml/xh_bttn.cpp
fixed bug in zlib compressed binary xml resources saving (crashed due to a typo)
[wxWidgets.git] / contrib / src / xml / xh_bttn.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: xh_bttn.cpp
3 // Purpose: XML resource for buttons
4 // Author: Vaclav Slavik
5 // Created: 2000/03/05
6 // RCS-ID: $Id$
7 // Copyright: (c) 2000 Vaclav Slavik
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 #ifdef __GNUG__
12 #pragma implementation "xh_bttn.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
22 #include "wx/xml/xh_bttn.h"
23 #include "wx/button.h"
24
25
26 wxObject *wxButtonXmlHandler::DoCreateResource()
27 {
28 wxButton *button = new wxButton(m_ParentAsWindow,
29 GetID(),
30 GetText(_T("label")),
31 GetPosition(), GetSize(),
32 GetStyle(),
33 wxDefaultValidator,
34 GetName());
35 if (GetBool(_T("default"), 0) == 1) button->SetDefault();
36 SetupWindow(button);
37
38 return button;
39 }
40
41
42
43 bool wxButtonXmlHandler::CanHandle(wxXmlNode *node)
44 {
45 return node->GetName() == _T("button");
46 }
47
48