lecui 1.0.0-alpha.20
lecui C++ user interface library
|
Page container. More...
#include <page.h>
Public Member Functions | |
page (form &fm, const std::string &alias) | |
Page constructor. More... | |
virtual const size | size () |
Get the size of the page. More... | |
const bool | rendered () |
Check whether the page has been rendered. More... | |
virtual const lecui::size | change_in_size () |
Get the page's change in size. More... | |
void | scroll_vertically (const float &amount) |
Programmatically scroll the page vertically. More... | |
void | scroll_horizontally (const float &amount) |
Programmatically scroll the page horizontally. More... | |
Protected Member Functions | |
page (const page &)=delete | |
page & | operator= (const page &)=delete |
Protected Attributes | |
impl & | _d_page |
Reference to page implementation. | |
Page container.
This is the generic container type, and is the only one of the containers that can be added directly to a form. Any widget and any container can be added to it. It comes full featured with scroll bars that appear if anything within it exceeds it's dimensions. It covers the entire form save for the border and the titlebar. It's size is tightly coupled to the form, and is resized automatically as the form is resized. As such, it's size cannot be directly manipulated. Other container types, however, can be resized directly, e.g. panes, but then they cannot be added directly to a form.
liblec::lecui::containers::page::page | ( | form & | fm, |
const std::string & | alias | ||
) |
Page constructor.
fm | The form to add the page to. |
alias | The in-form unique alias, e.g. "home_page". |
Ensure that the alias is unique within the form. Reusing an alias in a form leads to undefined behavior.
|
virtual |
Get the page's change in size.
This size reflects any changes made by the user through the user interface. This is useful when a widget's resizing behavior cannot be fully described using the widget's on_resize property, e.g. if you need to make an html view's size match its text. It is important to check whether the page has been rendered first. If it hasn't been rendered, as shown by rendered, then re-call this method later to get the page's actual change in size.
const bool liblec::lecui::containers::page::rendered | ( | ) |
Check whether the page has been rendered.
void liblec::lecui::containers::page::scroll_horizontally | ( | const float & | amount | ) |
Programmatically scroll the page horizontally.
amount | The amount of pixels to scroll the page widgets by. |
A negative value moves the widgets to the left; it's equivalent to sliding the horizontal scroll bar towards the right, and vice-versa. If the page has no horizontal scroll bar this method has no effect.
void liblec::lecui::containers::page::scroll_vertically | ( | const float & | amount | ) |
Programmatically scroll the page vertically.
amount | The amount of pixels to scroll the page widgets by. |
A negative value moves the widgets upwards; it's equivalent to sliding the vertical scroll bar downwards, and vice-versa. If the page has no vertical scroll bar this method has no effect.
|
virtual |
Get the size of the page.
The size is automatically determined by the library. It is important to note that any widgets added to a page, and any other container for that matter, only see the dimensions and coordinates of that container not those of the form or another container higher up the hierarchy. Dimensions and coordinates are local to a container.
Reimplemented in liblec::lecui::containers::tab, and liblec::lecui::containers::pane.