add support for bitmap and bitmapposition tags to the wxButton XRC handler
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61065 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -590,7 +590,11 @@ Example:
|
|||||||
@beginTable
|
@beginTable
|
||||||
@hdr3col{property, type, description}
|
@hdr3col{property, type, description}
|
||||||
@row3col{label, @ref overview_xrcformat_type_text,
|
@row3col{label, @ref overview_xrcformat_type_text,
|
||||||
Label to display on the button (required).}
|
Label to display on the button (may be empty if only bitmap is used).}
|
||||||
|
@row3col{bitmap, @ref overview_xrcformat_type_bitmap,
|
||||||
|
Bitmap to display in the button (optional).}
|
||||||
|
@row3col{bitmapposition, @c wxLEFT|wxRIGHT|wxTOP|wxBOTTOM,
|
||||||
|
Position of the bitmap in the button, see wxButton::SetBitmapPosition().}
|
||||||
@row3col{default, @ref overview_xrcformat_type_bool,
|
@row3col{default, @ref overview_xrcformat_type_bool,
|
||||||
Should this button be the default button in dialog (default: 0)?}
|
Should this button be the default button in dialog (default: 0)?}
|
||||||
@endTable
|
@endTable
|
||||||
|
@@ -50,6 +50,38 @@ wxObject *wxButtonXmlHandler::DoCreateResource()
|
|||||||
|
|
||||||
if (GetBool(wxT("default"), 0))
|
if (GetBool(wxT("default"), 0))
|
||||||
button->SetDefault();
|
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);
|
SetupWindow(button);
|
||||||
|
|
||||||
return button;
|
return button;
|
||||||
|
Reference in New Issue
Block a user