lecui 1.0.0-alpha.20
lecui C++ user interface library
|
Tab pane. To instantiate and add to a container use the add static method. More...
#include <tab_pane.h>
Public Types | |
enum class | side { left , right , top , bottom } |
The side to place the tabs on. More... | |
enum class | orientation { horizontal , vertical } |
Orientation of tab captions. More... | |
![]() | |
enum class | cursor_type { arrow , hand , caret } |
Mouse cursor type. More... | |
Public Member Functions | |
tab_pane () | |
Class constructor. | |
bool | operator== (const tab_pane ¶m) |
Check whether tab pane specs are equal. Only those properties that require the widget resources to be re-created are considered. More... | |
bool | operator!= (const tab_pane ¶m) |
Check whether tab pane specs are NOT equal. Only those properties that require the widget resources to be re-created are considered. More... | |
std::string & | text () override |
Get or set the widget text. More... | |
tab_pane & | text (const std::string &text) |
Set the widget's text. More... | |
std::string & | tooltip () override |
Get or set the widget's tooltip text. More... | |
tab_pane & | tooltip (const std::string &tooltip) |
Set the tooltip text. More... | |
lecui::rect & | rect () override |
Get or set the position and dimensions of the widget. More... | |
tab_pane & | rect (const lecui::rect &rect) |
Set the position and dimensions of the widget. More... | |
resize_params & | on_resize () override |
Get or set the behaviour of the widget when its container is resized. More... | |
tab_pane & | on_resize (const resize_params &on_resize) |
Set the behaviour of the widget when its container is resized. More... | |
cursor_type & | cursor () override |
Get or set the mouse cursor to use then over the widget. More... | |
tab_pane & | cursor (const cursor_type cursor) |
Set the mouse cursor to use when over the widget. More... | |
std::string & | font () override |
Get or set the default widget font, e.g. "Georgia". More... | |
tab_pane & | font (const std::string &font) |
Set the default widget font. More... | |
float & | font_size () override |
Get or set the default widget font size in points, e.g. 9.0f. More... | |
tab_pane & | font_size (const float &font_size) |
Set the widget's font size. More... | |
color & | color_text () override |
Get or set the color of the widget's text. More... | |
tab_pane & | color_text (const color &color_text) |
Set the color of the widget's text. More... | |
color & | color_fill () override |
Get or set the fill color of the widget. More... | |
tab_pane & | color_fill (const color &color_fill) |
Set the fill color of the widget. More... | |
color & | color_hot () override |
Get or set the widget's color when the mouse is hovered over it. More... | |
tab_pane & | color_hot (const color &color_hot) |
Set the widget's color when the mouse is hovered over it. More... | |
color & | color_selected () override |
Get or set the widget's color when selected. More... | |
tab_pane & | color_selected (const color &color_selected) |
Set the widget's color when selected. More... | |
color & | color_disabled () override |
Get or set the widget's color when it is disabled. More... | |
tab_pane & | color_disabled (const color &color_disabled) |
Set the widget's color when it is disabled. More... | |
float & | border () |
Get or set the thickness of the border. More... | |
tab_pane & | border (const float &border) |
Set the thickness of the border. More... | |
color & | color_border () |
Get or set the color of the border. More... | |
tab_pane & | color_border (const color &color_border) |
Set the color of the border. More... | |
float & | corner_radius_x () |
Get or set the horizontal radius of the corners. More... | |
tab_pane & | corner_radius_x (const float &corner_radius_x) |
Set the horizontal radius of the corners. More... | |
float & | corner_radius_y () |
Get or set the vertical radius of the corners. More... | |
tab_pane & | corner_radius_y (const float &corner_radius_y) |
Set the vertical radius of the corners. More... | |
side & | tab_side () |
Get or set the side on which to place the tab. More... | |
tab_pane & | tab_side (const side &tab_side) |
Set the side on which to place the tab. More... | |
std::vector< std::string > & | caption_reserve () |
Get or set the caption reserve property. More... | |
tab_pane & | caption_reserve (const std::vector< std::string > &caption_reserve) |
Set the caption reserve property. More... | |
orientation & | caption_orientation () |
Get or set the orientation of the caption text. More... | |
tab_pane & | caption_orientation (const orientation &caption_orientation) |
Set the orientation of the caption text. More... | |
color & | color_tabs () |
Get or set the fill color of the tabs. More... | |
tab_pane & | color_tabs (const color &color_tabs) |
Set the fill color of the tabs. More... | |
color & | color_tabs_border () |
Get or set the color of the tab borders. More... | |
tab_pane & | color_tabs_border (const color &color_tabs_border) |
Set the color of the tab borders. More... | |
float & | tabs_border () |
Get or set the thickness of the tab borders. More... | |
tab_pane & | tabs_border (const float &tabs_border) |
Set the thickness of the tab borders. More... | |
std::string & | selected () |
Get or set the selected tab. More... | |
tab_pane & | selected (const std::string &selected) |
Set the selected tab. More... | |
![]() | |
widget () | |
Widget constructor. | |
virtual | ~widget () |
Widget descructor. | |
bool | operator== (const widget ¶m) |
Check whether widget's basic specifications are equal. Only those properties that require the widget's basic resources to be re-created are considered. More... | |
bool | operator!= (const widget ¶m) |
Check whether widget's basic specifications are NOT equal. Only those properties that require the widget's basic resources to be re-created are considered. More... | |
virtual std::string & | text ()=0 |
Get or set the widget text. More... | |
virtual std::string & | tooltip ()=0 |
Get or set the widget's tooltip text. More... | |
virtual lecui::rect & | rect ()=0 |
Get or set the position and dimensions of the widget. More... | |
virtual resize_params & | on_resize ()=0 |
Get or set the behaviour of the widget when its container is resized. More... | |
virtual cursor_type & | cursor ()=0 |
Get or set the mouse cursor to use then over the widget. More... | |
virtual std::string & | font ()=0 |
Get or set the default widget font, e.g. "Georgia". More... | |
virtual float & | font_size ()=0 |
Get or set the default widget font size in points, e.g. 9.0f. More... | |
virtual color & | color_text ()=0 |
Get or set the color of the widget's text. More... | |
virtual color & | color_fill ()=0 |
Get or set the fill color of the widget. More... | |
virtual color & | color_hot ()=0 |
Get or set the widget's color when the mouse is hovered over it. More... | |
virtual color & | color_selected ()=0 |
Get or set the widget's color when selected. More... | |
virtual color & | color_disabled ()=0 |
Get or set the widget's color when it's disabled. More... | |
basic_events & | events () |
Widget events. More... | |
const std::string & | alias () |
The widget's alias, either user defined or automatically generated by the library. More... | |
Static Public Member Functions | |
static tab_pane & | add (containers::page &page, const std::string &alias=std::string(), const float &content_margin=10.f) |
Make a tab pane. More... | |
static tab_pane & | get (form &fm, const std::string &path) |
Get the specifications of a pane. More... | |
Additional Inherited Members | |
![]() | |
std::string | _text |
The widget's text. | |
std::string | _tooltip |
The widget's tooltip text. | |
lecui::rect | _rect |
The widget's rectangle. | |
resize_params | _on_resize = { 0.f, 0.f, 0.f, 0.f } |
The widget's behaviour when container is resized. | |
cursor_type | _cursor = cursor_type::arrow |
The widget's cursor. | |
std::string | _font = "Segoe UI" |
The widget's font. | |
float | _font_size = 9.f |
The widget's font size. | |
color | _color_text = { 0, 0, 0, 255 } |
The color of the widget's text. | |
color | _color_fill = { 0, 120, 170, 255 } |
The fill color of the widget. | |
color | _color_hot = { 0, 120, 170, 255 } |
The color to indicate when the mouse hovers over the widget. | |
color | _color_selected = { 0, 120, 170, 30 } |
The color to indicate when the widget is selected. | |
color | _color_disabled = { 180, 180, 180, 255 } |
The color to indicate when the widget is disabled. | |
Tab pane. To instantiate and add to a container use the add static method.
|
strong |
|
strong |
|
static |
Make a tab pane.
page | A reference to the container to place the tab pane in. |
alias | The in-page unique alias, e.g. "settings_tab_pane". |
content_margin | The margin to use inside the tabs. |
Ensure that the alias is unique within the page. Reusing an alias in a tab pane leads to undefined behavior.
float & liblec::lecui::containers::tab_pane::border | ( | ) |
Get or set the thickness of the border.
tab_pane & liblec::lecui::containers::tab_pane::border | ( | const float & | border | ) |
Set the thickness of the border.
border | The border thickness, in pixels. |
orientation & liblec::lecui::containers::tab_pane::caption_orientation | ( | ) |
Get or set the orientation of the caption text.
tab_pane & liblec::lecui::containers::tab_pane::caption_orientation | ( | const orientation & | caption_orientation | ) |
Set the orientation of the caption text.
caption_orientation | The caption orientation, as defined in orientation. |
std::vector< std::string > & liblec::lecui::containers::tab_pane::caption_reserve | ( | ) |
Get or set the caption reserve property.
Only affects tab captions whose orientation is perpendicular to the tab area. Make a reservation for the captions of all the tabs that are going to be added. If there is no way to know before-hand it is recommended to insert at least one dummy caption that estimates the size of the longest expected caption. This is not required if the tab caption orientation is parallel to the tab area. If the tab caption orientation is perpendicular, it is important to set this reservation before adding the first tab to the tab pane. Failure to do this will result in the thickness of the tab area being clipped to the size of the first tab's caption. This, however, won't be an issue if the rest of the tab captions are shorter than the first.
tab_pane & liblec::lecui::containers::tab_pane::caption_reserve | ( | const std::vector< std::string > & | caption_reserve | ) |
Set the caption reserve property.
caption_reserve | The list of tab captions. |
Only affects tab captions whose orientation is perpendicular to the tab area. Make a reservation for the captions of all the tabs that are going to be added. If there is no way to know before-hand it is recommended to insert at least one dummy caption that estimates the size of the longest expected caption. This is not required if the tab caption orientation is parallel to the tab area. If the tab caption orientation is perpendicular, it is important to set this reservation before adding the first tab to the tab pane. Failure to do this will result in the thickness of the tab area being clipped to the size of the first tab's caption. This, however, won't be an issue if the rest of the tab captions are shorter than the first.
color & liblec::lecui::containers::tab_pane::color_border | ( | ) |
Get or set the color of the border.
Set the color of the border.
color_border | The border color, as defined in color. |
|
overridevirtual |
Get or set the widget's color when it is disabled.
Implements liblec::lecui::widgets::widget.
Set the widget's color when it is disabled.
color_disabled | The color of the widget when it is disabled, as defined in color. |
|
overridevirtual |
Get or set the fill color of the widget.
Implements liblec::lecui::widgets::widget.
Set the fill color of the widget.
color_fill | The fill color. |
|
overridevirtual |
Get or set the widget's color when the mouse is hovered over it.
This property is not used.
Implements liblec::lecui::widgets::widget.
Set the widget's color when the mouse is hovered over it.
color_hot | The color. |
This property is not used.
|
overridevirtual |
Get or set the widget's color when selected.
This property is not used.
Implements liblec::lecui::widgets::widget.
Set the widget's color when selected.
color_selected | The widget's color when selected. |
This property is not used.
color & liblec::lecui::containers::tab_pane::color_tabs | ( | ) |
Get or set the fill color of the tabs.
Set the fill color of the tabs.
color_tabs | The color. |
color & liblec::lecui::containers::tab_pane::color_tabs_border | ( | ) |
Get or set the color of the tab borders.
tab_pane & liblec::lecui::containers::tab_pane::color_tabs_border | ( | const color & | color_tabs_border | ) |
Set the color of the tab borders.
color_tabs_border | The color. |
|
overridevirtual |
Get or set the color of the widget's text.
This property is not used.
Implements liblec::lecui::widgets::widget.
Set the color of the widget's text.
color_text | The color of the widget's text. |
This property is not used.
float & liblec::lecui::containers::tab_pane::corner_radius_x | ( | ) |
Get or set the horizontal radius of the corners.
tab_pane & liblec::lecui::containers::tab_pane::corner_radius_x | ( | const float & | corner_radius_x | ) |
Set the horizontal radius of the corners.
corner_radius_x | The horizontal radius of the corner, in pixels. |
float & liblec::lecui::containers::tab_pane::corner_radius_y | ( | ) |
Get or set the vertical radius of the corners.
tab_pane & liblec::lecui::containers::tab_pane::corner_radius_y | ( | const float & | corner_radius_y | ) |
Set the vertical radius of the corners.
corner_radius_y | The horizontal radius of the corner, in pixels. |
|
overridevirtual |
Get or set the mouse cursor to use then over the widget.
This is only used if the widget is non-static.
Implements liblec::lecui::widgets::widget.
tab_pane & liblec::lecui::containers::tab_pane::cursor | ( | const cursor_type | cursor | ) |
Set the mouse cursor to use when over the widget.
cursor | The cursor type as defined in cursor_type. |
|
overridevirtual |
Get or set the default widget font, e.g. "Georgia".
This property is not used.
Implements liblec::lecui::widgets::widget.
tab_pane & liblec::lecui::containers::tab_pane::font | ( | const std::string & | font | ) |
Set the default widget font.
font | The font's name, e.g. "Georgia". |
This property is not used.
|
overridevirtual |
Get or set the default widget font size in points, e.g. 9.0f.
This property is not used.
Implements liblec::lecui::widgets::widget.
tab_pane & liblec::lecui::containers::tab_pane::font_size | ( | const float & | font_size | ) |
Set the widget's font size.
font_size | The font size in points, e.g. 9.0f. |
This property is not used.
|
static |
Get the specifications of a pane.
fm | A reference to the form. |
path | The full path to the pane, e.g. "sample_page/settings_pane". |
Throws on failure. For faster coding and more readable code consider calling this static method through the helper macro provided.
|
overridevirtual |
Get or set the behaviour of the widget when its container is resized.
Implements liblec::lecui::widgets::widget.
tab_pane & liblec::lecui::containers::tab_pane::on_resize | ( | const resize_params & | on_resize | ) |
Set the behaviour of the widget when its container is resized.
on_resize | The resize parameters as defined in resize_params. |
bool liblec::lecui::containers::tab_pane::operator!= | ( | const tab_pane & | param | ) |
Check whether tab pane specs are NOT equal. Only those properties that require the widget resources to be re-created are considered.
param | The specs to compare to. |
bool liblec::lecui::containers::tab_pane::operator== | ( | const tab_pane & | param | ) |
Check whether tab pane specs are equal. Only those properties that require the widget resources to be re-created are considered.
param | The specs to compare to. |
|
overridevirtual |
Get or set the position and dimensions of the widget.
The position is in reference to the widget's container.
Implements liblec::lecui::widgets::widget.
tab_pane & liblec::lecui::containers::tab_pane::rect | ( | const lecui::rect & | rect | ) |
Set the position and dimensions of the widget.
rect | The widget's rectangle. |
std::string & liblec::lecui::containers::tab_pane::selected | ( | ) |
Get or set the selected tab.
tab_pane & liblec::lecui::containers::tab_pane::selected | ( | const std::string & | selected | ) |
Set the selected tab.
selected | The name of the tab. |
side & liblec::lecui::containers::tab_pane::tab_side | ( | ) |
Get or set the side on which to place the tab.
Set the side on which to place the tab.
tab_side | The property, as defined in side. |
float & liblec::lecui::containers::tab_pane::tabs_border | ( | ) |
Get or set the thickness of the tab borders.
tab_pane & liblec::lecui::containers::tab_pane::tabs_border | ( | const float & | tabs_border | ) |
Set the thickness of the tab borders.
tabs_border | The thickness, in pixels. |
|
overridevirtual |
Get or set the widget text.
This property is not used.
Implements liblec::lecui::widgets::widget.
tab_pane & liblec::lecui::containers::tab_pane::text | ( | const std::string & | text | ) |
Set the widget's text.
text | The text. |
This property is not used.
|
overridevirtual |
Get or set the widget's tooltip text.
This property is not used.
Implements liblec::lecui::widgets::widget.
tab_pane & liblec::lecui::containers::tab_pane::tooltip | ( | const std::string & | tooltip | ) |
Set the tooltip text.
tooltip | The tooltip text. |
This property is not used.