]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/ribbon/page.h
1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxRibbonPage
4 // Author: Peter Cawley
5 // Licence: wxWindows licence
6 ///////////////////////////////////////////////////////////////////////////////
11 Container for related ribbon panels, and a tab within a ribbon bar.
19 class wxRibbonPage
: public wxRibbonControl
24 With this constructor, Create() should be called in order to create
30 Constructs a ribbon page, which must be a child of a ribbon bar.
33 Pointer to a parent wxRibbonBar (unlike most controls, a wxRibbonPage
34 can only have wxRibbonBar as a parent).
38 Label to be used in the wxRibbonBar's tab list for this page (if the
39 ribbon bar is set to display labels).
41 Icon to be used in the wxRibbonBar's tab list for this page (if the
42 ribbon bar is set to display icons).
44 Currently unused, should be zero.
46 wxRibbonPage(wxRibbonBar
* parent
,
47 wxWindowID id
= wxID_ANY
,
48 const wxString
& label
= wxEmptyString
,
49 const wxBitmap
& icon
= wxNullBitmap
,
55 virtual ~wxRibbonPage();
58 Create a ribbon page in two-step ribbon page construction.
59 Should only be called when the default constructor is used, and
60 arguments have the same meaning as in the full constructor.
62 bool Create(wxRibbonBar
* parent
,
63 wxWindowID id
= wxID_ANY
,
64 const wxString
& label
= wxEmptyString
,
65 const wxBitmap
& icon
= wxNullBitmap
,
69 Set the art provider to be used. Normally called automatically by
70 wxRibbonBar when the page is created, or the art provider changed on the
73 The new art provider will be propagated to the children of the page.
75 void SetArtProvider(wxRibbonArtProvider
* art
);
78 Get the icon used for the page in the ribbon bar tab area (only
79 displayed if the ribbon bar is actually showing icons).
84 Set the size of the page and the external scroll buttons (if any).
86 When a page is too small to display all of its children, scroll buttons
87 will appear (and if the page is sized up enough, they will disappear again).
88 Slightly counter-intuitively, these buttons are created as siblings of the
89 page rather than children of the page (to achieve correct cropping and
90 paint ordering of the children and the buttons). When there are no scroll
91 buttons, this function behaves the same as SetSize(), however when there
92 are scroll buttons, it positions them at the edges of the given area, and
93 then calls SetSize() with the remaining area.
95 This is provided as a separate function to SetSize() rather than within
96 the implementation of SetSize(), as interacting algorithms may not expect
97 SetSize() to also set the size of siblings.
99 void SetSizeWithScrollButtonAdjustment(int x
, int y
, int width
, int height
);
102 Expand a rectangle of the page to include external scroll buttons (if
103 any). When no scroll buttons are shown, has no effect.
106 The rectangle to adjust. The width and height will not be reduced,
107 and the x and y will not be increased.
109 void AdjustRectToIncludeScrollButtons(wxRect
* rect
) const;
112 Dismiss the current externally expanded panel, if there is one.
114 When a ribbon panel automatically minimises, it can be externally
115 expanded into a floating window. When the user clicks a button in such
116 a panel, the panel should generally re-minimise. Event handlers for
117 buttons on ribbon panels should call this method to achieve this
120 @return @true if a panel was minimised, @false otherwise.
122 bool DismissExpandedPanel();
125 Perform a full re-layout of all panels on the page.
127 Should be called after panels are added to the page, or the sizing
128 behaviour of a panel on the page changes (i.e. due to children being
129 added to it). Usually called automatically when wxRibbonBar::Realize()
132 Will invoke wxRibbonPanel::Realize() for all child panels.
134 virtual bool Realize();
137 Scroll the page by some amount up / down / left / right.
139 When the page's children are too big to fit in the onscreen area given to
140 the page, scroll buttons will appear, and the page can be programmatically
141 scrolled. Positive values of @a lines will scroll right or down, while
142 negative values will scroll up or left (depending on the direction in which
143 panels are stacked). A line is equivalent to a constant number of pixels.
145 @return @true if the page scrolled at least one pixel in the given
146 direction, @false if it did not scroll.
150 @see ScrollSections()
152 virtual bool ScrollLines(int lines
);
155 Scroll the page by a set number of pixels up / down / left / right.
157 When the page's children are too big to fit in the onscreen area given to
158 the page, scroll buttons will appear, and the page can be programmatically
159 scrolled. Positive values of @a lines will scroll right or down, while
160 negative values will scroll up or left (depending on the direction in which
163 @return @true if the page scrolled at least one pixel in the given
164 direction, @false if it did not scroll.
168 @see ScrollSections()
170 bool ScrollPixels(int pixels
);
173 Scroll the page by an entire child section.
175 The @a sections parameter value should be 1 or -1. This will scroll
176 enough to uncover a partially visible child section or totally uncover
177 the next child section that may not be visible at all.
179 @return @true if the page scrolled at least one pixel in the given
180 direction, @false if it did not scroll.
183 @see ScrollSections()
187 bool ScrollSections(int sections
);
190 Get the direction in which ribbon panels are stacked within the page.
192 This is controlled by the style of the containing wxRibbonBar, meaning
193 that all pages within a bar will have the same major axis. As well as
194 being the direction in which panels are stacked, it is also the axis in
195 which scrolling will occur (when required).
197 @return wxHORIZONTAL or wxVERTICAL (never wxBOTH).
199 wxOrientation
GetMajorAxis() const;