Add support for bitmaps to wxToggleButton XRC handler
Handle "bitmap" and "bitmapposition" attributes in wxToggleButton XRC handler, just as it's already done for wxBitmap and wxBitmapToggleButton. Closes #17850.
This commit is contained in:
@@ -136,6 +136,7 @@ All (GUI):
|
||||
text (NewPagodi).
|
||||
- Fix adding/removing items to/from wxRearrangeList.
|
||||
- Handle wxST_ELLIPSIZE_XXX styles in wxStaticText XRC handler (tm).
|
||||
- Add support for bitmaps to wxToggleButton XRC handler (tm).
|
||||
|
||||
wxGTK:
|
||||
|
||||
|
@@ -2019,6 +2019,10 @@ No additional properties.
|
||||
Label to display on the button (default: empty).}
|
||||
@row3col{checked, @ref overview_xrcformat_type_bool,
|
||||
Should the button be checked/pressed initially (default: 0)?}
|
||||
@row3col{bitmap, @ref overview_xrcformat_type_bitmap,
|
||||
Bitmap to display in the button (optional). @since 3.1.1}
|
||||
@row3col{bitmapposition, @c wxLEFT|wxRIGHT|wxTOP|wxBOTTOM,
|
||||
Position of the bitmap in the button, see wxButton::SetBitmapPosition() (default: wxLEFT). @since 3.1.1}
|
||||
@endTable
|
||||
|
||||
@subsubsection xrc_wxtoolbar wxToolBar
|
||||
|
@@ -1508,7 +1508,9 @@ wxToggleButton =
|
||||
stdObjectNodeAttributes &
|
||||
stdWindowProperties &
|
||||
[xrc:p="important"] element label {_, t_text }* &
|
||||
[xrc:p="o"] element checked {_, t_bool }*
|
||||
[xrc:p="o"] element checked {_, t_bool }* &
|
||||
[xrc:p="o"] element bitmap {_, t_bitmap }* &
|
||||
[xrc:p="o"] element bitmapposition {_, t_direction }*
|
||||
}
|
||||
|
||||
|
||||
|
@@ -78,6 +78,12 @@ void wxToggleButtonXmlHandler::DoCreateToggleButton(wxObject *control)
|
||||
wxDefaultValidator,
|
||||
GetName());
|
||||
|
||||
if ( GetParamNode("bitmap") )
|
||||
{
|
||||
button->SetBitmap(GetBitmap("bitmap", wxART_BUTTON),
|
||||
GetDirection("bitmapposition"));
|
||||
}
|
||||
|
||||
button->SetValue(GetBool( wxT("checked")));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user