#include </home/zeitlin/src/wx/github/interface/wx/ribbon/control.h>
wxRibbonControl serves as a base class for all controls which share the ribbon characteristics of having a ribbon art provider, and (optionally) non-continuous resizing.
Despite what the name may imply, it is not the top-level control for creating a ribbon interface - that is wxRibbonBar.
Ribbon controls often have a region which is "transparent", and shows the contents of the ribbon page or panel behind it. If implementing a new ribbon control, then it may be useful to realise that this effect is done by the art provider when painting the background of the control, and hence in the paint handler for the new control, you should call a draw background method on the art provider (wxRibbonArtProvider::DrawButtonBarBackground() and wxRibbonArtProvider::DrawToolBarBackground() typically just redraw what is behind the rectangle being painted) if you want transparent regions.
Public Member Functions | |
wxRibbonControl () | |
Constructor. | |
wxRibbonControl (wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxControlNameStr) | |
Constructor. | |
virtual void | SetArtProvider (wxRibbonArtProvider *art) |
Set the art provider to be used. | |
wxRibbonArtProvider * | GetArtProvider () const |
Get the art provider to be used. | |
virtual bool | IsSizingContinuous () const |
wxSize | GetNextSmallerSize (wxOrientation direction) const |
If sizing is not continuous, then return a suitable size for the control which is smaller than the current size. | |
wxSize | GetNextSmallerSize (wxOrientation direction, wxSize relative_to) const |
If sizing is not continuous, then return a suitable size for the control which is smaller than the given size. | |
wxSize | GetNextLargerSize (wxOrientation direction) const |
If sizing is not continuous, then return a suitable size for the control which is larger than the current size. | |
wxSize | GetNextLargerSize (wxOrientation direction, wxSize relative_to) const |
If sizing is not continuous, then return a suitable size for the control which is larger than the given size. | |
virtual bool | Realize () |
Perform initial size and layout calculations after children have been added, and/or realize children. | |
bool | Realise () |
Alias for Realize(). | |
virtual wxRibbonBar * | GetAncestorRibbonBar () const |
Get the first ancestor which is a wxRibbonBar (or derived) or NULL if not having such parent. | |
virtual wxSize | GetBestSizeForParentSize (const wxSize &parentSize) const |
Finds the best width and height given the parent's width and height. | |
Protected Member Functions | |
virtual wxSize | DoGetNextSmallerSize (wxOrientation direction, wxSize relative_to) const |
Implementation of GetNextSmallerSize(). | |
virtual wxSize | DoGetNextLargerSize (wxOrientation direction, wxSize relative_to) const |
Implementation of GetNextLargerSize(). |
wxRibbonControl::wxRibbonControl | ( | ) |
Constructor.
wxRibbonControl::wxRibbonControl | ( | wxWindow * | parent, |
wxWindowID | id, | ||
const wxPoint & | pos = wxDefaultPosition , |
||
const wxSize & | size = wxDefaultSize , |
||
long | style = 0 , |
||
const wxValidator & | validator = wxDefaultValidator , |
||
const wxString & | name = wxControlNameStr |
||
) |
Constructor.
If parent is a wxRibbonControl with a non-NULL art provider, then the art provider of new control is set to that of parent.
virtual wxSize wxRibbonControl::DoGetNextLargerSize | ( | wxOrientation | direction, |
wxSize | relative_to | ||
) | const [protected, virtual] |
Implementation of GetNextLargerSize().
Controls which have non-continuous sizing must override this virtual function rather than GetNextLargerSize().
virtual wxSize wxRibbonControl::DoGetNextSmallerSize | ( | wxOrientation | direction, |
wxSize | relative_to | ||
) | const [protected, virtual] |
Implementation of GetNextSmallerSize().
Controls which have non-continuous sizing must override this virtual function rather than GetNextSmallerSize().
virtual wxRibbonBar* wxRibbonControl::GetAncestorRibbonBar | ( | ) | const [virtual] |
Get the first ancestor which is a wxRibbonBar (or derived) or NULL if not having such parent.
wxRibbonArtProvider* wxRibbonControl::GetArtProvider | ( | ) | const |
Get the art provider to be used.
Note that until an art provider has been set in some way, this function may return NULL.
virtual wxSize wxRibbonControl::GetBestSizeForParentSize | ( | const wxSize & | parentSize | ) | const [virtual] |
Finds the best width and height given the parent's width and height.
Used to implement the wxRIBBON_PANEL_FLEXIBLE panel style.
wxSize wxRibbonControl::GetNextLargerSize | ( | wxOrientation | direction | ) | const |
If sizing is not continuous, then return a suitable size for the control which is larger than the current size.
direction | The direction(s) in which the size should increase. |
wxSize wxRibbonControl::GetNextLargerSize | ( | wxOrientation | direction, |
wxSize | relative_to | ||
) | const |
If sizing is not continuous, then return a suitable size for the control which is larger than the given size.
direction | The direction(s) in which the size should increase. |
relative_to | The size for which a larger size should be found. |
wxSize wxRibbonControl::GetNextSmallerSize | ( | wxOrientation | direction, |
wxSize | relative_to | ||
) | const |
If sizing is not continuous, then return a suitable size for the control which is smaller than the given size.
direction | The direction(s) in which the size should reduce. |
relative_to | The size for which a smaller size should be found. |
wxSize wxRibbonControl::GetNextSmallerSize | ( | wxOrientation | direction | ) | const |
If sizing is not continuous, then return a suitable size for the control which is smaller than the current size.
direction | The direction(s) in which the size should reduce. |
virtual bool wxRibbonControl::IsSizingContinuous | ( | ) | const [virtual] |
bool wxRibbonControl::Realise | ( | ) |
Alias for Realize().
virtual bool wxRibbonControl::Realize | ( | ) | [virtual] |
Perform initial size and layout calculations after children have been added, and/or realize children.
Reimplemented in wxRibbonBar, wxRibbonButtonBar, wxRibbonPage, wxRibbonPanel, and wxRibbonToolBar.
virtual void wxRibbonControl::SetArtProvider | ( | wxRibbonArtProvider * | art | ) | [virtual] |
Set the art provider to be used.
In many cases, setting the art provider will also set the art provider on all child windows which extend wxRibbonControl.
In most cases, controls will not take ownership of the given pointer, with the notable exception being wxRibbonBar::SetArtProvider().
Reimplemented in wxRibbonBar, wxRibbonPage, and wxRibbonPanel.