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

Tab container. To instantiate and add to a tab pane use the add static method. More...

#include <tab_pane.h>

Inheritance diagram for liblec::lecui::containers::tab:
liblec::lecui::containers::page liblec::lecui::widgets::badge_widget

Public Member Functions

 tab (form &fm, const std::string &tab_name)
 Class constructor. More...
 
bool operator== (const tab &param)
 Check whether two tabs are equal. Only those properties that require the widget resources to be re-created are considered. More...
 
bool operator!= (const tab &param)
 Check whether two tabs are NOT equal. Only those properties that require the widget resources to be re-created are considered. More...
 
widgets::badge_specsbadge () override
 Get or set the badge specs. More...
 
tabbadge (const widgets::badge_specs &badge)
 Set the badge specs. More...
 
const lecui::size size ()
 Get the size of the tab's page. More...
 
- Public Member Functions inherited from liblec::lecui::containers::page
 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...
 
- Public Member Functions inherited from liblec::lecui::widgets::badge_widget
bool operator== (const badge_widget &param)
 Check whether two badges are equal. Only those badge properties that require the badge's resources to be re-created are considered. More...
 
bool operator!= (const badge_widget &param)
 Check whether two badges are NOT equal. Only those badge properties that require the badge's resources to be re-created are considered. More...
 
virtual badge_specsbadge ()=0
 Get or set the widget's badge. More...
 

Static Public Member Functions

static tabadd (containers::tab_pane &tp, const std::string &tab_name)
 Create a pane. More...
 
static tabget (form &fm, const std::string &path)
 Get the tab container page of an existing tab. More...
 

Friends

class tab_builder
 

Additional Inherited Members

- Protected Member Functions inherited from liblec::lecui::containers::page
 page (const page &)=delete
 
pageoperator= (const page &)=delete
 
- Protected Attributes inherited from liblec::lecui::containers::page
impl & _d_page
 Reference to page implementation.
 
- Protected Attributes inherited from liblec::lecui::widgets::badge_widget
badge_specs _badge
 The badge's specs.
 

Detailed Description

Tab container. To instantiate and add to a tab pane use the add static method.

Any widget can be added to this container. Consequently, recursion is fully supported, allowing tab panes within tabs that are themselves in another tab pane, to virtually any depth level that the memory of the computer the app is running on can permit.

Constructor & Destructor Documentation

◆ tab()

liblec::lecui::containers::tab::tab ( form fm,
const std::string &  tab_name 
)

Class constructor.

Parameters
fmA reference to the form.
tab_nameThe tab's name.

Never to be called directly. This is called interfally by the library when the add static method is called.

Member Function Documentation

◆ add()

static tab & liblec::lecui::containers::tab::add ( containers::tab_pane tp,
const std::string &  tab_name 
)
static

Create a pane.

Parameters
tpA reference to the tab pane to place the tab in.
tab_nameThe in-page unique alias, e.g. "settings_pane".
Returns
A reference to the tab.

If an empty alias is given an internally generated random alias will be assigned.

◆ badge() [1/2]

widgets::badge_specs & liblec::lecui::containers::tab::badge ( )
overridevirtual

Get or set the badge specs.

Returns
A reference to the badge specs.

Implements liblec::lecui::widgets::badge_widget.

◆ badge() [2/2]

tab & liblec::lecui::containers::tab::badge ( const widgets::badge_specs badge)

Set the badge specs.

Parameters
badgeThe badge specs.
Returns
A reference to the modified object.

◆ get()

static tab & liblec::lecui::containers::tab::get ( form fm,
const std::string &  path 
)
static

Get the tab container page of an existing tab.

Parameters
fmThe form the container is in.
pathThe full path to the tab, e.g. "sample_page/settings_tab_pane/Options".
Returns
A reference to the tab.

Throws on failure. For faster coding and more readable code consider calling this static method through the helper macro provided (get_tab_page).

◆ operator!=()

bool liblec::lecui::containers::tab::operator!= ( const tab param)

Check whether two tabs are NOT equal. Only those properties that require the widget resources to be re-created are considered.

Parameters
paramThe tab to compare to.
Returns
Returns true if the tabs are NOT equal, else false.

◆ operator==()

bool liblec::lecui::containers::tab::operator== ( const tab param)

Check whether two tabs are equal. Only those properties that require the widget resources to be re-created are considered.

Parameters
paramThe tab to compare to.
Returns
Returns true if the tabs are equal, else false.

◆ size()

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

Get the size of the tab's 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 from liblec::lecui::containers::page.


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