Version: 2.9.4
Public Member Functions
wxRibbonBar Class Reference

#include </home/zeitlin/src/wx/github/interface/wx/ribbon/bar.h>

Inheritance diagram for wxRibbonBar:

Detailed Description

Top-level control in a ribbon user interface.

Serves as a tabbed container for wxRibbonPage - a ribbon user interface typically has a ribbon bar, which contains one or more wxRibbonPages, which in turn each contain one or more wxRibbonPanels, which in turn contain controls.

While a wxRibbonBar has tabs similar to a wxNotebook, it does not follow the same API for adding pages. Containers like wxNotebook can contain any type of window as a page, hence the normal procedure is to create the sub-window and then call wxBookCtrlBase::AddPage(). As wxRibbonBar can only have wxRibbonPage as children (and a wxRibbonPage can only have a wxRibbonBar as parent), when a page is created, it is automatically added to the bar - there is no AddPage equivalent to call.

After all pages have been created, and all controls and panels placed on those pages, Realize() must be called.

参照:
wxRibbonPage
wxRibbonPanel

Styles

This class supports the following styles:

Events emitted by this class

The following event handler macros redirect the events to member function handlers 'func' with prototypes like:

void handlerFuncName(wxRibbonBarEvent& event)

Event macros for events emitted by this class:

Library:  wxRibbon
Category:  Ribbon User Interface

Public Member Functions

 wxRibbonBar ()
 Default constructor.
 wxRibbonBar (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxRIBBON_BAR_DEFAULT_STYLE)
 Construct a ribbon bar with the given parameters.
bool Create (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxRIBBON_BAR_DEFAULT_STYLE)
 Create a ribbon bar in two-step ribbon bar construction.
virtual ~wxRibbonBar ()
 Destructor.
void SetTabCtrlMargins (int left, int right)
 Set the margin widths (in pixels) on the left and right sides of the tab bar region of the ribbon bar.
void SetArtProvider (wxRibbonArtProvider *art)
 Set the art provider to be used be the ribbon bar.
bool SetActivePage (size_t page)
 Set the active page by index, without triggering any events.
bool SetActivePage (wxRibbonPage *page)
 Set the active page, without triggering any events.
int GetActivePage () const
 Get the index of the active page.
wxRibbonPageGetPage (int n)
 Get a page by index.
size_t GetPageCount () const
 Get the number of pages in this bar.
bool DismissExpandedPanel ()
 Dismiss the expanded panel of the currently active page.
void DeletePage (size_t n)
 Delete a single page from this ribbon bar.
void ClearPages ()
 Delete all pages from the ribbon bar.
void ShowPanels (bool show=true)
 Shows or hides the panel area of the ribbon bar.
void HidePanels ()
 Hides the panel area of the ribbon bar.
bool ArePanelsShown () const
 Indicates whether the panel area of the ribbon bar is shown.
virtual bool Realize ()
 Perform initial layout and size calculations of the bar and its children.

List of all members.


Constructor & Destructor Documentation

wxRibbonBar::wxRibbonBar ( )

Default constructor.

With this constructor, Create() should be called in order to create the ribbon bar.

wxRibbonBar::wxRibbonBar ( wxWindow parent,
wxWindowID  id = wxID_ANY,
const wxPoint pos = wxDefaultPosition,
const wxSize size = wxDefaultSize,
long  style = wxRIBBON_BAR_DEFAULT_STYLE 
)

Construct a ribbon bar with the given parameters.

virtual wxRibbonBar::~wxRibbonBar ( ) [virtual]

Destructor.


Member Function Documentation

bool wxRibbonBar::ArePanelsShown ( ) const

Indicates whether the panel area of the ribbon bar is shown.

参照:
ShowPanels()
Since:
2.9.2
void wxRibbonBar::ClearPages ( )

Delete all pages from the ribbon bar.

Since:
2.9.4
bool wxRibbonBar::Create ( wxWindow parent,
wxWindowID  id = wxID_ANY,
const wxPoint pos = wxDefaultPosition,
const wxSize size = wxDefaultSize,
long  style = wxRIBBON_BAR_DEFAULT_STYLE 
)

Create a ribbon bar in two-step ribbon bar construction.

Should only be called when the default constructor is used, and arguments have the same meaning as in the full constructor.

void wxRibbonBar::DeletePage ( size_t  n)

Delete a single page from this ribbon bar.

The user must call wxRibbonBar::Realize() after one (or more) calls to this function.

Since:
2.9.4
bool wxRibbonBar::DismissExpandedPanel ( )

Dismiss the expanded panel of the currently active page.

Calls and returns the value from wxRibbonPage::DismissExpandedPanel() for the currently active page, or false if there is no active page.

int wxRibbonBar::GetActivePage ( ) const

Get the index of the active page.

In the rare case of no page being active, -1 is returned.

wxRibbonPage* wxRibbonBar::GetPage ( int  n)

Get a page by index.

NULL will be returned if the given index is out of range.

size_t wxRibbonBar::GetPageCount ( ) const

Get the number of pages in this bar.

Since:
2.9.4
void wxRibbonBar::HidePanels ( )

Hides the panel area of the ribbon bar.

This method simply calls ShowPanels() with false argument.

Since:
2.9.2
virtual bool wxRibbonBar::Realize ( ) [virtual]

Perform initial layout and size calculations of the bar and its children.

This must be called after all of the bar's children have been created (and their children created, etc.) - if it is not, then windows may not be laid out or sized correctly.

Also calls wxRibbonPage::Realize() on each child page.

Reimplemented from wxRibbonControl.

bool wxRibbonBar::SetActivePage ( size_t  page)

Set the active page by index, without triggering any events.

Parameters:
pageThe zero-based index of the page to activate.
Returns:
true if the specified page is now active, false if it could not be activated (for example because the page index is invalid).
bool wxRibbonBar::SetActivePage ( wxRibbonPage page)

Set the active page, without triggering any events.

Parameters:
pageThe page to activate.
Returns:
true if the specified page is now active, false if it could not be activated (for example because the given page is not a child of the ribbon bar).
void wxRibbonBar::SetArtProvider ( wxRibbonArtProvider art) [virtual]

Set the art provider to be used be the ribbon bar.

Also sets the art provider on all current wxRibbonPage children, and any wxRibbonPage children added in the future.

Note that unlike most other ribbon controls, the ribbon bar creates a default art provider when initialised, so an explicit call to SetArtProvider() is not required if the default art provider is sufficient. Also, unlike other ribbon controls, the ribbon bar takes ownership of the given pointer, and will delete it when the art provider is changed or the bar is destroyed. If this behaviour is not desired, then clone the art provider before setting it.

Reimplemented from wxRibbonControl.

void wxRibbonBar::SetTabCtrlMargins ( int  left,
int  right 
)

Set the margin widths (in pixels) on the left and right sides of the tab bar region of the ribbon bar.

These margins will be painted with the tab background, but tabs and scroll buttons will never be painted in the margins.

The left margin could be used for rendering something equivalent to the "Office Button", though this is not currently implemented. The right margin could be used for rendering a help button, and/or MDI buttons, but again, this is not currently implemented.

void wxRibbonBar::ShowPanels ( bool  show = true)

Shows or hides the panel area of the ribbon bar.

If the panel area is hidden, then only the tab of the ribbon bar will be shown. This is useful for giving the user more screen space to work with when he/she doesn't need to see the ribbon's options.

Since:
2.9.2
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines