xtd 0.2.0
lcd_label_with_dot_matrix.cpp

demonstrates how to use xtd::forms::lcd_label_with_dot_matrix control.

Windows

macOS

Gnome

#include <xtd/drawing/color_converter>
#include <xtd/forms/application>
#include <xtd/forms/form>
#include <xtd/forms/lcd_label>
#include <xtd/forms/timer>
using namespace xtd;
using namespace xtd::drawing;
using namespace xtd::forms;
auto main() -> int {
auto index = 0_z;
form form_main;
form_main.text("Lcd label with dot matrix example");
form_main.client_size({403, 403});
label.parent(form_main);
label.text(string::format("{}", label.valid_characters()[index]));
timer.interval(300_ms);
timer.tick += [&] {
if (++index >= label.valid_characters().size()) index = 0;
label.text(string::format("{}", label.valid_characters()[index]));
};
application::run(form_main);
}
static xtd::drawing::color average(const xtd::drawing::color &color1, const xtd::drawing::color &color2, double weight) noexcept
Returns the weighted average color between the two given colors.
static const xtd::drawing::color yellow
Gets a system-defined color that has an ARGB value of 0xFFFFFF00. This field is constant.
Definition color.hpp:476
static const xtd::drawing::color black
Gets a system-defined color that has an ARGB value of 0xFF000000. This field is constant.
Definition color.hpp:80
static void run()
Begins running a standard application message loop on the current thread, without a form.
virtual drawing::color fore_color() const noexcept
Gets the foreground color of the control.
virtual const drawing::size & client_size() const noexcept
Gets the height and width of the client area of the control.
virtual dock_style dock() const noexcept
Gets which control borders are docked to its parent control and determines how a control is resized w...
virtual drawing::color back_color() const noexcept
Gets the background color for the control.
virtual const xtd::string & text() const noexcept
Gets the text associated with this control.
virtual drawing::size size() const noexcept
Gets the height and width of the control.
virtual std::optional< control_ref > parent() const noexcept
Gets the parent container of the control.
Represents a window or dialog box that makes up an application's user interface.
Definition form.hpp:54
Represents a standard Windows label.
Definition label.hpp:38
Represents a lcd label.
Definition lcd_label.hpp:40
Implements a timer that raises an event at user-defined intervals. This timer is optimized for use in...
Definition timer.hpp:38
virtual time_span interval() const noexcept
Gets the time, in milliseconds, before the tick event is raised relative to the last occurrence of th...
virtual bool enabled() const noexcept
Gets whether the timer is running.
event< timer, event_handler > tick
Occurs when the specified timer interval has elapsed and the timer is enabled.
Definition timer.hpp:130
@ fill
All the control's edges are docked to the all edges of its containing control and sized appropriately...
Definition dock_style.hpp:35
@ dot_matrix_display
Dot matrix display style.
Definition lcd_style.hpp:31
The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functi...
Definition actions_system_images.hpp:10
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition texts.hpp:217
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8