X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dd47af27e12ee66b3e9eed6f1711e516f36dc837..53ba4eb40a7107a83393597c41b146971233179d:/src/xrc/xh_bttn.cpp diff --git a/src/xrc/xh_bttn.cpp b/src/xrc/xh_bttn.cpp index d103e1ada3..963efd0848 100644 --- a/src/xrc/xh_bttn.cpp +++ b/src/xrc/xh_bttn.cpp @@ -50,6 +50,38 @@ wxObject *wxButtonXmlHandler::DoCreateResource() if (GetBool(wxT("default"), 0)) button->SetDefault(); + + 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); + } + SetupWindow(button); return button;