]>
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 | |
78d14f80 VS |
6 | // Copyright: (c) 2000 Brian Gavin |
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 | ||
910b0053 | 17 | #if wxUSE_XRC && wxUSE_BMPBUTTON |
a1e4ec87 | 18 | |
78d14f80 | 19 | #include "wx/xrc/xh_bmpbt.h" |
910b0053 WS |
20 | |
21 | #ifndef WX_PRECOMP | |
22 | #include "wx/bmpbuttn.h" | |
23 | #endif | |
78d14f80 | 24 | |
854e189f VS |
25 | IMPLEMENT_DYNAMIC_CLASS(wxBitmapButtonXmlHandler, wxXmlResourceHandler) |
26 | ||
f80ea77b WS |
27 | wxBitmapButtonXmlHandler::wxBitmapButtonXmlHandler() |
28 | : wxXmlResourceHandler() | |
78d14f80 | 29 | { |
544fee32 VS |
30 | XRC_ADD_STYLE(wxBU_AUTODRAW); |
31 | XRC_ADD_STYLE(wxBU_LEFT); | |
32 | XRC_ADD_STYLE(wxBU_RIGHT); | |
33 | XRC_ADD_STYLE(wxBU_TOP); | |
34 | XRC_ADD_STYLE(wxBU_BOTTOM); | |
d8e1aa86 | 35 | XRC_ADD_STYLE(wxBU_EXACTFIT); |
78d14f80 VS |
36 | AddWindowStyles(); |
37 | } | |
38 | ||
78d14f80 | 39 | wxObject *wxBitmapButtonXmlHandler::DoCreateResource() |
f80ea77b | 40 | { |
544fee32 VS |
41 | XRC_MAKE_INSTANCE(button, wxBitmapButton) |
42 | ||
43 | button->Create(m_parentAsWindow, | |
44 | GetID(), | |
abda7717 | 45 | GetBitmap(wxT("bitmap"), wxART_BUTTON), |
544fee32 VS |
46 | GetPosition(), GetSize(), |
47 | GetStyle(wxT("style"), wxBU_AUTODRAW), | |
48 | wxDefaultValidator, | |
49 | GetName()); | |
50 | if (GetBool(wxT("default"), 0)) | |
51 | button->SetDefault(); | |
78d14f80 | 52 | SetupWindow(button); |
f80ea77b | 53 | |
1d88e73a | 54 | if (GetParamNode(wxT("selected"))) |
78d14f80 | 55 | button->SetBitmapSelected(GetBitmap(wxT("selected"))); |
1d88e73a | 56 | if (GetParamNode(wxT("focus"))) |
78d14f80 | 57 | button->SetBitmapFocus(GetBitmap(wxT("focus"))); |
1d88e73a | 58 | if (GetParamNode(wxT("disabled"))) |
78d14f80 | 59 | button->SetBitmapDisabled(GetBitmap(wxT("disabled"))); |
b6a9c1fe JS |
60 | if (GetParamNode(wxT("hover"))) |
61 | button->SetBitmapHover(GetBitmap(wxT("hover"))); | |
f80ea77b | 62 | |
78d14f80 VS |
63 | return button; |
64 | } | |
65 | ||
78d14f80 VS |
66 | bool wxBitmapButtonXmlHandler::CanHandle(wxXmlNode *node) |
67 | { | |
68 | return IsOfClass(node, wxT("wxBitmapButton")); | |
69 | } | |
a1e4ec87 | 70 | |
910b0053 | 71 | #endif // wxUSE_XRC && wxUSE_BMPBUTTON |