Version: 3.0.3
wxRibbonAUIArtProvider Class Reference

#include <wx/ribbon/art.h>

+ Inheritance diagram for wxRibbonAUIArtProvider:

Public Member Functions

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

Constructor & Destructor Documentation

wxRibbonAUIArtProvider::wxRibbonAUIArtProvider ( )
virtual wxRibbonAUIArtProvider::~wxRibbonAUIArtProvider ( )
virtual

Member Function Documentation

wxRibbonArtProvider* wxRibbonAUIArtProvider::Clone ( ) const
virtual

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

Reimplemented from wxRibbonMSWArtProvider.

void wxRibbonAUIArtProvider::DrawButtonBarBackground ( wxDC dc,
wxWindow wnd,
const wxRect rect 
)
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.

Reimplemented from wxRibbonMSWArtProvider.

void wxRibbonAUIArtProvider::DrawButtonBarButton ( wxDC dc,
wxWindow wnd,
const wxRect rect,
wxRibbonButtonKind  kind,
long  state,
const wxString label,
const wxBitmap bitmap_large,
const wxBitmap bitmap_small 
)
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).

Reimplemented from wxRibbonMSWArtProvider.

void wxRibbonAUIArtProvider::DrawGalleryBackground ( wxDC dc,
wxRibbonGallery wnd,
const wxRect rect 
)
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.

Reimplemented from wxRibbonMSWArtProvider.

void wxRibbonAUIArtProvider::DrawGalleryItemBackground ( wxDC dc,
wxRibbonGallery wnd,
const wxRect rect,
wxRibbonGalleryItem *  item 
)
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.

Reimplemented from wxRibbonMSWArtProvider.

void wxRibbonAUIArtProvider::DrawMinimisedPanel ( wxDC dc,
wxRibbonPanel wnd,
const wxRect rect,
wxBitmap bitmap 
)
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().

Reimplemented from wxRibbonMSWArtProvider.

void wxRibbonAUIArtProvider::DrawPageBackground ( wxDC dc,
wxWindow wnd,
const wxRect rect 
)
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

Reimplemented from wxRibbonMSWArtProvider.

void wxRibbonAUIArtProvider::DrawPanelBackground ( wxDC dc,
wxRibbonPanel wnd,
const wxRect rect 
)
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.

Reimplemented from wxRibbonMSWArtProvider.

void wxRibbonAUIArtProvider::DrawScrollButton ( wxDC dc,
wxWindow wnd,
const wxRect rect,
long  style 
)
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.

Reimplemented from wxRibbonMSWArtProvider.

void wxRibbonAUIArtProvider::DrawTab ( wxDC dc,
wxWindow wnd,
const wxRibbonPageTabInfo tab 
)
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().

Reimplemented from wxRibbonMSWArtProvider.

void wxRibbonAUIArtProvider::DrawTabCtrlBackground ( wxDC dc,
wxWindow wnd,
const wxRect rect 
)
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.

Reimplemented from wxRibbonMSWArtProvider.

void wxRibbonAUIArtProvider::DrawTabSeparator ( wxDC dc,
wxWindow wnd,
const wxRect rect,
double  visibility 
)
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.

Reimplemented from wxRibbonMSWArtProvider.

void wxRibbonAUIArtProvider::DrawTool ( wxDC dc,
wxWindow wnd,
const wxRect rect,
const wxBitmap bitmap,
wxRibbonButtonKind  kind,
long  state 
)
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.

Reimplemented from wxRibbonMSWArtProvider.

void wxRibbonAUIArtProvider::DrawToolBarBackground ( wxDC dc,
wxWindow wnd,
const wxRect rect 
)
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).

Reimplemented from wxRibbonMSWArtProvider.

void wxRibbonAUIArtProvider::DrawToolGroupBackground ( wxDC dc,
wxWindow wnd,
const wxRect rect 
)
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().

Reimplemented from wxRibbonMSWArtProvider.

void wxRibbonAUIArtProvider::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 
)
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.

Reimplemented from wxRibbonMSWArtProvider.

wxColour wxRibbonAUIArtProvider::GetColour ( int  id) const
virtual

Get the value of a certain colour setting.

id can be one of the colour values of wxRibbonArtSetting.

Reimplemented from wxRibbonMSWArtProvider.

wxSize wxRibbonAUIArtProvider::GetPanelClientSize ( wxDC dc,
const wxRibbonPanel wnd,
wxSize  size,
wxPoint client_offset 
)
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()

Reimplemented from wxRibbonMSWArtProvider.

wxRect wxRibbonAUIArtProvider::GetPanelExtButtonArea ( wxDC dc,
const wxRibbonPanel wnd,
wxRect  rect 
)
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

Reimplemented from wxRibbonMSWArtProvider.

wxSize wxRibbonAUIArtProvider::GetPanelSize ( wxDC dc,
const wxRibbonPanel wnd,
wxSize  client_size,
wxPoint client_offset 
)
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()

Reimplemented from wxRibbonMSWArtProvider.

wxSize wxRibbonAUIArtProvider::GetScrollButtonMinimumSize ( wxDC dc,
wxWindow wnd,
long  style 
)
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).

Reimplemented from wxRibbonMSWArtProvider.

int wxRibbonAUIArtProvider::GetTabCtrlHeight ( wxDC dc,
wxWindow wnd,
const wxRibbonPageTabInfoArray &  pages 
)
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.

Reimplemented from wxRibbonMSWArtProvider.

void wxRibbonAUIArtProvider::SetColour ( int  id,
const wxColour colour 
)
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()

Reimplemented from wxRibbonMSWArtProvider.

void wxRibbonAUIArtProvider::SetColourScheme ( const wxColour primary,
const wxColour secondary,
const wxColour tertiary 
)
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()

Reimplemented from wxRibbonMSWArtProvider.

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

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

id can be one of the font values of wxRibbonArtSetting.

Reimplemented from wxRibbonMSWArtProvider.