]>
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 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) 
  12 #pragma implementation "xh_bmpbt.h" 
  15 // For compilers that support precompilation, includes "wx.h". 
  16 #include "wx/wxprec.h" 
  24 #include "wx/xrc/xh_bmpbt.h" 
  25 #include "wx/bmpbuttn.h" 
  27 IMPLEMENT_DYNAMIC_CLASS(wxBitmapButtonXmlHandler
, wxXmlResourceHandler
) 
  29 wxBitmapButtonXmlHandler::wxBitmapButtonXmlHandler() 
  30 : wxXmlResourceHandler() 
  32     XRC_ADD_STYLE(wxBU_AUTODRAW
); 
  33     XRC_ADD_STYLE(wxBU_LEFT
); 
  34     XRC_ADD_STYLE(wxBU_RIGHT
); 
  35     XRC_ADD_STYLE(wxBU_TOP
); 
  36     XRC_ADD_STYLE(wxBU_BOTTOM
); 
  37     XRC_ADD_STYLE(wxBU_EXACTFIT
); 
  41 wxObject 
*wxBitmapButtonXmlHandler::DoCreateResource() 
  43     XRC_MAKE_INSTANCE(button
, wxBitmapButton
) 
  45     button
->Create(m_parentAsWindow
, 
  47                    GetBitmap(wxT("bitmap"), wxART_BUTTON
), 
  48                    GetPosition(), GetSize(), 
  49                    GetStyle(wxT("style"), wxBU_AUTODRAW
), 
  52     if (GetBool(wxT("default"), 0)) 
  56     if (!GetParamValue(wxT("selected")).IsEmpty()) 
  57         button
->SetBitmapSelected(GetBitmap(wxT("selected"))); 
  58     if (!GetParamValue(wxT("focus")).IsEmpty()) 
  59         button
->SetBitmapFocus(GetBitmap(wxT("focus"))); 
  60     if (!GetParamValue(wxT("disabled")).IsEmpty()) 
  61         button
->SetBitmapDisabled(GetBitmap(wxT("disabled"))); 
  66 bool wxBitmapButtonXmlHandler::CanHandle(wxXmlNode 
*node
) 
  68     return IsOfClass(node
, wxT("wxBitmapButton"));