]>
git.saurik.com Git - wxWidgets.git/blob - contrib/src/xml/xh_bmpbt.cpp
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(_T("bitmap")),
42 GetPosition(), GetSize(),
43 GetStyle(_T("style"), wxBU_AUTODRAW
),
46 if (GetBool(_T("default"), 0) == 1) button
->SetDefault();
49 if (!GetParamValue(_T("selected")).IsEmpty())
50 button
->SetBitmapSelected(GetBitmap(_T("selected")));
51 if (!GetParamValue(_T("focus")).IsEmpty())
52 button
->SetBitmapFocus(GetBitmap(_T("focus")));
53 if (!GetParamValue(_T("disabled")).IsEmpty())
54 button
->SetBitmapDisabled(GetBitmap(_T("disabled")));
61 bool wxBitmapButtonXmlHandler::CanHandle(wxXmlNode
*node
)
63 return node
->GetName() == _T("bitmapbutton");