lecui 1.0.0-alpha.20
lecui C++ user interface library
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
liblec::lecui::containers::page Class Reference

Page container. More...

#include <page.h>

Inheritance diagram for liblec::lecui::containers::page:
liblec::lecui::containers::pane liblec::lecui::containers::status_pane_base liblec::lecui::containers::tab liblec::lecui::containers::side_pane liblec::lecui::containers::status_pane

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
 
pageoperator= (const page &)=delete
 

Protected Attributes

impl & _d_page
 Reference to page implementation.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ page()

liblec::lecui::containers::page::page ( form fm,
const std::string &  alias 
)

Page constructor.

Parameters
fmThe form to add the page to.
aliasThe 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.

Member Function Documentation

◆ change_in_size()

virtual const lecui::size liblec::lecui::containers::page::change_in_size ( )
virtual

Get the page's change in size.

Returns
The change in size, in pixels. If the page has not been rendered this will always return no change even if the size has, in fact, changed.

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.

◆ rendered()

const bool liblec::lecui::containers::page::rendered ( )

Check whether the page has been rendered.

Returns
Returns true if the page has been rendered, else false.

◆ scroll_horizontally()

void liblec::lecui::containers::page::scroll_horizontally ( const float &  amount)

Programmatically scroll the page horizontally.

Parameters
amountThe 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.

◆ scroll_vertically()

void liblec::lecui::containers::page::scroll_vertically ( const float &  amount)

Programmatically scroll the page vertically.

Parameters
amountThe 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.

◆ size()

virtual const size liblec::lecui::containers::page::size ( )
virtual

Get the size of the page.

Returns
The size, in pixels.

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.


The documentation for this class was generated from the following file: