]>
Commit | Line | Data |
---|---|---|
78d14f80 | 1 | ///////////////////////////////////////////////////////////////////////////// |
910b0053 | 2 | // Name: src/xrc/xh_bmpbt.cpp |
b5d6954b | 3 | // Purpose: XRC resource for bitmap buttons |
78d14f80 VS |
4 | // Author: Brian Gavin |
5 | // Created: 2000/09/09 | |
6 | // RCS-ID: $Id$ | |
7 | // Copyright: (c) 2000 Brian Gavin | |
8 | // Licence: wxWindows licence | |
9 | ///////////////////////////////////////////////////////////////////////////// | |
f80ea77b | 10 | |
78d14f80 VS |
11 | // For compilers that support precompilation, includes "wx.h". |
12 | #include "wx/wxprec.h" | |
13 | ||
14 | #ifdef __BORLANDC__ | |
15 | #pragma hdrstop | |
16 | #endif | |
17 | ||
910b0053 | 18 | #if wxUSE_XRC && wxUSE_BMPBUTTON |
a1e4ec87 | 19 | |
78d14f80 | 20 | #include "wx/xrc/xh_bmpbt.h" |
910b0053 WS |
21 | |
22 | #ifndef WX_PRECOMP | |
23 | #include "wx/bmpbuttn.h" | |
24 | #endif | |
78d14f80 | 25 | |
854e189f VS |
26 | IMPLEMENT_DYNAMIC_CLASS(wxBitmapButtonXmlHandler, wxXmlResourceHandler) |
27 | ||
f80ea77b WS |
28 | wxBitmapButtonXmlHandler::wxBitmapButtonXmlHandler() |
29 | : wxXmlResourceHandler() | |
78d14f80 | 30 | { |
544fee32 VS |
31 | XRC_ADD_STYLE(wxBU_AUTODRAW); |
32 | XRC_ADD_STYLE(wxBU_LEFT); | |
33 | XRC_ADD_STYLE(wxBU_RIGHT); | |
34 | XRC_ADD_STYLE(wxBU_TOP); | |
35 | XRC_ADD_STYLE(wxBU_BOTTOM); | |
d8e1aa86 | 36 | XRC_ADD_STYLE(wxBU_EXACTFIT); |
78d14f80 VS |
37 | AddWindowStyles(); |
38 | } | |
39 | ||
78d14f80 | 40 | wxObject *wxBitmapButtonXmlHandler::DoCreateResource() |
f80ea77b | 41 | { |
544fee32 VS |
42 | XRC_MAKE_INSTANCE(button, wxBitmapButton) |
43 | ||
44 | button->Create(m_parentAsWindow, | |
45 | GetID(), | |
abda7717 | 46 | GetBitmap(wxT("bitmap"), wxART_BUTTON), |
544fee32 VS |
47 | GetPosition(), GetSize(), |
48 | GetStyle(wxT("style"), wxBU_AUTODRAW), | |
49 | wxDefaultValidator, | |
50 | GetName()); | |
51 | if (GetBool(wxT("default"), 0)) | |
52 | button->SetDefault(); | |
78d14f80 | 53 | SetupWindow(button); |
f80ea77b | 54 | |
1d88e73a | 55 | if (GetParamNode(wxT("selected"))) |
78d14f80 | 56 | button->SetBitmapSelected(GetBitmap(wxT("selected"))); |
1d88e73a | 57 | if (GetParamNode(wxT("focus"))) |
78d14f80 | 58 | button->SetBitmapFocus(GetBitmap(wxT("focus"))); |
1d88e73a | 59 | if (GetParamNode(wxT("disabled"))) |
78d14f80 | 60 | button->SetBitmapDisabled(GetBitmap(wxT("disabled"))); |
f80ea77b | 61 | |
78d14f80 VS |
62 | return button; |
63 | } | |
64 | ||
78d14f80 VS |
65 | bool wxBitmapButtonXmlHandler::CanHandle(wxXmlNode *node) |
66 | { | |
67 | return IsOfClass(node, wxT("wxBitmapButton")); | |
68 | } | |
a1e4ec87 | 69 | |
910b0053 | 70 | #endif // wxUSE_XRC && wxUSE_BMPBUTTON |