lecui 1.0.0-alpha.20
lecui C++ user interface library
Classes | Public Types | Public Member Functions | Protected Attributes | List of all members
liblec::lecui::widgets::widget Class Referenceabstract

Base class for all widgets. More...

#include <widget.h>

Inheritance diagram for liblec::lecui::widgets::widget:
liblec::lecui::containers::group liblec::lecui::containers::pane_specs liblec::lecui::containers::tab_pane liblec::lecui::widgets::button liblec::lecui::widgets::checkbox liblec::lecui::widgets::combobox liblec::lecui::widgets::custom liblec::lecui::widgets::date liblec::lecui::widgets::html_editor liblec::lecui::widgets::icon liblec::lecui::widgets::image_view liblec::lecui::widgets::label liblec::lecui::widgets::line liblec::lecui::widgets::progress_bar liblec::lecui::widgets::progress_indicator liblec::lecui::widgets::rectangle liblec::lecui::widgets::slider liblec::lecui::widgets::strength_bar liblec::lecui::widgets::table_view liblec::lecui::widgets::text_field liblec::lecui::widgets::time liblec::lecui::widgets::toggle liblec::lecui::widgets::tree_view

Classes

struct  basic_events
 Events common to all widgets. More...
 

Public Types

enum class  cursor_type { arrow , hand , caret }
 Mouse cursor type. More...
 

Public Member Functions

 widget ()
 Widget constructor.
 
virtual ~widget ()
 Widget descructor.
 
bool operator== (const widget &param)
 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 &param)
 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::rectrect ()=0
 Get or set the position and dimensions of the widget. More...
 
virtual resize_paramson_resize ()=0
 Get or set the behaviour of the widget when its container is resized. More...
 
virtual cursor_typecursor ()=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 colorcolor_text ()=0
 Get or set the color of the widget's text. More...
 
virtual colorcolor_fill ()=0
 Get or set the fill color of the widget. More...
 
virtual colorcolor_hot ()=0
 Get or set the widget's color when the mouse is hovered over it. More...
 
virtual colorcolor_selected ()=0
 Get or set the widget's color when selected. More...
 
virtual colorcolor_disabled ()=0
 Get or set the widget's color when it's disabled. More...
 
basic_eventsevents ()
 Widget events. More...
 
const std::string & alias ()
 The widget's alias, either user defined or automatically generated by the library. More...
 

Protected Attributes

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.
 

Detailed Description

Base class for all widgets.

Member Enumeration Documentation

◆ cursor_type

Mouse cursor type.

Enumerator
arrow 

Arrow cursor. Used in most cases.

hand 

Hand cursor. Used to show that an action or link is available over the control.

caret 

Caret cursor. Used to show the position in text where the next character will be inserted.

Member Function Documentation

◆ alias()

const std::string & liblec::lecui::widgets::widget::alias ( )
inline

The widget's alias, either user defined or automatically generated by the library.

Returns
The alias.

◆ color_disabled()

virtual color & liblec::lecui::widgets::widget::color_disabled ( )
pure virtual

◆ color_fill()

virtual color & liblec::lecui::widgets::widget::color_fill ( )
pure virtual

◆ color_hot()

virtual color & liblec::lecui::widgets::widget::color_hot ( )
pure virtual

◆ color_selected()

virtual color & liblec::lecui::widgets::widget::color_selected ( )
pure virtual

◆ color_text()

virtual color & liblec::lecui::widgets::widget::color_text ( )
pure virtual

◆ cursor()

virtual cursor_type & liblec::lecui::widgets::widget::cursor ( )
pure virtual

◆ events()

basic_events & liblec::lecui::widgets::widget::events ( )
inline

Widget events.

Widgets with additional events need to override this method.

Returns
A reference to the widget's basic events.

◆ font()

virtual std::string & liblec::lecui::widgets::widget::font ( )
pure virtual

◆ font_size()

virtual float & liblec::lecui::widgets::widget::font_size ( )
pure virtual

◆ on_resize()

virtual resize_params & liblec::lecui::widgets::widget::on_resize ( )
pure virtual

◆ operator!=()

bool liblec::lecui::widgets::widget::operator!= ( const widget param)

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.

Parameters
paramThe specs to compare to.
Returns
Returns true if the widget specifications are NOT equal, else false.

◆ operator==()

bool liblec::lecui::widgets::widget::operator== ( const widget param)

Check whether widget's basic specifications are equal. Only those properties that require the widget's basic resources to be re-created are considered.

Parameters
paramThe specs to compare to.
Returns
Returns true if the widget specifications are equal, else false.

◆ rect()

virtual lecui::rect & liblec::lecui::widgets::widget::rect ( )
pure virtual

◆ text()

virtual std::string & liblec::lecui::widgets::widget::text ( )
pure virtual

◆ tooltip()

virtual std::string & liblec::lecui::widgets::widget::tooltip ( )
pure virtual

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