]> git.saurik.com Git - wxWidgets.git/blame - src/xrc/xh_bttn.cpp
Make public headers compatible with Objective-C++ with ARC.
[wxWidgets.git] / src / xrc / xh_bttn.cpp
CommitLineData
78d14f80 1/////////////////////////////////////////////////////////////////////////////
f1e01716 2// Name: src/xrc/xh_bttn.cpp
b5d6954b 3// Purpose: XRC resource for buttons
78d14f80
VS
4// Author: Vaclav Slavik
5// Created: 2000/03/05
78d14f80
VS
6// Copyright: (c) 2000 Vaclav Slavik
7// Licence: wxWindows licence
8/////////////////////////////////////////////////////////////////////////////
f80ea77b 9
78d14f80
VS
10// For compilers that support precompilation, includes "wx.h".
11#include "wx/wxprec.h"
12
13#ifdef __BORLANDC__
14 #pragma hdrstop
15#endif
16
dd47af27 17#if wxUSE_XRC && wxUSE_BUTTON
a1e4ec87 18
78d14f80 19#include "wx/xrc/xh_bttn.h"
f1e01716
WS
20
21#ifndef WX_PRECOMP
22 #include "wx/button.h"
23#endif
78d14f80 24
854e189f 25IMPLEMENT_DYNAMIC_CLASS(wxButtonXmlHandler, wxXmlResourceHandler)
78d14f80 26
f80ea77b
WS
27wxButtonXmlHandler::wxButtonXmlHandler()
28: wxXmlResourceHandler()
78d14f80 29{
544fee32
VS
30 XRC_ADD_STYLE(wxBU_LEFT);
31 XRC_ADD_STYLE(wxBU_RIGHT);
32 XRC_ADD_STYLE(wxBU_TOP);
33 XRC_ADD_STYLE(wxBU_BOTTOM);
27ce9aef 34 XRC_ADD_STYLE(wxBU_EXACTFIT);
78d14f80
VS
35 AddWindowStyles();
36}
37
78d14f80 38wxObject *wxButtonXmlHandler::DoCreateResource()
f80ea77b 39{
544fee32 40 XRC_MAKE_INSTANCE(button, wxButton)
f2588180
VS
41
42 button->Create(m_parentAsWindow,
43 GetID(),
44 GetText(wxT("label")),
45 GetPosition(), GetSize(),
46 GetStyle(),
47 wxDefaultValidator,
48 GetName());
49
544fee32
VS
50 if (GetBool(wxT("default"), 0))
51 button->SetDefault();
18b9d1a1
VZ
52
53 if ( GetParamNode("bitmap") )
54 {
50c20291
VZ
55 button->SetBitmap(GetBitmap("bitmap", wxART_BUTTON),
56 GetDirection("bitmapposition"));
18b9d1a1
VZ
57 }
58
78d14f80 59 SetupWindow(button);
f80ea77b 60
78d14f80
VS
61 return button;
62}
63
78d14f80
VS
64bool wxButtonXmlHandler::CanHandle(wxXmlNode *node)
65{
66 return IsOfClass(node, wxT("wxButton"));
67}
a1e4ec87 68
dd47af27 69#endif // wxUSE_XRC && wxUSE_BUTTON