lecui 1.0.0-alpha.20
lecui C++ user interface library
controls.h
1//
2// controls.h - controls interface
3//
4// lecui user interface library, part of the liblec library
5// Copyright (c) 2019 Alec Musasa (alecmus at live dot com)
6//
7// Released under the MIT license. For full details see the
8// file LICENSE.txt
9//
10
11#pragma once
12
13#if defined(LECUI_EXPORTS)
14#include "form.h"
15#else
16#include <liblec/lecui/form.h>
17#endif
18
19namespace liblec {
20 namespace lecui {
23 class lecui_api controls {
24 public:
28
31
37 controls& allow_resize(bool enable);
38
44 controls& allow_minimize(bool enable);
45
50 controls& make_top_most(bool enable);
51
60 controls& start_hidden(bool hidden);
61
62 private:
63 class impl;
64 impl& _d;
65
66 // Default constructor and copying an object of this class are not allowed
67 controls() = delete;
68 controls(const controls&) = delete;
69 controls& operator=(const controls&) = delete;
70 };
71
74 class lecui_api dimensions {
75 public:
79
82
91 lecui::rect measure_label(const std::string& formatted_text,
92 const std::string& font, const float font_size,
94
103 lecui::rect measure_html_widget(const std::string& formatted_text,
104 const std::string& font, const float font_size,
105 text_alignment alignment, const bool editor, const lecui::rect max_rect);
106
111 [[nodiscard]] lecui::rect working_area();
112
116 [[nodiscard]] lecui::rect cursor_rect();
117
123
132 [[nodiscard]] const lecui::size get_size();
133
138 [[nodiscard]] const lecui::size get_design_size();
139
142 [[nodiscard]] const lecui::point get_position();
143
149
152 [[nodiscard]] const lecui::size& get_minimum();
153
154 private:
155 class impl;
156 impl& _d;
157
158 // Default constructor and copying an object of this class are not allowed
159 dimensions() = delete;
160 dimensions(const dimensions&) = delete;
161 dimensions& operator=(const dimensions&) = delete;
162 };
163 }
164}
Manipulate a form's controls.
Definition: controls.h:23
controls(form &fm)
Class constructor.
controls & start_hidden(bool hidden)
Whether to keep the form hidden after its creation.
controls & allow_resize(bool enable)
Whether to allow a form to be resizable.
controls & allow_minimize(bool enable)
Whether to add a minimize control button to the form.
~controls()
Class destructor.
controls & make_top_most(bool enable)
Whether to make this a top most form.
Manipulate a form's dimensions.
Definition: controls.h:74
lecui::rect working_area()
Get the working area of the screen. This is the part of the screen that excludes the operating system...
~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.
lecui::rect cursor_rect()
Get the position of the mouse cursor.
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.
dimensions(form &fm)
Class constructor.
const lecui::point get_position()
Get the form's position.
dimensions & set_minimum(const lecui::size &size)
Set the form's minimum size.
const lecui::size get_design_size()
Get the form's design size.
dimensions & set_size(const lecui::size &size)
Set the form's size.
const lecui::size get_size()
Get the form's size.
const lecui::size & get_minimum()
Get the form's minimum size.
Form base class. The user must inherit from this class and call one of the two constructors from its ...
Definition: form.h:122
A point.
Definition: lecui.h:76
Rectangle class.
Definition: lecui.h:158
Size of a rectangular structure.
Definition: lecui.h:117
text_alignment
Text alignment.
Definition: lecui.h:951
paragraph_alignment
Paragraph alignment.
Definition: lecui.h:966
Top level namespace for the liblec libraries.
Definition: appearance.h:19