XRC: ability to create wxButton with wxBitmapBundle
This commit is contained in:
@@ -912,7 +912,9 @@ Example:
|
||||
@row3col{label, @ref overview_xrcformat_type_text,
|
||||
Label to display on the button (may be omitted if only the bitmap or stock ID is used).}
|
||||
@row3col{bitmap, @ref overview_xrcformat_type_bitmap,
|
||||
Bitmap to display in the button (optional).}
|
||||
Bitmap to display in the button (optional). Mutually exclusive with @c bitmaps.}
|
||||
@row3col{bitmaps, @ref overview_xrcformat_type_bitmaps,
|
||||
BitmapBundle to display in the button (optional). Mutually exclusive with @c bitmap.}
|
||||
@row3col{bitmapposition, @c wxLEFT|wxRIGHT|wxTOP|wxBOTTOM,
|
||||
Position of the bitmap in the button, see wxButton::SetBitmapPosition() (default: wxLEFT).}
|
||||
@row3col{default, @ref overview_xrcformat_type_bool,
|
||||
|
||||
@@ -742,7 +742,10 @@ wxButton =
|
||||
stdObjectNodeAttributes &
|
||||
stdWindowProperties &
|
||||
[xrc:p="o"] element label {_, t_text }* &
|
||||
[xrc:p="o"] element bitmap {_, t_bitmap }* &
|
||||
[xrc:p="o"](
|
||||
element bitmap {_, t_bitmap } |
|
||||
element bitmaps {_, t_bitmaps }
|
||||
)* &
|
||||
[xrc:p="o"] element bitmapposition {_, t_direction }* &
|
||||
[xrc:p="o"] element default {_, t_bool }*
|
||||
}
|
||||
|
||||
@@ -47,10 +47,10 @@ wxObject *wxButtonXmlHandler::DoCreateResource()
|
||||
if (GetBool(wxT("default"), 0))
|
||||
button->SetDefault();
|
||||
|
||||
if ( GetParamNode("bitmap") )
|
||||
wxBitmapBundle bb = GetBitmapOrBitmaps("bitmap", "bitmaps", wxART_BUTTON);
|
||||
if ( bb.IsOk() )
|
||||
{
|
||||
button->SetBitmap(GetBitmap("bitmap", wxART_BUTTON),
|
||||
GetDirection("bitmapposition"));
|
||||
button->SetBitmap(bb);
|
||||
}
|
||||
|
||||
SetupWindow(button);
|
||||
|
||||
Reference in New Issue
Block a user