]>
git.saurik.com Git - wxWidgets.git/blob - contrib/src/xml/xh_bmpbt.cpp
314d91e24c25bb5ca219ae3158d94592a42be371
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: XML 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/xml/xh_bmpbt.h"
23 #include <wx/bmpbuttn.h>
25 wxBitmapButtonXmlHandler::wxBitmapButtonXmlHandler()
26 : wxXmlResourceHandler()
28 ADD_STYLE(wxBU_AUTODRAW
);
30 ADD_STYLE(wxBU_RIGHT
);
32 ADD_STYLE(wxBU_BOTTOM
);
37 wxObject
*wxBitmapButtonXmlHandler::DoCreateResource()
39 wxBitmapButton
*button
= new wxBitmapButton(m_parentAsWindow
,
41 GetBitmap(wxT("bitmap")),
42 GetPosition(), GetSize(),
43 GetStyle(wxT("style"), wxBU_AUTODRAW
),
46 if (GetBool(wxT("default"), 0) == 1) button
->SetDefault();
49 if (!GetParamValue(wxT("selected")).IsEmpty())
50 button
->SetBitmapSelected(GetBitmap(wxT("selected")));
51 if (!GetParamValue(wxT("focus")).IsEmpty())
52 button
->SetBitmapFocus(GetBitmap(wxT("focus")));
53 if (!GetParamValue(wxT("disabled")).IsEmpty())
54 button
->SetBitmapDisabled(GetBitmap(wxT("disabled")));
61 bool wxBitmapButtonXmlHandler::CanHandle(wxXmlNode
*node
)
63 return IsOfClass(node
, wxT("wxBitmapButton"));