]> git.saurik.com Git - wxWidgets.git/blobdiff - src/xrc/xh_bttn.cpp
Applied colspan corrections, #15274 and #15275 (dghart)
[wxWidgets.git] / src / xrc / xh_bttn.cpp
index 963efd0848b238e1f0cabfb868a20eb0ac776f54..7f2058cdd24f1646446c8bdf243e379e815f8189 100644 (file)
@@ -53,33 +53,8 @@ wxObject *wxButtonXmlHandler::DoCreateResource()
 
     if ( GetParamNode("bitmap") )
     {
-        wxDirection dir;
-        const wxString dirstr = GetParamValue("direction");
-        if ( dirstr.empty() || dirstr == "wxLEFT" )
-            dir = wxLEFT;
-        else if ( dirstr == "wxRIGHT" )
-            dir = wxRIGHT;
-        else if ( dirstr == "wxTOP" )
-            dir = wxTOP;
-        else if ( dirstr == "wxBOTTOM" )
-            dir = wxBOTTOM;
-        else
-        {
-            ReportError
-            (
-                GetParamNode("bitmapposition"),
-                wxString::Format
-                (
-                    "Invalid bitmap position \"%s\": must be one of "
-                    "wxLEFT|wxRIGHT|wxTOP|wxBOTTOM.",
-                    dirstr
-                )
-            );
-
-            dir = wxLEFT;
-        }
-
-        button->SetBitmap(GetBitmap("bitmap", wxART_BUTTON), dir);
+        button->SetBitmap(GetBitmap("bitmap", wxART_BUTTON),
+                          GetDirection("bitmapposition"));
     }
 
     SetupWindow(button);