wxRibbonButtonBarButton: Implemented mutable lables and minimum label width

Added new function SetButtonText() which modifies labels of
existing ribbon button bar buttons.
The new function SetButtonTextMinWidth() is used to specify the
label width in advance so that lables can be changed without
recalculating the layout.
wxRibbonArtProvider is modified to support these operation.
This commit is contained in:
Max Maisel
2018-03-14 16:55:58 +01:00
parent 5d6ba5d335
commit 7aed0e547b
6 changed files with 221 additions and 5 deletions

View File

@@ -381,12 +381,18 @@ public:
wxRibbonButtonKind kind,
wxRibbonButtonBarButtonState size,
const wxString& label,
wxCoord text_min_width,
wxSize bitmap_size_large,
wxSize bitmap_size_small,
wxSize* button_size,
wxRect* normal_region,
wxRect* dropdown_region) = 0;
virtual wxCoord GetButtonBarButtonTextWidth(
wxDC& dc, const wxString& label,
wxRibbonButtonKind kind,
wxRibbonButtonBarButtonState size) = 0;
virtual wxSize GetMinimisedPanelMinimumSize(
wxDC& dc,
const wxRibbonPanel* wnd,
@@ -584,12 +590,18 @@ public:
wxRibbonButtonKind kind,
wxRibbonButtonBarButtonState size,
const wxString& label,
wxCoord text_min_width,
wxSize bitmap_size_large,
wxSize bitmap_size_small,
wxSize* button_size,
wxRect* normal_region,
wxRect* dropdown_region) wxOVERRIDE;
wxCoord GetButtonBarButtonTextWidth(
wxDC& dc, const wxString& label,
wxRibbonButtonKind kind,
wxRibbonButtonBarButtonState size) wxOVERRIDE;
wxSize GetMinimisedPanelMinimumSize(
wxDC& dc,
const wxRibbonPanel* wnd,