xtd 0.2.0
numeric_up_down.h
Go to the documentation of this file.
1 #pragma once
5 #include "application.h"
6 #include "up_down_base.h"
7 
9 namespace xtd {
11  namespace forms {
32  class forms_export_ numeric_up_down : public up_down_base {
33  struct data;
34 
35  public:
37 
42 
44 
49  virtual double decimal_place() const noexcept;
54  virtual numeric_up_down& decimal_place(int32 value);
55 
59  virtual double increment() const noexcept;
64  virtual numeric_up_down& increment(double value);
65 
69  virtual double maximum() const noexcept;
74  virtual numeric_up_down& maximum(double value);
75 
79  virtual double minimum() const noexcept;
84  virtual numeric_up_down& minimum(double value);
85 
89  virtual double value() const noexcept;
94  virtual numeric_up_down& value(double value);
95 
98  virtual bool wrapped() const noexcept;
102  virtual numeric_up_down& wrapped(bool value);
104 
106 
108  using control::create;
117  static numeric_up_down create(double value, double minimum = 0, double maximum = 100, const drawing::point& location = {-1, -1}, const drawing::size& size = {-1, -1}, const xtd::ustring& name = xtd::ustring::empty_string);
127  static numeric_up_down create(const control& parent, double value, double minimum = 0, double maximum = 100, const drawing::point& location = {-1, -1}, const drawing::size& size = {-1, -1}, const xtd::ustring& name = xtd::ustring::empty_string);
128 
133  void set_range(double min_value, double max_value);
134 
138  xtd::ustring to_string() const noexcept override;
140 
142 
147 
148  protected:
150 
152  forms::create_params create_params() const noexcept override;
153  drawing::color default_back_color() const noexcept override;
154  drawing::color default_fore_color() const noexcept override;
156 
158 
162  void on_handle_created(const event_args& e) override;
163 
166  virtual void on_value_changed(const event_args& e);
167 
168  void on_lost_focus(const event_args& e) override;
169 
170  void wnd_proc(message& message) override;
172 
174  void wm_command_control(message& message);
176 
177  private:
178  std::shared_ptr<data> data_;
179  };
180  }
181 }
Contains xtd::forms::application class.
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 ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional ...
Definition: point.h:54
Stores an ordered pair of integers, which specify a height and width.
Definition: size.h:31
event< numeric_up_down, event_handler > value_changed
Occurs when the value property has been changed in some way.
Definition: numeric_up_down.h:145
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
Represents a standard Windows numeric up down.
Definition: numeric_up_down.h:32
Implements the basic functionality required by a spin box (also known as an up-down control)...
Definition: up_down_base.h:21
Encapsulates the information needed when creating a control.
Definition: create_params.h:27
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:46
std::string to_string(const date_time &value, const std::string &fmt, const std::locale &loc)
Convert a specified value into a string with specified format and locale.
Definition: date_time.h:1063
static control create(const drawing::point &location={-1, -1}, const drawing::size &size={-1, -1}, const xtd::ustring &name=xtd::ustring::empty_string)
A factory to create a specified control with specified location, size, and name.
Represents an event.
Definition: event.h:21
Implements a Windows message.
Definition: message.h:26
Defines the base class for controls, which are components with visual representation.
Definition: control.h:78
int_least32_t int32
Represents a 32-bit signed integer.
Definition: types.h:129
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
static const ustring empty_string
Represents the empty string.
Definition: ustring.h:53
Specifies that both the x and y coordinates of the control are defined.
Contains xtd::forms::up_down_base control.
size_t size
Represents a size of any object in bytes.
Definition: types.h:195