wxRibbonButtonBarButton: Implemented manual button size class control
Added new functions SetButtonMinSizeClass() and SetButtonMaxSizeClass() that set a button's minimum and maximum allowed size class during ribbon layout collapsing. Size classes are values from wxRibbonButtonBarButtonState enum. wxRibbonButtonBar::MakeLayouts() and wxRibbonButtonBar::TryCollapseLayout() are modified to support this new behaviour. The modified wxRibbonButtonBar provate layout routines are aware of wxRIBBON_BUTTONBAR_BUTTON_SMALL which is not implemented yet in MSW wxRibbonMSWArtProvider::DrawButtonBarButtonForeground.
This commit is contained in:
@@ -568,6 +568,38 @@ public:
|
||||
*/
|
||||
virtual void SetButtonTextMinWidth(int button_id, const wxString& label);
|
||||
|
||||
/**
|
||||
Sets the minimum size class of a ribbon button.
|
||||
|
||||
You have to call Realize() after calling this function to
|
||||
apply the given minimum size.
|
||||
|
||||
@param button_id
|
||||
ID of the button to manipulate.
|
||||
@param min_size_class
|
||||
The minimum size-class of the button. Buttons on a button bar
|
||||
can have three distinct sizes: wxRIBBON_BUTTONBAR_BUTTON_SMALL,
|
||||
wxRIBBON_BUTTONBAR_BUTTON_MEDIUM, and wxRIBBON_BUTTONBAR_BUTTON_LARGE.
|
||||
*/
|
||||
virtual void SetButtonMinSizeClass(int button_id,
|
||||
wxRibbonButtonBarButtonState min_size_class);
|
||||
|
||||
/**
|
||||
Sets the maximum size class of a ribbon button.
|
||||
|
||||
You have to call Realize() after calling this function to
|
||||
apply the given maximum size.
|
||||
|
||||
@param button_id
|
||||
ID of the button to manipulate.
|
||||
@param max_size_class
|
||||
The maximum size-class of the button. Buttons on a button bar
|
||||
can have three distinct sizes: wxRIBBON_BUTTONBAR_BUTTON_SMALL,
|
||||
wxRIBBON_BUTTONBAR_BUTTON_MEDIUM, and wxRIBBON_BUTTONBAR_BUTTON_LARGE.
|
||||
*/
|
||||
virtual void SetButtonMaxSizeClass(int button_id,
|
||||
wxRibbonButtonBarButtonState max_size_class);
|
||||
|
||||
/**
|
||||
Returns the active item of the button bar or NULL if there is none.
|
||||
The active button is the one being clicked.
|
||||
|
Reference in New Issue
Block a user