13#if defined(LECUI_EXPORTS)
14 #define lecui_api __declspec(dllexport)
16 #define lecui_api __declspec(dllimport)
19 #define lecui_helper 1
22 #pragma comment(linker, "\"/manifestdependency:type='win32' \
23 name='Microsoft.Windows.Common-Controls' version='6.0.0.0' \
24 processorArchitecture='*' publicKeyToken='6595b64144ccf1df' \
29 #pragma comment(lib, "lecui64d.lib")
31 #pragma comment(lib, "lecui64.lib")
35 #pragma comment(lib, "lecui32d.lib")
37 #pragma comment(lib, "lecui32.lib")
44#pragma warning(disable:4251)
87 point(
const float x,
const float y);
128 size(
const float width,
const float height);
177 rect(
const float left,
const float right,
const float top,
const float bottom);
274 rect&
set(
float x,
float y,
float cx,
float cy);
292 rect&
place(
const rect& rect_reference,
const float& perc_h,
const float& perc_v);
366 float _width_rate = 0.f;
367 float _height_rate = 0.f;
372 float _min_width = 0.f;
373 float _min_height = 0.f;
374 float _max_width = 0.f;
375 float _max_height = 0.f;
389 resize_params(
const float x_rate,
const float y_rate,
const float width_rate,
const float height_rate);
584 unsigned short _red = 0;
585 unsigned short _green = 0;
586 unsigned short _blue = 0;
587 unsigned short _alpha = 255;
599 const unsigned short green,
600 const unsigned short blue,
601 const unsigned short alpha);
703 std::string _title =
"Open File";
704 std::vector<file_type> _file_types;
705 std::string _default_type;
706 bool _include_all_supported_types =
true;
707 bool _allow_multi_select =
false;
784 std::string _title =
"Save File";
785 std::vector<file_type> _file_types;
786 std::string _default_type;
787 bool _include_all_files =
true;
881 unsigned short hour = 0;
884 unsigned short minute = 0;
887 unsigned short second = 0;
942 static double real(
const std::any& value);
947 static std::string
text(
const std::any& value);
RGBA color on a standard 0 to 255 scale. For the alpha channel 0 is transparent and 255 is opaque.
Definition: lecui.h:583
unsigned short & green()
Get or set the green property.
color()
Color constructor. Makes opaque black (0, 0, 0, 255).
unsigned short & alpha()
Get or set the alpha property.
unsigned short & blue()
Get or set the blue property.
color & lighten(const float &percentage)
Lighten the color.
unsigned short get_red() const
Get the red property.
color & alpha(const unsigned short &alpha)
Set the alpha property.
color(const unsigned short red, const unsigned short green, const unsigned short blue, const unsigned short alpha)
Color constructor.
unsigned short get_blue() const
Get the blue property.
unsigned short get_green() const
Get the green property.
color & darken(const float &percentage)
Darken the color.
bool operator==(const color ¶m)
Check whether two colors are equal. All properties are considered.
unsigned short get_alpha() const
Get the alpha property.
unsigned short & red()
Get or set the red property.
color & red(const unsigned short &red)
Set the red property.
color & blue(const unsigned short &blue)
Set the blue property.
color & green(const unsigned short &green)
Set the green property.
bool operator!=(const color ¶m)
Check whether two colors are NOT equal. All properties are considered.
Helper class for extracting values from a std::any. Strictly added to enable more terse code and make...
Definition: lecui.h:932
static double real(const std::any &value)
Extract double value.
static std::string text(const std::any &value)
Extract text.
static int integer(const std::any &value)
Extract integer value.
Open file parameters.
Definition: lecui.h:702
std::string & title()
Get or set the title of the modal form.
bool & allow_multi_select()
Get or set whether to allow the selection of multiple files.
const bool & get_include_all_supported_types() const
Get whether to include an entry for "all supported file types".
const std::string & get_title() const
Get the title of the modal form.
open_file_params & default_type(const std::string &default_type)
Set the file type to open by default.
open_file_params & allow_multi_select(const bool &allow_multi_select)
Set whether to allow the selection of multiple files.
open_file_params & include_all_supported_types(const bool &include_all_supported_types)
Set whether to include an entry for "all supported file types".
std::vector< file_type > & file_types()
Get or set the file types to open, as defined in file_type.
std::string & default_type()
Get or set the file type to open by default, e.g. "PNG Image".
const bool & get_allow_multi_select() const
Get whether to allow the selection of multiple files.
open_file_params & file_types(const std::vector< file_type > &file_types)
Set the file types to open.
bool & include_all_supported_types()
Get or set whether to include an entry for "all supported file types".
const std::vector< file_type > & get_file_types() const
Get the file types to open, as defined in file_type.
open_file_params & title(const std::string &title)
Set the title of the modal form.
const std::string & get_default_type() const
Get the file type to open by default, e.g. "PNG Image".
A point.
Definition: lecui.h:76
float get_y() const
Get the y-coordinate, in pixels.
float & x()
Get or set the x-coordinate, in pixels.
point(const float x, const float y)
Point constructor.
point & x(const float &x)
Set the x-coordinate, in pixels.
float & y()
Get or set the y-coordinate, in pixels.
float get_x() const
Get the x-coordinate, in pixels.
point()
Point constructor. Initializes at the origin (0.f, 0.f).
point & y(const float &y)
Set the y-coordinate, in pixels.
Rectangle class.
Definition: lecui.h:158
bool operator!=(const rect ¶m)
Check whether two rectangles are NOT equal. All properties are considered.
float get_left() const
Get the left coordinate.
rect & right(const float &right)
Set the right coordinate.
rect & snap_to(const rect &rect_reference, snap_type type, const float &clearance)
Snap this rectangle to another, for quick positioning.
rect & width(float width)
Set the rectangle's width.
float get_right() const
Get the right coordinate.
snap_type
Snap type, used to position a rectangle next to another (reference) rectangle.
Definition: lecui.h:295
float width() const
Get the rectangle's width.
float & left()
Get or set the left coordinate.
rect & place(const rect &rect_reference, const float &perc_h, const float &perc_v)
Place this rectangle within or over another.
float get_top() const
Get the top coordinate.
rect & height(float height)
Set the rectangle's height.
float & bottom()
Get or set the bottom coordinate.
rect(const lecui::size size)
Rectangle constructor.
float & top()
Get or set the top coordinate.
size size() const
Get the rectangle's size.
rect & set(float x, float y, float cx, float cy)
Set the rectangle dimensions and position.
bool operator==(const rect ¶m)
Check whether two rectangles are equal. All properties are considered.
rect()
Rectangle constructor. Makes a zero size rectangle with zero width and height.
float & right()
Get or set the right coordinate.
rect & clip_to(const rect &rect_reference, const float &clearance)
Clip a rectangle within another, to prevent a rectangle going beyond stipulated confines.
float height() const
Get the rectangle's height.
rect & size(lecui::size size)
Set the rectangle's size (both width and height).
rect & bottom(const float &bottom)
Set the bottom coordinate.
float get_bottom() const
Get the bottom coordinate.
rect(const float left, const float right, const float top, const float bottom)
Rectangle constructor.
rect & left(const float &left)
Set the left coordinate.
rect & size(float width, float height)
Set the rectangle's size (both width and height).
rect & move(float x, float y)
Move the rectangle using it's top left corner.
rect & top(const float &top)
Set the top coordinate.
Resize parameters.
Definition: lecui.h:363
const float get_min_x() const
Get the minimum x-coordinate permitted as widget moves.
resize_params & y_rate(const float &y_rate)
Set the percentage rate for following the container's bottom border. 0 = doesn't move vertically,...
bool operator==(const resize_params ¶m)
Check whether two resize parameter objects are equal. All properties are considered.
float get_y_rate() const
Get the percentage rate for following the container's bottom border. 0 = doesn't move vertically,...
float & width_rate()
Get or set the percentage rate for following the container's change in width. 0 = doesn't follow chan...
resize_params & max_y(const float &max_y)
Set the maximum y-coordinate permitted as widget moves.
resize_params(const float x_rate, const float y_rate, const float width_rate, const float height_rate)
Constructor that allows initializing the most important properties.
resize_params & max_x(const float &max_x)
Set the maximum x-coordinate permitted as widget moves.
float get_min_y() const
Get minimum y-coordinate permitted as widget moves.
float & min_height()
Get or set the minimum height permitted as widget is resized.
float & min_width()
Get or set the minimum width permitted as widget is resized.
resize_params & height_rate(const float &height_rate)
Set the percentage rate for following the container's change in height. 0 = doesn't follow change in ...
resize_params & min_y(const float &min_y)
Set the minimum y-coordinate permitted as widget moves.
resize_params & width_rate(const float &width_rate)
Set the percentage rate for following the container's change in width. 0 = doesn't follow change in c...
float get_max_y() const
Get maximum y-coordinate permitted as widget moves.
float & max_height()
Get or set the maximum height permitted as widget is resized.
resize_params & x_rate(const float &x_rate)
Set the percentage rate for following the container's right border. 0 = doesn't move horizontally,...
float get_max_width() const
Get the maximum width permitted as widget is resized.
resize_params & min_x(const float &min_x)
Set the minimum x-coordinate permitted as widget moves.
float get_min_width() const
Get the minimum width permitted as widget is resized.
float & x_rate()
Get or set the percentage rate for following the container's right border. 0 = doesn't move horizonta...
float get_height_rate() const
Get the percentage rate for following the container's change in height. 0 = doesn't follow change in ...
resize_params & min_width(const float &min_width)
Set the minimum width permitted as widget is resized.
float & min_x()
Get or set the minimum x-coordinate permitted as widget moves.
bool operator!=(const resize_params ¶m)
Check whether two resize parameter objects are NOT equal. All properties are considered.
float get_min_height() const
Get the minimum height permitted as widget is resized.
resize_params()
Constructor.
float get_x_rate() const
Get the percentage rate for following the container's right border. 0 = doesn't move horizontally,...
float & max_width()
Get or set the maximum width permitted as widget is resized.
float & max_y()
Get or set the maximum y-coordinate permitted as widget moves.
float & height_rate()
Get or set the percentage rate for following the container's change in height. 0 = doesn't follow cha...
float get_max_x() const
Get the maximum x-coordinate permitted as widget moves.
resize_params & max_width(const float &max_width)
Set the maximum width permitted as widget is resized.
float get_max_height() const
Get the maximum height permitted as widget is resized.
float & y_rate()
Get or set the percentage rate for following the container's bottom border. 0 = doesn't move vertical...
float & min_y()
Get or set the minimum y-coordinate permitted as widget moves.
resize_params & max_height(const float &max_height)
Set the maximum height permitted as widget is resized.
float & max_x()
Get or set the maximum x-coordinate permitted as widget moves.
resize_params & min_height(const float &min_height)
Set the minimum height permitted as widget is resized.
float get_width_rate() const
Get the percentage rate for following the container's change in width. 0 = doesn't follow change in c...
Save file parameters.
Definition: lecui.h:783
save_file_params & file_types(const std::vector< file_type > &file_types)
Set the file types to open.
bool & include_all_files()
Get or set whether to include and "all files" entry to allow saving files with a custom extension (or...
save_file_params & include_all_files(const bool &include_all_files)
Set whether to include and "all files" entry to allow saving files with a custom extension (or none).
std::string & default_type()
Get or set the file type to open by default, e.g. "PNG Image".
std::vector< file_type > & file_types()
Get or set the file types to save to, as defined in file_type.
const std::vector< file_type > & get_file_types() const
Get the file types to save to, as defined in file_type.
save_file_params & default_type(const std::string &default_type)
Set the file type to open by default.
std::string & title()
Get or set the title of the modal form.
const std::string & get_title() const
Get the title of the modal form.
save_file_params & title(const std::string &title)
Set the title of the modal form.
const std::string & get_default_type() const
Get the file type to open by default, e.g. "PNG Image".
const bool & get_include_all_files() const
Get whether to include and "all files" entry to allow saving files with a custom extension (or none).
Size of a rectangular structure.
Definition: lecui.h:117
size()
Size constructor. Initializes with a size of 0.f x 0.f.
float get_width() const
Get or set the width of the rectangular structure, in pixels.
size & width(const float &width)
Set the width of a rectangular structure, in pixels.
float & width()
Get or set the width of the rectangular structure, in pixels.
size(const float width, const float height)
Size constructor.
float get_height() const
Get or set the height of the rectangular structure, in pixels.
size & height(const float &height)
Set the height of a rectangular structure, in pixels.
float & height()
Get or set the height of the rectangular structure, in pixels.
Time class.
Definition: lecui.h:878
std::string to_string()
Get time in the form of a string.
time(const std::string s)
Constructor.
std::string lecui_api version()
Get the version of the lecui library.
std::map< std::string, std::any > table_row
Table row; a list of (column, value) pairs. The map's "key" is the column name and it's "value" is th...
Definition: lecui.h:875
text_alignment
Text alignment.
Definition: lecui.h:951
@ right
Align text to the right.
@ left
Align text to the left edge.
@ justified
Justify the text.
@ center
Align text to the center.
image_quality
Image render quality. Used when resampling images.
Definition: lecui.h:916
@ medium
Medium image quality, for a balance between quality and rendering speed.
@ low
Low image quality, for faster rendering.
@ high
High image quality, for best image quality possibly at the cost of rendering speed.
std::string lecui_api unique_string()
Make a unique string.
paragraph_alignment
Paragraph alignment.
Definition: lecui.h:966
@ middle
Align paragraph to the middle.
@ bottom
Align paragraph to the bottom.
@ top
Align paragraph to the top.
sort_options
Sort options.
Definition: lecui.h:679
@ none
No sorting order specified.
@ ascending
Sort in ascending order.
@ descending
Sort in descending order.
std::string lecui_api unique_string_short()
Make a short unique string.
@ bottom_left
Pin the form to the bottom left corner of the working area.
@ top_left
Pin the form to the top left corner of the working area.
@ bottom_right
Pin the form to the bottom right corner of the working area.
@ top_right
Pin the form to the top right corner of the working area.
Top level namespace for the liblec libraries.
Definition: appearance.h:19
Date class.
Definition: lecui.h:904
unsigned short month
The month of the year, from 1 to 12 inclusive.
Definition: lecui.h:909
unsigned short year
The year.
Definition: lecui.h:912
unsigned short day
The day of the month.
Definition: lecui.h:906
File type.
Definition: lecui.h:691
std::string description
The description of the file type, e.g. "PNG Image".
Definition: lecui.h:698
std::string extension
The file extension, excluding the dot, e.g. "png".
Definition: lecui.h:693
Table column.
Definition: lecui.h:850
bool operator==(const table_column ¶m)
Check whether two columns are equal. Only the name and width are considered.
int precision
The number of decimal places to round off the entries in this column to when displaying (if they are ...
Definition: lecui.h:858
unsigned short width
The width of the column, in pixels.
Definition: lecui.h:855
std::string name
The name of the column. Has to be unique.
Definition: lecui.h:852
bool operator!=(const table_column ¶m)
Check whether two columns are NOT equal. Only the name and width are considered.