#include <xtd/drawing/color_converter>
#include <xtd/forms/application>
#include <xtd/forms/form>
#include <xtd/forms/lcd_label>
#include <xtd/forms/timer>
auto main() -> int {
auto show_seconds = true;
auto clock_timer =
timer {};
clock_timer.enabled(true);
auto form_main =
form {};
form_main.auto_size(true);
label.show_back_digit(
false);
clock_timer.tick += [&] {
label.
text(show_seconds ? now.to_long_time_string() : now.to_short_time_string().replace(
':', now.second() % 2 ?
' ' :
':'));
form_main.center_to_screen();
};
label.
click += [&] {show_seconds = !show_seconds;};
}
static date_time now() noexcept
Gets a xtd::date_time object that is set to the current date and time on this computer,...
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 lime
Gets a system-defined color that has an ARGB value of 0xFF00FF00. This field is constant.
Definition color.hpp:287
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
The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functi...
Definition actions_system_images.hpp:10
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8