]> git.saurik.com Git - wxWidgets.git/blame - src/xrc/xh_bmpbt.cpp
Merge in from trunk r68626 - r68683
[wxWidgets.git] / src / xrc / xh_bmpbt.cpp
CommitLineData
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
26IMPLEMENT_DYNAMIC_CLASS(wxBitmapButtonXmlHandler, wxXmlResourceHandler)
27
f80ea77b
WS
28wxBitmapButtonXmlHandler::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 40wxObject *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")));
b6a9c1fe
JS
61 if (GetParamNode(wxT("hover")))
62 button->SetBitmapHover(GetBitmap(wxT("hover")));
f80ea77b 63
78d14f80
VS
64 return button;
65}
66
78d14f80
VS
67bool wxBitmapButtonXmlHandler::CanHandle(wxXmlNode *node)
68{
69 return IsOfClass(node, wxT("wxBitmapButton"));
70}
a1e4ec87 71
910b0053 72#endif // wxUSE_XRC && wxUSE_BMPBUTTON