Update wxCommandLinkButtonXmlHandler

Adds missing bitmap specifications, removes unusable button styles.

Closes #22475.
This commit is contained in:
Randalphwa
2022-05-30 07:35:56 -07:00
committed by Vadim Zeitlin
parent 495e9b99cd
commit addbc940c0
3 changed files with 28 additions and 8 deletions

View File

@@ -1052,6 +1052,14 @@ concatenated into a single string using a new line character between them
Second line of text describing the action performed when the button is pressed (default: none). } Second line of text describing the action performed when the button is pressed (default: none). }
@row3col{bitmap, @ref overview_xrcformat_type_bitmap, @row3col{bitmap, @ref overview_xrcformat_type_bitmap,
Bitmap to display in the button (optional). @since 3.1.5} Bitmap to display in the button (optional). @since 3.1.5}
@row3col{pressed, @ref overview_xrcformat_type_bitmap,
Bitmap to show when the button is pressed (default: none, same as @c bitmap). @since 3.1.7}
@row3col{focus, @ref overview_xrcformat_type_bitmap,
Bitmap to show when the button has focus (default: none, same as @c bitmap). @since 3.1.7}
@row3col{disabled, @ref overview_xrcformat_type_bitmap,
Bitmap to show when the button is disabled (default: none, same as @c bitmap). @since 3.1.7}
@row3col{current, @ref overview_xrcformat_type_bitmap,
Bitmap to show when the mouse cursor hovers above the bitmap (default: none, same as @c bitmap). @since 3.1.7}
@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)? @since 3.1.5} Should this button be the default button in dialog (default: 0)? @since 3.1.5}
@endTable @endTable

View File

@@ -826,9 +826,13 @@ wxCommandLinkButton =
stdObjectNodeAttributes & stdObjectNodeAttributes &
stdWindowProperties & stdWindowProperties &
[xrc:p="important"] element label {_, t_text }* & [xrc:p="important"] element label {_, t_text }* &
[xrc:p="o"] element note {_, t_text }* & [xrc:p="o"] element note {_, t_text }* &
[xrc:p="o"] element bitmap {_, t_bitmap }* & [xrc:p="o"] element bitmap {_, t_bitmap }* &
[xrc:p="o"] element default {_, t_bool }* [xrc:p="o"] element pressed {_, t_bitmap }* &
[xrc:p="o"] element focus {_, t_bitmap }* &
[xrc:p="o"] element disabled {_, t_bitmap }* &
[xrc:p="o"] element current {_, t_bitmap }* &
[xrc:p="o"] element default {_, t_bool }*
} }

View File

@@ -22,11 +22,6 @@ wxIMPLEMENT_DYNAMIC_CLASS(wxCommandLinkButtonXmlHandler, wxXmlResourceHandler);
wxCommandLinkButtonXmlHandler::wxCommandLinkButtonXmlHandler() wxCommandLinkButtonXmlHandler::wxCommandLinkButtonXmlHandler()
: wxXmlResourceHandler() : wxXmlResourceHandler()
{ {
XRC_ADD_STYLE(wxBU_LEFT);
XRC_ADD_STYLE(wxBU_RIGHT);
XRC_ADD_STYLE(wxBU_TOP);
XRC_ADD_STYLE(wxBU_BOTTOM);
XRC_ADD_STYLE(wxBU_EXACTFIT);
AddWindowStyles(); AddWindowStyles();
} }
@@ -54,6 +49,19 @@ wxObject *wxCommandLinkButtonXmlHandler::DoCreateResource()
SetupWindow(button); SetupWindow(button);
const wxXmlNode* node = GetParamNode("pressed");
if (node)
button->SetBitmapPressed(GetBitmapBundle(node));
node = GetParamNode("focus");
if (node)
button->SetBitmapFocus(GetBitmapBundle(node));
node = GetParamNode("disabled");
if (node)
button->SetBitmapDisabled(GetBitmapBundle(node));
node = GetParamNode("current");
if (node)
button->SetBitmapCurrent(GetBitmapBundle(node));
return button; return button;
} }