lecui 1.0.0-alpha.20
lecui C++ user interface library
|
Pane container. To create an instance use the add static method. More...
#include <pane.h>
Public Member Functions | |
pane (form &fm, const std::string &alias) | |
Class constructor. More... | |
const lecui::size | size () override |
Get the size of the pane's page. More... | |
![]() | |
bool | operator== (const pane_specs ¶m) |
Check whether pane specs are equal. Only those properties that require the widget resources to be re-created are considered. More... | |
bool | operator!= (const pane_specs ¶m) |
Check whether 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... | |
pane_specs & | text (const std::string &text) |
Set the widget's text. More... | |
std::string & | tooltip () override |
Get or set the widget's tooltip text. More... | |
pane_specs & | tooltip (const std::string &tooltip) |
Set the tooltip text. More... | |
widgets::badge_specs & | badge () override |
Get or set the badge specs. More... | |
pane_specs & | badge (const widgets::badge_specs &badge) |
Set the badge specs. More... | |
lecui::rect & | rect () override |
Get or set the position and dimensions of the widget. More... | |
pane_specs & | 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... | |
pane_specs & | 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... | |
pane_specs & | 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... | |
pane_specs & | 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... | |
pane_specs & | 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... | |
pane_specs & | 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... | |
pane_specs & | 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... | |
pane_specs & | 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... | |
pane_specs & | 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... | |
pane_specs & | 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... | |
pane_specs & | border (const float &border) |
Set the thickness of the border. More... | |
color & | color_border () |
Get or set the color of the border. More... | |
pane_specs & | 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... | |
pane_specs & | 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... | |
pane_specs & | corner_radius_y (const float &corner_radius_y) |
Set the vertical radius of the corners. 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... | |
![]() | |
bool | operator== (const badge_widget ¶m) |
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 ¶m) |
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_specs & | badge ()=0 |
Get or set the widget's badge. More... | |
![]() | |
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... | |
Static Public Member Functions | |
static pane & | add (containers::page &page, const std::string &alias=std::string(), const float &content_margin=10.f) |
Make a pane. More... | |
static pane & | get (form &fm, const std::string &path) |
Get the specifications of a pane. More... | |
Additional Inherited Members | |
![]() | |
enum class | cursor_type { arrow , hand , caret } |
Mouse cursor type. More... | |
![]() | |
page (const page &)=delete | |
page & | operator= (const page &)=delete |
![]() | |
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. | |
![]() | |
badge_specs | _badge |
The badge's specs. | |
![]() | |
impl & | _d_page |
Reference to page implementation. | |
Pane container. To create an instance use the add static method.
Any widget can be added to this container. Consequently, recursion is fully supported, allowing panes within panes, to virtually any depth level that the memory of the computer the app is running on can permit.
liblec::lecui::containers::pane::pane | ( | form & | fm, |
const std::string & | alias | ||
) |
Class constructor.
fm | A reference to the form. |
alias | The pane's unique alias. |
///
Never to be called directly. This is called interfally by the library when the add static method is called.
|
static |
Make a pane.
page | A reference to the container to place the pane in. |
alias | The in-page unique alias, e.g. "settings_pane". |
content_margin | The margin to use inside the pane. |
If an empty alias is given an internally generated random alias will be assigned.
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 the size of the pane's 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 from liblec::lecui::containers::page.