]>
git.saurik.com Git - wxWidgets.git/blob - src/xrc/xh_bmpbt.cpp
1 /////////////////////////////////////////////////////////////////////////////
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"
20 #include "wx/xrc/xh_bmpbt.h"
21 #include "wx/bmpbuttn.h"
23 IMPLEMENT_DYNAMIC_CLASS(wxBitmapButtonXmlHandler
, wxXmlResourceHandler
)
25 wxBitmapButtonXmlHandler::wxBitmapButtonXmlHandler()
26 : wxXmlResourceHandler()
28 XRC_ADD_STYLE(wxBU_AUTODRAW
);
29 XRC_ADD_STYLE(wxBU_LEFT
);
30 XRC_ADD_STYLE(wxBU_RIGHT
);
31 XRC_ADD_STYLE(wxBU_TOP
);
32 XRC_ADD_STYLE(wxBU_BOTTOM
);
33 XRC_ADD_STYLE(wxBU_EXACTFIT
);
37 wxObject
*wxBitmapButtonXmlHandler::DoCreateResource()
39 XRC_MAKE_INSTANCE(button
, wxBitmapButton
)
41 button
->Create(m_parentAsWindow
,
43 GetBitmap(wxT("bitmap"), wxART_BUTTON
),
44 GetPosition(), GetSize(),
45 GetStyle(wxT("style"), wxBU_AUTODRAW
),
48 if (GetBool(wxT("default"), 0))
52 if (!GetParamValue(wxT("selected")).IsEmpty())
53 button
->SetBitmapSelected(GetBitmap(wxT("selected")));
54 if (!GetParamValue(wxT("focus")).IsEmpty())
55 button
->SetBitmapFocus(GetBitmap(wxT("focus")));
56 if (!GetParamValue(wxT("disabled")).IsEmpty())
57 button
->SetBitmapDisabled(GetBitmap(wxT("disabled")));
62 bool wxBitmapButtonXmlHandler::CanHandle(wxXmlNode
*node
)
64 return IsOfClass(node
, wxT("wxBitmapButton"));