AGW Logo

agw_title RibbonAUIArtProvider

hierarchy Inheritance Diagram

Inheritance diagram for: RibbonAUIArtProvider

Inheritance diagram of RibbonAUIArtProvider


method_summary Methods Summary

__init__
CloneCreate a new art provider which is a clone of this one.
DrawButtonBarBackgroundDraw the background for a RibbonButtonBar control.
DrawButtonBarButtonDraw a single button for a RibbonButtonBar control.
DrawGalleryBackgroundDraw the background and chrome for a RibbonGallery control.
DrawGalleryButton
DrawGalleryItemBackgroundDraw the background of a single item in a RibbonGallery control.
DrawMinimisedPanelDraw a minimised ribbon panel.
DrawPageBackgroundDraw the background of a ribbon page.
DrawPanelBackgroundDraw the background and chrome for a ribbon panel.
DrawPartialPanelBackground
DrawScrollButtonDraw a ribbon-style scroll button.
DrawTabDraw a single tab in the tab region of a ribbon bar.
DrawTabCtrlBackgroundDraw the background of the tab region of a ribbon bar.
DrawTabSeparatorDraw a separator between two tabs in a ribbon bar.
DrawToolDraw a single tool (for a RibbonToolBar control).
DrawToolBarBackgroundDraw the background for a RibbonToolBar control.
DrawToolGroupBackgroundDraw the background for a group of tools on a RibbonToolBar control.
GetBarTabWidthCalculate the ideal and minimum width (in pixels) of a tab in a ribbon bar.
GetColourGet the value of a certain colour setting.
GetPanelClientSizeCalculate the client size of a panel for a given overall size.
GetPanelSizeCalculate the size of a panel for a given client size.
GetScrollButtonMinimumSizeCalculate the minimum size (in pixels) of a scroll button.
GetTabCtrlHeightCalculate the height (in pixels) of the tab region of a ribbon bar.
SetColourSet the value of a certain colour setting to the value.
SetColourSchemeSet all applicable colour settings from a few base colours.
SetFontSet the value of a certain font setting to the value.

API Class API

class RibbonAUIArtProvider(RibbonMSWArtProvider)[source]


__init__()[source]


Clone()[source]

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



DrawButtonBarBackground(dc, wnd, rect)[source]

Draw the background for a RibbonButtonBar control.

Parameters:
  • dc – The device context to draw onto;
  • wnd – The window which is being drawn onto (which will typically be the button bar itself, though this is not guaranteed);
  • rect – The rectangle within which to draw.


DrawButtonBarButton(dc, wnd, rect, kind, state, label, bitmap_large, bitmap_small)[source]

Draw a single button for a RibbonButtonBar control.

Parameters:
  • dc – The device context to draw onto;
  • wnd – The window which is being drawn onto;
  • rect – The rectangle within which to draw. The size of this rectangle will be a size previously returned by RibbonMSWArtProvider.GetButtonBarButtonSize(), and the rectangle will be entirely within a rectangle on the same device context previously painted with DrawButtonBarBackground;
  • kind – The kind of button to draw (normal, dropdown or hybrid);
  • state – Combination of a size flag and state flags from the RibbonButtonBarButtonState enumeration;
  • label – The label of the button;
  • bitmap_large – The large bitmap of the button (or the large disabled bitmap when RIBBON_BUTTONBAR_BUTTON_DISABLED is set in );
  • bitmap_small – The small bitmap of the button (or the small disabled bitmap when RIBBON_BUTTONBAR_BUTTON_DISABLED is set in ).


DrawGalleryBackground(dc, wnd, rect)[source]

Draw the background and chrome for a RibbonGallery control.

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

Parameters:


DrawGalleryButton(dc, rect, state, bitmaps)[source]


DrawGalleryItemBackground(dc, wnd, rect, item)[source]

Draw the background of a single item in a RibbonGallery 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:
  • dc – The device context to draw onto;
  • wnd – The window which is being drawn onto, which is always the gallery which contains the item being drawn;
  • rect – The 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 (RIBBON_ART_GALLERY_BITMAP_PADDING_LEFT_SIZE, RIBBON_ART_GALLERY_BITMAP_PADDING_RIGHT_SIZE, RIBBON_ART_GALLERY_BITMAP_PADDING_TOP_SIZE, and RIBBON_ART_GALLERY_BITMAP_PADDING_BOTTOM_SIZE). The drawing rectangle will be entirely within a rectangle on the same device context previously painted with DrawGalleryBackground;
  • item – The item whose background is being painted. Typically the background will vary if the item is hovered, active, or selected; RibbonGallery.GetSelection(), RibbonGallery.GetActiveItem(), and RibbonGallery.GetHoveredItem() can be called to test if the given item is in one of these states.


DrawMinimisedPanel(dc, wnd, rect, bitmap)[source]

Draw a minimised ribbon panel.

Parameters:


DrawPageBackground(dc, wnd, rect)[source]

Draw the background of a ribbon page.

Parameters:
  • dc – The device context to draw onto;
  • wnd – The window which is being drawn onto (which is commonly the RibbonPage whose background is being drawn, but doesn’t have to be);
  • rect – The rectangle within which to draw.


DrawPanelBackground(dc, wnd, rect)[source]

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:
  • dc – The device context to draw onto;
  • wnd – The 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;
  • rect – The rectangle within which to draw.


DrawPartialPanelBackground(dc, wnd, rect)[source]


DrawScrollButton(dc, wnd, rect, style)[source]

Draw a ribbon-style scroll button.

Parameters:
  • dc – The device context to draw onto;
  • wnd – The window which is being drawn onto;
  • rect – The 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);
  • style – A combination of flags from RibbonScrollButtonStyle, including a direction, a for flag, and one or more states.


DrawTab(dc, wnd, tab)[source]

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

Parameters:
  • dc – The device context to draw onto;
  • wnd – The window which is being drawn onto (not the RibbonPage associated with the tab being drawn);
  • tab – The 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.


DrawTabCtrlBackground(dc, wnd, rect)[source]

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

Parameters:
  • dc – The device context to draw onto;
  • wnd – The window which is being drawn onto;
  • rect – The rectangle within which to draw.


DrawTabSeparator(dc, wnd, rect, visibility)[source]

Draw a separator between two tabs in a ribbon bar.

Parameters:
  • dc – The device context to draw onto;
  • wnd – The window which is being drawn onto;
  • rect – The rectangle within which to draw, which will be entirely within a rectangle on the same device context previously painted with DrawTabCtrlBackground;
  • visibility – The opacity with which to draw the separator. Values are in the range [0, 1], with 0 being totally transparent, and 1 being totally opaque.


DrawTool(dc, wnd, rect, bitmap, kind, state)[source]

Draw a single tool (for a RibbonToolBar control).

Parameters:
  • dc – The device context to draw onto;
  • wnd – The window which is being drawn onto. In most cases this will be a RibbonToolBar, but it doesn’t have to be;
  • rect – The rectangle within which to draw. The size of this rectangle will at least the size returned by RibbonMSWArtProvider.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;
  • bitmap – The 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;
  • kind – The kind of tool to draw (normal, dropdown, or hybrid);
  • state – A combination of RibbonToolBarToolState flags giving the state of the tool and it’s relative position within a tool group.


DrawToolBarBackground(dc, wnd, rect)[source]

Draw the background for a RibbonToolBar control.

Parameters:
  • dc – The device context to draw onto;
  • wnd – The which is being drawn onto. In most cases this will be a RibbonToolBar, but it doesn’t have to be;
  • rect – The 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).


DrawToolGroupBackground(dc, wnd, rect)[source]

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

Parameters:
  • dc – The device context to draw onto;
  • wnd – The window which is being drawn onto. In most cases this will be a RibbonToolBar, but it doesn’t have to be;
  • rect – The 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.


GetBarTabWidth(dc, wnd, label, bitmap, ideal=None, small_begin_need_separator=None, small_must_have_separator=None, minimum=None)[source]

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

Parameters:
  • dc – A device context to use when one is required for size calculations;
  • wnd – The window onto which the tab will eventually be drawn;
  • label – The tab’s label (or an empty string if it has none);
  • bitmap – The tab’s icon (or wx.NullBitmap if it has none);
  • ideal – The ideal width (in pixels) of the tab;
  • small_begin_need_separator – A size less than the size, at which a tab separator should begin to be drawn (i.e. drawn, but still fairly transparent);
  • small_must_have_separator – A size less than the size, at which a tab separator must be drawn (i.e. drawn at full opacity);
  • minimum – A size less than the size, and greater than or equal to zero, which is the minimum pixel width for the tab.


GetColour(id)[source]

Get the value of a certain colour setting.

can be one of the colour values of RibbonArtSetting.

Parameters:id – the colour id.


GetPanelClientSize(dc, wnd, size, client_offset=None)[source]

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:
  • dc – A device context to use if one is required for size calculations;
  • wnd – The ribbon panel in question;
  • size – The overall size to calculate client size for;
  • client_offset – The offset where the returned client size begins within the given (may be None).

See also

GetPanelSize



GetPanelSize(dc, wnd, client_size, client_offset=None)[source]

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:
  • dc – A device context to use if one is required for size calculations;
  • wnd – The ribbon panel in question;
  • client_size – The client size;
  • client_offset – The offset where the client rectangle begins within the panel (may be None).


GetScrollButtonMinimumSize(dc, wnd, style)[source]

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

Parameters:
  • dc – A device context to use when one is required for size calculations;
  • wnd – The window onto which the scroll button will eventually be drawn;
  • style – A combination of flags from RibbonScrollButtonStyle, 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).


GetTabCtrlHeight(dc, wnd, pages)[source]

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:
  • dc – A device context to use when one is required for size calculations;
  • wnd – The window onto which the tabs will eventually be drawn;
  • pages – The tabs which will acquire the returned height.


SetColour(id, colour)[source]

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

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

Parameters:
  • id – the colour id;
  • colour – MISSING DESCRIPTION.

See also

SetColourScheme



SetColourScheme(primary, secondary, tertiary)[source]

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.

Parameters:
  • primary – MISSING DESCRIPTION;
  • secondary – MISSING DESCRIPTION;
  • tertiary – MISSING DESCRIPTION.


SetFont(id, font)[source]

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

can be one of the font values of RibbonArtSetting.

Parameters:
  • id – the font id;
  • font – MISSING DESCRIPTION.
Tree

Table Of Contents

Previous topic

ribbon.art_aui

Next topic

ribbon.art_aui functions