]>
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 /////////////////////////////////////////////////////////////////////////////
12 #pragma implementation "xh_bmpbt.h"
15 // For compilers that support precompilation, includes "wx.h".
16 #include "wx/wxprec.h"
22 #include "wx/xrc/xh_bmpbt.h"
23 #include <wx/bmpbuttn.h>
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
);
36 wxObject
*wxBitmapButtonXmlHandler::DoCreateResource()
38 XRC_MAKE_INSTANCE(button
, wxBitmapButton
)
40 button
->Create(m_parentAsWindow
,
42 GetBitmap(wxT("bitmap")),
43 GetPosition(), GetSize(),
44 GetStyle(wxT("style"), wxBU_AUTODRAW
),
47 if (GetBool(wxT("default"), 0))
51 if (!GetParamValue(wxT("selected")).IsEmpty())
52 button
->SetBitmapSelected(GetBitmap(wxT("selected")));
53 if (!GetParamValue(wxT("focus")).IsEmpty())
54 button
->SetBitmapFocus(GetBitmap(wxT("focus")));
55 if (!GetParamValue(wxT("disabled")).IsEmpty())
56 button
->SetBitmapDisabled(GetBitmap(wxT("disabled")));
61 bool wxBitmapButtonXmlHandler::CanHandle(wxXmlNode
*node
)
63 return IsOfClass(node
, wxT("wxBitmapButton"));