]>
git.saurik.com Git - wxWidgets.git/blob - src/xrc/xh_bmpbt.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/xrc/xh_bmpbt.cpp
3 // Purpose: XRC resource for bitmap buttons
7 // Copyright: (c) 2000 Brian Gavin
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 // For compilers that support precompilation, includes "wx.h".
12 #include "wx/wxprec.h"
18 #if wxUSE_XRC && wxUSE_BMPBUTTON
20 #include "wx/xrc/xh_bmpbt.h"
23 #include "wx/bmpbuttn.h"
26 IMPLEMENT_DYNAMIC_CLASS(wxBitmapButtonXmlHandler
, wxXmlResourceHandler
)
28 wxBitmapButtonXmlHandler::wxBitmapButtonXmlHandler()
29 : wxXmlResourceHandler()
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
);
36 XRC_ADD_STYLE(wxBU_EXACTFIT
);
40 wxObject
*wxBitmapButtonXmlHandler::DoCreateResource()
42 XRC_MAKE_INSTANCE(button
, wxBitmapButton
)
44 button
->Create(m_parentAsWindow
,
46 GetBitmap(wxT("bitmap"), wxART_BUTTON
),
47 GetPosition(), GetSize(),
48 GetStyle(wxT("style"), wxBU_AUTODRAW
),
51 if (GetBool(wxT("default"), 0))
55 if (GetParamNode(wxT("selected")))
56 button
->SetBitmapSelected(GetBitmap(wxT("selected")));
57 if (GetParamNode(wxT("focus")))
58 button
->SetBitmapFocus(GetBitmap(wxT("focus")));
59 if (GetParamNode(wxT("disabled")))
60 button
->SetBitmapDisabled(GetBitmap(wxT("disabled")));
61 if (GetParamNode(wxT("hover")))
62 button
->SetBitmapHover(GetBitmap(wxT("hover")));
67 bool wxBitmapButtonXmlHandler::CanHandle(wxXmlNode
*node
)
69 return IsOfClass(node
, wxT("wxBitmapButton"));
72 #endif // wxUSE_XRC && wxUSE_BMPBUTTON