lecui 1.0.0-alpha.20
lecui C++ user interface library
|
Manipulate a form's dimensions. More...
#include <controls.h>
Public Member Functions | |
dimensions (form &fm) | |
Class constructor. More... | |
~dimensions () | |
Class destructor. | |
lecui::rect | measure_label (const std::string &formatted_text, const std::string &font, const float font_size, text_alignment alignment, paragraph_alignment paragraph_alignment, const lecui::rect max_rect) |
Measure how much space a label will take. More... | |
lecui::rect | measure_html_widget (const std::string &formatted_text, const std::string &font, const float font_size, text_alignment alignment, const bool editor, const lecui::rect max_rect) |
Measure how much space an html widget will take. More... | |
lecui::rect | working_area () |
Get the working area of the screen. This is the part of the screen that excludes the operating system's task bar. More... | |
lecui::rect | cursor_rect () |
Get the position of the mouse cursor. More... | |
dimensions & | set_size (const lecui::size &size) |
Set the form's size. More... | |
const lecui::size | get_size () |
Get the form's size. More... | |
const lecui::size | get_design_size () |
Get the form's design size. More... | |
const lecui::point | get_position () |
Get the form's position. More... | |
dimensions & | set_minimum (const lecui::size &size) |
Set the form's minimum size. More... | |
const lecui::size & | get_minimum () |
Get the form's minimum size. More... | |
Manipulate a form's dimensions.
This manipulation is best done in the form's initialize event.
liblec::lecui::dimensions::dimensions | ( | form & | fm | ) |
Class constructor.
fm | A reference to the form. |
lecui::rect liblec::lecui::dimensions::cursor_rect | ( | ) |
Get the position of the mouse cursor.
This method is DPI aware.
const lecui::size liblec::lecui::dimensions::get_design_size | ( | ) |
Get the form's design size.
The design size is the the size that pages 'see' when they are added to the form. This is the size of the form minus any external resizing by the user or the operating system.
const lecui::size & liblec::lecui::dimensions::get_minimum | ( | ) |
Get the form's minimum size.
const lecui::point liblec::lecui::dimensions::get_position | ( | ) |
Get the form's position.
const lecui::size liblec::lecui::dimensions::get_size | ( | ) |
Get the form's size.
Do not use this for laying out widgets on the form. Widgets are never placed directly onto a form, only into containers. Therefore, use the size of the containers for widget layout. Containers are never the same size as the form, some room is left for the form border, form controls, and depending on the container possibly scroll area etc. Refer to the container's documentation for more details.
lecui::rect liblec::lecui::dimensions::measure_html_widget | ( | const std::string & | formatted_text, |
const std::string & | font, | ||
const float | font_size, | ||
text_alignment | alignment, | ||
const bool | editor, | ||
const lecui::rect | max_rect | ||
) |
Measure how much space an html widget will take.
formatted_text | The formatted text. |
font | The font, e.g. Segoe UI. |
font_size | The font size, in points, e.g. 9.0f. |
alignment | The alignment of the text. |
editor | Whether this is an html_editor. Use false for an html_view. |
max_rect | The area which the text should not exceed. |
lecui::rect liblec::lecui::dimensions::measure_label | ( | const std::string & | formatted_text, |
const std::string & | font, | ||
const float | font_size, | ||
text_alignment | alignment, | ||
paragraph_alignment | paragraph_alignment, | ||
const lecui::rect | max_rect | ||
) |
Measure how much space a label will take.
formatted_text | The formatted text. |
font | The font, e.g. Segoe UI. |
font_size | The font size, in points, e.g. 9.0f. |
alignment | The alignment of the text. |
paragraph_alignment | The paragraph alignment. |
max_rect | The area which the text should not exceed. |
dimensions & liblec::lecui::dimensions::set_minimum | ( | const lecui::size & | size | ) |
Set the form's minimum size.
size | The size, in pixels. |
This manipulation should be done in the form's layout method.
dimensions & liblec::lecui::dimensions::set_size | ( | const lecui::size & | size | ) |
Set the form's size.
size | The size, in pixels. |
To pre-set the form's design size, this manipulation should be done in the form's initialize event.
lecui::rect liblec::lecui::dimensions::working_area | ( | ) |
Get the working area of the screen. This is the part of the screen that excludes the operating system's task bar.
As with all lecui methods, this method is also DPI aware.