xtd - Reference Guide  0.1.2
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
Loading...
Searching...
No Matches
numeric_up_down.h
Go to the documentation of this file.
1
4#pragma once
5#include "up_down_base.h"
6
8namespace xtd {
10 namespace forms {
25 public:
28
32 virtual double decimal_place() {return decimal_place_;}
37 virtual numeric_up_down& decimal_place(int32_t value);
38
42 virtual double increment() {return increment_;}
47 virtual numeric_up_down& increment(double value);
48
52 virtual double maximum() {return maximum_;}
57 virtual numeric_up_down& maximum(double value);
58
62 virtual double minimum() {return minimum_;}
67 virtual numeric_up_down& minimum(double value);
68
72 virtual double value() {return value_;}
77 virtual numeric_up_down& value(double value);
78
81 virtual bool wrapped() {return wrapped_;}
85 virtual numeric_up_down& wrapped(bool value);
86
91 void set_range(int min_value, int max_value) {
92 minimum(min_value);
93 maximum(min_value > max_value ? min_value : max_value);
94 }
95
99 xtd::ustring to_string() const noexcept override {return ustring::format("{}, minimum: {}, maximum: {}, value: {}", ustring::full_class_name(*this), minimum_, maximum_, value_);}
100
104
105 protected:
106 drawing::color default_back_color() const override {return xtd::forms::theme_colors::current_theme().window();}
107
108 drawing::color default_fore_color() const override {return xtd::forms::theme_colors::current_theme().window_text();}
109
110 drawing::size default_size() const override {return {120, 21};}
111
112 forms::create_params create_params() const override;
113
116 void on_handle_created(const event_args& e) override;
117
120 virtual void on_value_changed(const event_args& e);
121
122 void wnd_proc(message& message) override;
123
125 void wm_command(message& message);
127
128 int32_t decimal_place_ = 0;
129 double increment_ = 1.0;
130 double maximum_ = 100.0;
131 double minimum_ = 0.0;
132 double value_ = 0.0;
133 bool wrapped_ = false;
134 };
135 }
136}
Represents an ARGB (alpha, red, green, blue) color.
Definition color.h:39
Stores an ordered pair of integers, which specify a height and width.
Definition size.h:25
Represents the base class for classes that contain event data, and provides a value to use for events...
Definition event_args.h:18
Represents an event.
Definition event.h:21
Implements a Windows message.
Definition message.h:25
Represents a standard Windows numeric up down.
Definition numeric_up_down.h:24
virtual double maximum()
Gets the maximum value for the spin box (also known as an up-down control).
Definition numeric_up_down.h:52
virtual numeric_up_down & wrapped(bool value)
Set a value indicate if value can be wrapped.
numeric_up_down()
Initializes a new instance of the numeric_up_down class.
virtual bool wrapped()
Get a value indicate if value can be wrapped.
Definition numeric_up_down.h:81
virtual numeric_up_down & decimal_place(int32_t value)
Sets the number of decimal places to display in the spin box (also known as an up-down control)....
virtual double value()
Gets the value assigned to the spin box (also known as an up-down control).
Definition numeric_up_down.h:72
virtual double decimal_place()
Gets the number of decimal places to display in the spin box (also known as an up-down control)....
Definition numeric_up_down.h:32
forms::create_params create_params() const override
Gets the required creation parameters when the control handle is created.
drawing::color default_back_color() const override
Gets the default background color of the control.
Definition numeric_up_down.h:106
virtual numeric_up_down & increment(double value)
Sets the value to increment or decrement the spin box (also known as an up-down control) when the up ...
virtual numeric_up_down & maximum(double value)
Sets the maximum value for the spin box (also known as an up-down control).
xtd::ustring to_string() const noexcept override
Returns a string that represents the track_bar control.
Definition numeric_up_down.h:99
virtual double minimum()
Gets the minimum allowed value for the spin box (also known as an up-down control).
Definition numeric_up_down.h:62
virtual numeric_up_down & minimum(double value)
Sets the minimum allowed value for the spin box (also known as an up-down control).
drawing::color default_fore_color() const override
Gets the default foreground color of the control.
Definition numeric_up_down.h:108
virtual numeric_up_down & value(double value)
Sets the value assigned to the spin box (also known as an up-down control).
void on_handle_created(const event_args &e) override
Overrides control::on_handle_created(const event_args&)
void wnd_proc(message &message) override
Processes Windows messages.
virtual double increment()
Gets the value to increment or decrement the spin box (also known as an up-down control) when the up ...
Definition numeric_up_down.h:42
void set_range(int min_value, int max_value)
Sets the minimum and maximum values for a track_bar.
Definition numeric_up_down.h:91
drawing::size default_size() const override
Gets the default size of the control.
Definition numeric_up_down.h:110
virtual void on_value_changed(const event_args &e)
Raises the numeric_up_down::value_changed event.
Implements the basic functionality required by a spin box (also known as an up-down control).
Definition up_down_base.h:18
Represents text as a sequence of UTF-8 code units.
Definition ustring.h:48
event< numeric_up_down, event_handler > value_changed
Occurs when the value property has been changed in some way.
Definition numeric_up_down.h:103
#define forms_export_
Define shared library export.
Definition forms_export.h:13
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition about_box.h:13
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition system_report.h:17
Contains xtd::forms::up_down_base control.