]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/src/xml/xh_bmpbt.cpp
test for bug with new wu-ftpd
[wxWidgets.git] / contrib / src / xml / xh_bmpbt.cpp
index cfc3fe5891f568567ee8f0db1673b104b5d05e39..a4230b1c74584f45111d7b0092437314e22bb67c 100644 (file)
@@ -38,8 +38,7 @@ wxObject *wxBitmapButtonXmlHandler::DoCreateResource()
 { 
     wxBitmapButton *button = new wxBitmapButton(m_ParentAsWindow,
                                     GetID(),
-                                    GetBitmap(_T("bitmap"), GetSize()),
-                                    //GetBitmap(_T("bitmap")),
+                                    GetBitmap(_T("bitmap")),
                                     GetPosition(), GetSize(),
                                     GetStyle(_T("style"), wxBU_AUTODRAW),
                                     wxDefaultValidator,
@@ -47,6 +46,13 @@ wxObject *wxBitmapButtonXmlHandler::DoCreateResource()
     if (GetBool(_T("default"), 0) == 1) button->SetDefault();
     SetupWindow(button);
     
+    if (!GetParamValue(_T("selected")).IsEmpty())
+        button->SetBitmapSelected(GetBitmap(_T("selected")));
+    if (!GetParamValue(_T("focus")).IsEmpty())
+        button->SetBitmapFocus(GetBitmap(_T("focus")));
+    if (!GetParamValue(_T("disabled")).IsEmpty())
+        button->SetBitmapDisabled(GetBitmap(_T("disabled")));
+    
     return button;
 }
 
@@ -54,7 +60,7 @@ wxObject *wxBitmapButtonXmlHandler::DoCreateResource()
 
 bool wxBitmapButtonXmlHandler::CanHandle(wxXmlNode *node)
 {
-    return node->GetName() == _T("bitmapbutton");
+    return IsOfClass(node, _T("wxBitmapButton"));
 }