Version: 3.0.4
wxRibbonArtProvider Class Referenceabstract

#include <wx/ribbon/art.h>

+ Inheritance diagram for wxRibbonArtProvider:

Detailed Description

wxRibbonArtProvider is responsible for drawing all the components of the ribbon interface.

This allows a ribbon bar to have a pluggable look-and-feel, while retaining the same underlying behaviour. As a single art provider is used for all ribbon components, a ribbon bar usually has a consistent (though unique) appearance.

By default, a wxRibbonBar uses an instance of this class called wxRibbonDefaultArtProvider, which resolves to wxRibbonAUIArtProvider, wxRibbonMSWArtProvider, or wxRibbonOSXArtProvider - whichever is most appropriate to the current platform. These art providers are all slightly configurable with regard to colours and fonts, but for larger modifications, you can derive from one of these classes, or write a completely new art provider class. Call wxRibbonBar::SetArtProvider to change the art provider being used.

Library:  wxRibbon
Category:  Ribbon User Interface
See also
wxRibbonBar

Public Member Functions

 wxRibbonArtProvider ()
 Constructor. More...
 
virtual ~wxRibbonArtProvider ()
 Destructor. More...
 
virtual wxRibbonArtProviderClone () const =0
 Create a new art provider which is a clone of this one. More...
 
virtual void SetFlags (long flags)=0
 Set the style flags. More...
 
virtual long GetFlags () const =0
 Get the previously set style flags. More...
 
virtual int GetMetric (int id) const =0
 Get the value of a certain integer setting. More...
 
virtual void SetMetric (int id, int new_val)=0
 Set the value of a certain integer setting to the value new_val. More...
 
virtual void SetFont (int id, const wxFont &font)=0
 Set the value of a certain font setting to the value font. More...
 
virtual wxFont GetFont (int id) const =0
 Get the value of a certain font setting. More...
 
virtual wxColour GetColour (int id) const =0
 Get the value of a certain colour setting. More...
 
virtual void SetColour (int id, const wxColour &colour)=0
 Set the value of a certain colour setting to the value colour. More...
 
wxColour GetColor (int id) const
 
void SetColor (int id, const wxColour &color)
 
virtual void GetColourScheme (wxColour *primary, wxColour *secondary, wxColour *tertiary) const =0
 Get the current colour scheme. More...
 
virtual void SetColourScheme (const wxColour &primary, const wxColour &secondary, const wxColour &tertiary)=0
 Set all applicable colour settings from a few base colours. More...
 
virtual void DrawTabCtrlBackground (wxDC &dc, wxWindow *wnd, const wxRect &rect)=0
 Draw the background of the tab region of a ribbon bar. More...
 
virtual void DrawTab (wxDC &dc, wxWindow *wnd, const wxRibbonPageTabInfo &tab)=0
 Draw a single tab in the tab region of a ribbon bar. More...
 
virtual void DrawTabSeparator (wxDC &dc, wxWindow *wnd, const wxRect &rect, double visibility)=0
 Draw a separator between two tabs in a ribbon bar. More...
 
virtual void DrawPageBackground (wxDC &dc, wxWindow *wnd, const wxRect &rect)=0
 Draw the background of a ribbon page. More...
 
virtual void DrawScrollButton (wxDC &dc, wxWindow *wnd, const wxRect &rect, long style)=0
 Draw a ribbon-style scroll button. More...
 
virtual void DrawPanelBackground (wxDC &dc, wxRibbonPanel *wnd, const wxRect &rect)=0
 Draw the background and chrome for a ribbon panel. More...
 
virtual void DrawGalleryBackground (wxDC &dc, wxRibbonGallery *wnd, const wxRect &rect)=0
 Draw the background and chrome for a wxRibbonGallery control. More...
 
virtual void DrawGalleryItemBackground (wxDC &dc, wxRibbonGallery *wnd, const wxRect &rect, wxRibbonGalleryItem *item)=0
 Draw the background of a single item in a wxRibbonGallery control. More...
 
virtual void DrawMinimisedPanel (wxDC &dc, wxRibbonPanel *wnd, const wxRect &rect, wxBitmap &bitmap)=0
 Draw a minimised ribbon panel. More...
 
virtual void DrawButtonBarBackground (wxDC &dc, wxWindow *wnd, const wxRect &rect)=0
 Draw the background for a wxRibbonButtonBar control. More...
 
virtual void DrawButtonBarButton (wxDC &dc, wxWindow *wnd, const wxRect &rect, wxRibbonButtonKind kind, long state, const wxString &label, const wxBitmap &bitmap_large, const wxBitmap &bitmap_small)=0
 Draw a single button for a wxRibbonButtonBar control. More...
 
virtual void DrawToolBarBackground (wxDC &dc, wxWindow *wnd, const wxRect &rect)=0
 Draw the background for a wxRibbonToolBar control. More...
 
virtual void DrawToolGroupBackground (wxDC &dc, wxWindow *wnd, const wxRect &rect)=0
 Draw the background for a group of tools on a wxRibbonToolBar control. More...
 
virtual void DrawTool (wxDC &dc, wxWindow *wnd, const wxRect &rect, const wxBitmap &bitmap, wxRibbonButtonKind kind, long state)=0
 Draw a single tool (for a wxRibbonToolBar control). More...
 
virtual void DrawToggleButton (wxDC &dc, wxRibbonBar *wnd, const wxRect &rect, wxRibbonDisplayMode mode)=0
 Draw toggle button on wxRibbonBar. More...
 
virtual void DrawHelpButton (wxDC &dc, wxRibbonBar *wnd, const wxRect &rect)=0
 Draw help button on wxRibbonBar. More...
 
virtual void GetBarTabWidth (wxDC &dc, wxWindow *wnd, const wxString &label, const wxBitmap &bitmap, int *ideal, int *small_begin_need_separator, int *small_must_have_separator, int *minimum)=0
 Calculate the ideal and minimum width (in pixels) of a tab in a ribbon bar. More...
 
virtual int GetTabCtrlHeight (wxDC &dc, wxWindow *wnd, const wxRibbonPageTabInfoArray &pages)=0
 Calculate the height (in pixels) of the tab region of a ribbon bar. More...
 
virtual wxSize GetScrollButtonMinimumSize (wxDC &dc, wxWindow *wnd, long style)=0
 Calculate the minimum size (in pixels) of a scroll button. More...
 
virtual wxSize GetPanelSize (wxDC &dc, const wxRibbonPanel *wnd, wxSize client_size, wxPoint *client_offset)=0
 Calculate the size of a panel for a given client size. More...
 
virtual wxSize GetPanelClientSize (wxDC &dc, const wxRibbonPanel *wnd, wxSize size, wxPoint *client_offset)=0
 Calculate the client size of a panel for a given overall size. More...
 
virtual wxRect GetPanelExtButtonArea (wxDC &dc, const wxRibbonPanel *wnd, wxRect rect)=0
 Calculate the position and size of the panel extension button. More...
 
virtual wxSize GetGallerySize (wxDC &dc, const wxRibbonGallery *wnd, wxSize client_size)=0
 Calculate the size of a wxRibbonGallery control for a given client size. More...
 
virtual wxSize GetGalleryClientSize (wxDC &dc, const wxRibbonGallery *wnd, wxSize size, wxPoint *client_offset, wxRect *scroll_up_button, wxRect *scroll_down_button, wxRect *extension_button)=0
 Calculate the client size of a wxRibbonGallery control for a given size. More...
 
virtual wxRect GetPageBackgroundRedrawArea (wxDC &dc, const wxRibbonPage *wnd, wxSize page_old_size, wxSize page_new_size)=0
 Calculate the portion of a page background which needs to be redrawn when a page is resized. More...
 
virtual bool GetButtonBarButtonSize (wxDC &dc, wxWindow *wnd, wxRibbonButtonKind kind, wxRibbonButtonBarButtonState size, const wxString &label, wxSize bitmap_size_large, wxSize bitmap_size_small, wxSize *button_size, wxRect *normal_region, wxRect *dropdown_region)=0
 Calculate the size of a button within a wxRibbonButtonBar. More...
 
virtual wxSize GetMinimisedPanelMinimumSize (wxDC &dc, const wxRibbonPanel *wnd, wxSize *desired_bitmap_size, wxDirection *expanded_panel_direction)=0
 Calculate the size of a minimised ribbon panel. More...
 
virtual wxSize GetToolSize (wxDC &dc, wxWindow *wnd, wxSize bitmap_size, wxRibbonButtonKind kind, bool is_first, bool is_last, wxRect *dropdown_region)=0
 Calculate the size of a tool within a wxRibbonToolBar. More...
 
virtual wxRect GetBarToggleButtonArea (const wxRect &rect)=0
 Calculate the position and size of the ribbon's toggle button. More...
 
virtual wxRect GetRibbonHelpButtonArea (const wxRect &rect)=0
 Calculate the position and size of the ribbon's help button. More...
 

Constructor & Destructor Documentation

wxRibbonArtProvider::wxRibbonArtProvider ( )

Constructor.

virtual wxRibbonArtProvider::~wxRibbonArtProvider ( )
virtual

Destructor.

Member Function Documentation

virtual wxRibbonArtProvider* wxRibbonArtProvider::Clone ( ) const
pure virtual

Create a new art provider which is a clone of this one.

Implemented in wxRibbonAUIArtProvider, and wxRibbonMSWArtProvider.

virtual void wxRibbonArtProvider::DrawButtonBarBackground ( wxDC dc,
wxWindow wnd,
const wxRect rect 
)
pure virtual

Draw the background for a wxRibbonButtonBar control.

Parameters
dcThe device context to draw onto.
wndThe window which is being drawn onto (which will typically be the button bar itself, though this is not guaranteed).
rectThe rectangle within which to draw.

Implemented in wxRibbonAUIArtProvider, and wxRibbonMSWArtProvider.

virtual void wxRibbonArtProvider::DrawButtonBarButton ( wxDC dc,
wxWindow wnd,
const wxRect rect,
wxRibbonButtonKind  kind,
long  state,
const wxString label,
const wxBitmap bitmap_large,
const wxBitmap bitmap_small 
)
pure virtual

Draw a single button for a wxRibbonButtonBar control.

Parameters
dcThe device context to draw onto.
wndThe window which is being drawn onto.
rectThe rectangle within which to draw. The size of this rectangle will be a size previously returned by GetButtonBarButtonSize(), and the rectangle will be entirely within a rectangle on the same device context previously painted with DrawButtonBarBackground().
kindThe kind of button to draw (normal, dropdown or hybrid).
stateCombination of a size flag and state flags from the wxRibbonButtonBarButtonState enumeration.
labelThe label of the button.
bitmap_largeThe large bitmap of the button (or the large disabled bitmap when wxRIBBON_BUTTONBAR_BUTTON_DISABLED is set in state).
bitmap_smallThe small bitmap of the button (or the small disabled bitmap when wxRIBBON_BUTTONBAR_BUTTON_DISABLED is set in state).

Implemented in wxRibbonAUIArtProvider, and wxRibbonMSWArtProvider.

virtual void wxRibbonArtProvider::DrawGalleryBackground ( wxDC dc,
wxRibbonGallery wnd,
const wxRect rect 
)
pure virtual

Draw the background and chrome for a wxRibbonGallery control.

This should draw the border, background, scroll buttons, extension button, and any other UI elements which are not attached to a specific gallery item.

Parameters
dcThe device context to draw onto.
wndThe window which is being drawn onto, which is always the gallery whose background and chrome is being drawn. Attributes used during drawing like the gallery hover state and individual button states can be queried from this parameter by wxRibbonGallery::IsHovered(), wxRibbonGallery::GetExtensionButtonState(), wxRibbonGallery::GetUpButtonState(), and wxRibbonGallery::GetDownButtonState().
rectThe rectangle within which to draw. This rectangle is the entire area of the gallery control, not just the client rectangle.

Implemented in wxRibbonAUIArtProvider, and wxRibbonMSWArtProvider.

virtual void wxRibbonArtProvider::DrawGalleryItemBackground ( wxDC dc,
wxRibbonGallery wnd,
const wxRect rect,
wxRibbonGalleryItem *  item 
)
pure virtual

Draw the background of a single item in a wxRibbonGallery control.

This is painted on top of a gallery background, and behind the items bitmap. Unlike DrawButtonBarButton() and DrawTool(), it is not expected to draw the item bitmap - that is done by the gallery control itself.

Parameters
dcThe device context to draw onto.
wndThe window which is being drawn onto, which is always the gallery which contains the item being drawn.
rectThe rectangle within which to draw. The size of this rectangle will be the size of the item's bitmap, expanded by gallery item padding values (wxRIBBON_ART_GALLERY_BITMAP_PADDING_LEFT_SIZE, wxRIBBON_ART_GALLERY_BITMAP_PADDING_RIGHT_SIZE, wxRIBBON_ART_GALLERY_BITMAP_PADDING_TOP_SIZE, and wxRIBBON_ART_GALLERY_BITMAP_PADDING_BOTTOM_SIZE). The drawing rectangle will be entirely within a rectangle on the same device context previously painted with DrawGalleryBackground().
itemThe item whose background is being painted. Typically the background will vary if the item is hovered, active, or selected; wxRibbonGallery::GetSelection(), wxRibbonGallery::GetActiveItem(), and wxRibbonGallery::GetHoveredItem() can be called to test if the given item is in one of these states.

Implemented in wxRibbonAUIArtProvider, and wxRibbonMSWArtProvider.

virtual void wxRibbonArtProvider::DrawHelpButton ( wxDC dc,
wxRibbonBar wnd,
const wxRect rect 
)
pure virtual

Draw help button on wxRibbonBar.

This should draw a help button at top right corner of ribbon bar.

Parameters
dcThe device context to draw onto.
wndThe window which is being drawn onto, which is always the panel whose background and chrome is being drawn. The panel label and other panel attributes can be obtained by querying this.
rectThe rectangle within which to draw.
Since
2.9.5

Implemented in wxRibbonMSWArtProvider.

virtual void wxRibbonArtProvider::DrawMinimisedPanel ( wxDC dc,
wxRibbonPanel wnd,
const wxRect rect,
wxBitmap bitmap 
)
pure virtual

Draw a minimised ribbon panel.

Parameters
dcThe device context to draw onto.
wndThe window which is being drawn onto, which is always the panel which is minimised. The panel label can be obtained from this window. The minimised icon obtained from querying the window may not be the size requested by GetMinimisedPanelMinimumSize() - the bitmap argument contains the icon in the requested size.
rectThe rectangle within which to draw. The size of the rectangle will be at least the size returned by GetMinimisedPanelMinimumSize().
bitmapA copy of the panel's minimised bitmap rescaled to the size returned by GetMinimisedPanelMinimumSize().

Implemented in wxRibbonAUIArtProvider, and wxRibbonMSWArtProvider.

virtual void wxRibbonArtProvider::DrawPageBackground ( wxDC dc,
wxWindow wnd,
const wxRect rect 
)
pure virtual

Draw the background of a ribbon page.

Parameters
dcThe device context to draw onto.
wndThe window which is being drawn onto (which is commonly the wxRibbonPage whose background is being drawn, but doesn't have to be).
rectThe rectangle within which to draw.
See also
GetPageBackgroundRedrawArea

Implemented in wxRibbonAUIArtProvider, and wxRibbonMSWArtProvider.

virtual void wxRibbonArtProvider::DrawPanelBackground ( wxDC dc,
wxRibbonPanel wnd,
const wxRect rect 
)
pure virtual

Draw the background and chrome for a ribbon panel.

This should draw the border, background, label, and any other items of a panel which are outside the client area of a panel.

Note that when a panel is minimised, this function is not called - only DrawMinimisedPanel() is called, so a background should be explicitly painted by that if required.

Parameters
dcThe device context to draw onto.
wndThe window which is being drawn onto, which is always the panel whose background and chrome is being drawn. The panel label and other panel attributes can be obtained by querying this.
rectThe rectangle within which to draw.

Implemented in wxRibbonAUIArtProvider, and wxRibbonMSWArtProvider.

virtual void wxRibbonArtProvider::DrawScrollButton ( wxDC dc,
wxWindow wnd,
const wxRect rect,
long  style 
)
pure virtual

Draw a ribbon-style scroll button.

Parameters
dcThe device context to draw onto.
wndThe window which is being drawn onto.
rectThe rectangle within which to draw. The size of this rectangle will be at least the size returned by GetScrollButtonMinimumSize() for a scroll button with the same style. For tab scroll buttons, this rectangle will be entirely within a rectangle on the same device context previously painted with DrawTabCtrlBackground(), but this is not guaranteed for other types of button (for example, page scroll buttons will not be painted on an area previously painted with DrawPageBackground()).
styleA combination of flags from wxRibbonScrollButtonStyle, including a direction, a for flag, and one or more states.

Implemented in wxRibbonAUIArtProvider, and wxRibbonMSWArtProvider.

virtual void wxRibbonArtProvider::DrawTab ( wxDC dc,
wxWindow wnd,
const wxRibbonPageTabInfo tab 
)
pure virtual

Draw a single tab in the tab region of a ribbon bar.

Parameters
dcThe device context to draw onto.
wndThe window which is being drawn onto (not the wxRibbonPage associated with the tab being drawn).
tabThe rectangle within which to draw, and also the tab label, icon, and state (active and/or hovered). The drawing rectangle will be entirely within a rectangle on the same device context previously painted with DrawTabCtrlBackground(). The rectangle's width will be at least the minimum value returned by GetBarTabWidth(), and height will be the value returned by GetTabCtrlHeight().

Implemented in wxRibbonAUIArtProvider, and wxRibbonMSWArtProvider.

virtual void wxRibbonArtProvider::DrawTabCtrlBackground ( wxDC dc,
wxWindow wnd,
const wxRect rect 
)
pure virtual

Draw the background of the tab region of a ribbon bar.

Parameters
dcThe device context to draw onto.
wndThe window which is being drawn onto.
rectThe rectangle within which to draw.

Implemented in wxRibbonAUIArtProvider, and wxRibbonMSWArtProvider.

virtual void wxRibbonArtProvider::DrawTabSeparator ( wxDC dc,
wxWindow wnd,
const wxRect rect,
double  visibility 
)
pure virtual

Draw a separator between two tabs in a ribbon bar.

Parameters
dcThe device context to draw onto.
wndThe window which is being drawn onto.
rectThe rectangle within which to draw, which will be entirely within a rectangle on the same device context previously painted with DrawTabCtrlBackground().
visibilityThe opacity with which to draw the separator. Values are in the range [0, 1], with 0 being totally transparent, and 1 being totally opaque.

Implemented in wxRibbonAUIArtProvider, and wxRibbonMSWArtProvider.

virtual void wxRibbonArtProvider::DrawToggleButton ( wxDC dc,
wxRibbonBar wnd,
const wxRect rect,
wxRibbonDisplayMode  mode 
)
pure virtual

Draw toggle button on wxRibbonBar.

This should draw a small toggle button at top right corner of ribbon bar.

Parameters
dcThe device context to draw onto.
wndThe window which is being drawn onto, which is always the panel whose background and chrome is being drawn. The panel label and other panel attributes can be obtained by querying this.
rectThe rectangle within which to draw.
modeThe wxRibbonDisplayMode which should be applied to display button
Since
2.9.5

Implemented in wxRibbonMSWArtProvider.

virtual void wxRibbonArtProvider::DrawTool ( wxDC dc,
wxWindow wnd,
const wxRect rect,
const wxBitmap bitmap,
wxRibbonButtonKind  kind,
long  state 
)
pure virtual

Draw a single tool (for a wxRibbonToolBar control).

Parameters
dcThe device context to draw onto.
wndThe window which is being drawn onto. In most cases this will be a wxRibbonToolBar, but it doesn't have to be.
rectThe rectangle within which to draw. The size of this rectangle will at least the size returned by GetToolSize(), and the height of it will be equal for all tools within the same group. The rectangle will be entirely within a rectangle on the same device context previously painted with DrawToolGroupBackground().
bitmapThe bitmap to use as the tool's foreground. If the tool is a hybrid or dropdown tool, then the foreground should also contain a standard dropdown button.
kindThe kind of tool to draw (normal, dropdown, or hybrid).
stateA combination of wxRibbonToolBarToolState flags giving the state of the tool and it's relative position within a tool group.

Implemented in wxRibbonAUIArtProvider, and wxRibbonMSWArtProvider.

virtual void wxRibbonArtProvider::DrawToolBarBackground ( wxDC dc,
wxWindow wnd,
const wxRect rect 
)
pure virtual

Draw the background for a wxRibbonToolBar control.

Parameters
dcThe device context to draw onto.
wndThe which is being drawn onto. In most cases this will be a wxRibbonToolBar, but it doesn't have to be.
rectThe rectangle within which to draw. Some of this rectangle will later be drawn over using DrawToolGroupBackground() and DrawTool(), but not all of it will (unless there is only a single group of tools).

Implemented in wxRibbonAUIArtProvider, and wxRibbonMSWArtProvider.

virtual void wxRibbonArtProvider::DrawToolGroupBackground ( wxDC dc,
wxWindow wnd,
const wxRect rect 
)
pure virtual

Draw the background for a group of tools on a wxRibbonToolBar control.

Parameters
dcThe device context to draw onto.
wndThe window which is being drawn onto. In most cases this will be a wxRibbonToolBar, but it doesn't have to be.
rectThe rectangle within which to draw. This rectangle is a union of the individual tools' rectangles. As there are no gaps between tools, this rectangle will be painted over exactly once by calls to DrawTool(). The group background could therefore be painted by DrawTool(), though it can be conceptually easier and more efficient to draw it all at once here. The rectangle will be entirely within a rectangle on the same device context previously painted with DrawToolBarBackground().

Implemented in wxRibbonAUIArtProvider, and wxRibbonMSWArtProvider.

virtual void wxRibbonArtProvider::GetBarTabWidth ( wxDC dc,
wxWindow wnd,
const wxString label,
const wxBitmap bitmap,
int *  ideal,
int *  small_begin_need_separator,
int *  small_must_have_separator,
int *  minimum 
)
pure virtual

Calculate the ideal and minimum width (in pixels) of a tab in a ribbon bar.

Parameters
dcA device context to use when one is required for size calculations.
wndThe window onto which the tab will eventually be drawn.
labelThe tab's label (or wxEmptyString if it has none).
bitmapThe tab's icon (or wxNullBitmap if it has none).
[out]idealThe ideal width (in pixels) of the tab.
[out]small_begin_need_separatorA size less than the ideal size, at which a tab separator should begin to be drawn (i.e. drawn, but still fairly transparent).
[out]small_must_have_separatorA size less than the small_begin_need_separator size, at which a tab separator must be drawn (i.e. drawn at full opacity).
[out]minimumA size less than the small_must_have_separator size, and greater than or equal to zero, which is the minimum pixel width for the tab.

Implemented in wxRibbonAUIArtProvider, and wxRibbonMSWArtProvider.

virtual wxRect wxRibbonArtProvider::GetBarToggleButtonArea ( const wxRect rect)
pure virtual

Calculate the position and size of the ribbon's toggle button.

Parameters
rectThe ribbon bar rectangle from which calculate toggle button rectangle.
Since
2.9.5

Implemented in wxRibbonMSWArtProvider.

virtual bool wxRibbonArtProvider::GetButtonBarButtonSize ( wxDC dc,
wxWindow wnd,
wxRibbonButtonKind  kind,
wxRibbonButtonBarButtonState  size,
const wxString label,
wxSize  bitmap_size_large,
wxSize  bitmap_size_small,
wxSize button_size,
wxRect normal_region,
wxRect dropdown_region 
)
pure virtual

Calculate the size of a button within a wxRibbonButtonBar.

Parameters
dcA device context to use when one is required for size calculations.
wndThe window onto which the button will eventually be drawn (which is normally a wxRibbonButtonBar, though this is not guaranteed).
kindThe kind of button.
sizeThe size-class to calculate the size for. Buttons on a button bar can have three distinct sizes: wxRIBBON_BUTTONBAR_BUTTON_SMALL, wxRIBBON_BUTTONBAR_BUTTON_MEDIUM, and wxRIBBON_BUTTONBAR_BUTTON_LARGE. If the requested size-class is not applicable, then false should be returned.
labelThe label of the button.
bitmap_size_largeThe size of all "large" bitmaps on the button bar.
bitmap_size_smallThe size of all "small" bitmaps on the button bar.
[out]button_sizeThe size, in pixels, of the button.
[out]normal_regionThe region of the button which constitutes the normal button.
[out]dropdown_regionThe region of the button which constitutes the dropdown button.
Returns
true if a size exists for the button, false otherwise.

Implemented in wxRibbonMSWArtProvider.

wxColour wxRibbonArtProvider::GetColor ( int  id) const
virtual wxColour wxRibbonArtProvider::GetColour ( int  id) const
pure virtual

Get the value of a certain colour setting.

id can be one of the colour values of wxRibbonArtSetting.

Implemented in wxRibbonAUIArtProvider, and wxRibbonMSWArtProvider.

virtual void wxRibbonArtProvider::GetColourScheme ( wxColour primary,
wxColour secondary,
wxColour tertiary 
) const
pure virtual

Get the current colour scheme.

Returns three colours such that if SetColourScheme() were called with them, the colour scheme would be restored to what it was when SetColourScheme() was last called. In practice, this usually means that the returned values are the three colours given in the last call to SetColourScheme(), however if SetColourScheme() performs an idempotent operation upon the colours it is given (like clamping a component of the colour), then the returned values may not be the three colours given in the last call to SetColourScheme(). If SetColourScheme() has not been called, then the returned values should result in a colour scheme similar to, if not identical to, the default colours of the art provider. Note that if SetColour() is called, then GetColourScheme() does not try and return a colour scheme similar to colours being used - it's return values are dependent upon the last values given to SetColourScheme(), as described above.

Parameters
[out]primaryPointer to a location to store the primary colour, or NULL.
[out]secondaryPointer to a location to store the secondary colour, or NULL.
[out]tertiaryPointer to a location to store the tertiary colour, or NULL.

Implemented in wxRibbonMSWArtProvider.

virtual long wxRibbonArtProvider::GetFlags ( ) const
pure virtual

Get the previously set style flags.

Implemented in wxRibbonMSWArtProvider.

virtual wxFont wxRibbonArtProvider::GetFont ( int  id) const
pure virtual

Get the value of a certain font setting.

id can be one of the font values of wxRibbonArtSetting.

Implemented in wxRibbonMSWArtProvider.

virtual wxSize wxRibbonArtProvider::GetGalleryClientSize ( wxDC dc,
const wxRibbonGallery wnd,
wxSize  size,
wxPoint client_offset,
wxRect scroll_up_button,
wxRect scroll_down_button,
wxRect extension_button 
)
pure virtual

Calculate the client size of a wxRibbonGallery control for a given size.

This should act as the inverse to GetGallerySize(), and decrement the given size by enough to fit the gallery border, buttons, and other chrome.

Parameters
dcA device context to use if one is required for size calculations.
wndThe gallery in question.
sizeThe overall size to calculate the client size for.
[out]client_offsetThe position within the given size at which the returned client size begins.
[out]scroll_up_buttonThe rectangle within the given size which the scroll up button occupies.
[out]scroll_down_buttonThe rectangle within the given size which the scroll down button occupies.
[out]extension_buttonThe rectangle within the given size which the extension button occupies.

Implemented in wxRibbonMSWArtProvider.

virtual wxSize wxRibbonArtProvider::GetGallerySize ( wxDC dc,
const wxRibbonGallery wnd,
wxSize  client_size 
)
pure virtual

Calculate the size of a wxRibbonGallery control for a given client size.

This should increment the given size by enough to fit the gallery border, buttons, and any other chrome.

Parameters
dcA device context to use if one is required for size calculations.
wndThe gallery in question.
client_sizeThe client size.
See also
GetGalleryClientSize()

Implemented in wxRibbonMSWArtProvider.

virtual int wxRibbonArtProvider::GetMetric ( int  id) const
pure virtual

Get the value of a certain integer setting.

id can be one of the size values of wxRibbonArtSetting.

Implemented in wxRibbonMSWArtProvider.

virtual wxSize wxRibbonArtProvider::GetMinimisedPanelMinimumSize ( wxDC dc,
const wxRibbonPanel wnd,
wxSize desired_bitmap_size,
wxDirection expanded_panel_direction 
)
pure virtual

Calculate the size of a minimised ribbon panel.

Parameters
dcA device context to use when one is required for size calculations.
wndThe ribbon panel in question. Attributes like the panel label can be queried from this.
[out]desired_bitmap_sizeOptional parameter which is filled with the size of the bitmap suitable for a minimised ribbon panel.
[out]expanded_panel_directionOptional parameter which is filled with the direction of the minimised panel (wxEAST or wxSOUTH depending on the style).

Implemented in wxRibbonMSWArtProvider.

virtual wxRect wxRibbonArtProvider::GetPageBackgroundRedrawArea ( wxDC dc,
const wxRibbonPage wnd,
wxSize  page_old_size,
wxSize  page_new_size 
)
pure virtual

Calculate the portion of a page background which needs to be redrawn when a page is resized.

To optimise the drawing of page backgrounds, as small an area as possible should be returned. Of course, if the way in which a background is drawn means that the entire background needs to be repainted on resize, then the entire new size should be returned.

Parameters
dcA device context to use when one is required for size calculations.
wndThe page which is being resized.
page_old_sizeThe size of the page prior to the resize (which has already been painted).
page_new_sizeThe size of the page after the resize.

Implemented in wxRibbonMSWArtProvider.

virtual wxSize wxRibbonArtProvider::GetPanelClientSize ( wxDC dc,
const wxRibbonPanel wnd,
wxSize  size,
wxPoint client_offset 
)
pure virtual

Calculate the client size of a panel for a given overall size.

This should act as the inverse to GetPanelSize(), and decrement the given size by enough to fit the panel label and other chrome.

Parameters
dcA device context to use if one is required for size calculations.
wndThe ribbon panel in question.
sizeThe overall size to calculate client size for.
[out]client_offsetThe offset where the returned client size begins within the given size (may be NULL).
See also
GetPanelSize()

Implemented in wxRibbonAUIArtProvider, and wxRibbonMSWArtProvider.

virtual wxRect wxRibbonArtProvider::GetPanelExtButtonArea ( wxDC dc,
const wxRibbonPanel wnd,
wxRect  rect 
)
pure virtual

Calculate the position and size of the panel extension button.

Parameters
dcA device context to use if one is required for size calculations.
wndThe ribbon panel in question.
rectThe panel rectangle from which calculate extension button rectangle.
Since
2.9.4

Implemented in wxRibbonAUIArtProvider, and wxRibbonMSWArtProvider.

virtual wxSize wxRibbonArtProvider::GetPanelSize ( wxDC dc,
const wxRibbonPanel wnd,
wxSize  client_size,
wxPoint client_offset 
)
pure virtual

Calculate the size of a panel for a given client size.

This should increment the given size by enough to fit the panel label and other chrome.

Parameters
dcA device context to use if one is required for size calculations.
wndThe ribbon panel in question.
client_sizeThe client size.
[out]client_offsetThe offset where the client rectangle begins within the panel (may be NULL).
See also
GetPanelClientSize()

Implemented in wxRibbonAUIArtProvider, and wxRibbonMSWArtProvider.

virtual wxRect wxRibbonArtProvider::GetRibbonHelpButtonArea ( const wxRect rect)
pure virtual

Calculate the position and size of the ribbon's help button.

Parameters
rectThe ribbon bar rectangle from which calculate help button rectangle.
Since
2.9.5

Implemented in wxRibbonMSWArtProvider.

virtual wxSize wxRibbonArtProvider::GetScrollButtonMinimumSize ( wxDC dc,
wxWindow wnd,
long  style 
)
pure virtual

Calculate the minimum size (in pixels) of a scroll button.

Parameters
dcA device context to use when one is required for size calculations.
wndThe window onto which the scroll button will eventually be drawn.
styleA combination of flags from wxRibbonScrollButtonStyle, including a direction, and a for flag (state flags may be given too, but should be ignored, as a button should retain a constant size, regardless of its state).

Implemented in wxRibbonAUIArtProvider, and wxRibbonMSWArtProvider.

virtual int wxRibbonArtProvider::GetTabCtrlHeight ( wxDC dc,
wxWindow wnd,
const wxRibbonPageTabInfoArray &  pages 
)
pure virtual

Calculate the height (in pixels) of the tab region of a ribbon bar.

Note that as the tab region can contain scroll buttons, the height should be greater than or equal to the minimum height for a tab scroll button.

Parameters
dcA device context to use when one is required for size calculations.
wndThe window onto which the tabs will eventually be drawn.
pagesThe tabs which will acquire the returned height.

Implemented in wxRibbonAUIArtProvider, and wxRibbonMSWArtProvider.

virtual wxSize wxRibbonArtProvider::GetToolSize ( wxDC dc,
wxWindow wnd,
wxSize  bitmap_size,
wxRibbonButtonKind  kind,
bool  is_first,
bool  is_last,
wxRect dropdown_region 
)
pure virtual

Calculate the size of a tool within a wxRibbonToolBar.

Parameters
dcA device context to use when one is required for size calculations.
wndThe window onto which the tool will eventually be drawn.
bitmap_sizeThe size of the tool's foreground bitmap.
kindThe kind of tool (normal, dropdown, or hybrid).
is_firsttrue if the tool is the first within its group. false otherwise.
is_lasttrue if the tool is the last within its group. false otherwise.
[out]dropdown_regionFor dropdown and hybrid tools, the region within the returned size which counts as the dropdown part.

Implemented in wxRibbonMSWArtProvider.

void wxRibbonArtProvider::SetColor ( int  id,
const wxColour color 
)
virtual void wxRibbonArtProvider::SetColour ( int  id,
const wxColour colour 
)
pure virtual

Set the value of a certain colour setting to the value colour.

id can be one of the colour values of wxRibbonArtSetting, though not all colour settings will have an effect on every art provider.

See also
SetColourScheme()

Implemented in wxRibbonAUIArtProvider, and wxRibbonMSWArtProvider.

virtual void wxRibbonArtProvider::SetColourScheme ( const wxColour primary,
const wxColour secondary,
const wxColour tertiary 
)
pure virtual

Set all applicable colour settings from a few base colours.

Uses any or all of the three given colours to create a colour scheme, and then sets all colour settings which are relevant to the art provider using that scheme. Note that some art providers may not use the tertiary colour for anything, and some may not use the secondary colour either.

See also
SetColour()
GetColourScheme()

Implemented in wxRibbonAUIArtProvider, and wxRibbonMSWArtProvider.

virtual void wxRibbonArtProvider::SetFlags ( long  flags)
pure virtual

Set the style flags.

Normally called automatically by wxRibbonBar::SetArtProvider with the ribbon bar's style flags, so that the art provider has the same flags as the bar which it is serving.

Implemented in wxRibbonMSWArtProvider.

virtual void wxRibbonArtProvider::SetFont ( int  id,
const wxFont font 
)
pure virtual

Set the value of a certain font setting to the value font.

id can be one of the font values of wxRibbonArtSetting.

Implemented in wxRibbonAUIArtProvider, and wxRibbonMSWArtProvider.

virtual void wxRibbonArtProvider::SetMetric ( int  id,
int  new_val 
)
pure virtual

Set the value of a certain integer setting to the value new_val.

id can be one of the size values of wxRibbonArtSetting.

Implemented in wxRibbonMSWArtProvider.