xtd 0.2.0
numeric_up_down.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "application.hpp"
6#include "up_down_base.hpp"
7
9namespace xtd {
11 namespace forms {
35 struct data;
36
37 public:
39
44
46
51 virtual double decimal_place() const noexcept;
57
61 virtual double increment() const noexcept;
67
71 virtual double maximum() const noexcept;
76 virtual numeric_up_down& maximum(double value);
77
81 virtual double minimum() const noexcept;
86 virtual numeric_up_down& minimum(double value);
87
91 virtual double value() const noexcept;
96 virtual numeric_up_down& value(double value);
97
100 virtual bool wrapped() const noexcept;
106
108
114 void set_range(double min_value, double max_value);
115
119 xtd::string to_string() const noexcept override;
121
123
131 static numeric_up_down create(const drawing::point& location);
136 static numeric_up_down create(const drawing::point& location, const drawing::size& size);
142 static numeric_up_down create(const drawing::point& location, const drawing::size& size, const xtd::string& name);
151 static numeric_up_down create(double value, const drawing::point& location);
157 static numeric_up_down create(double value, const drawing::point& location, const drawing::size& size);
164 static numeric_up_down create(double value, const drawing::point& location, const drawing::size& size, const xtd::string& name);
169 static numeric_up_down create(double value, double maximum);
175 static numeric_up_down create(double value, double maximum, const drawing::point& location);
182 static numeric_up_down create(double value, double maximum, const drawing::point& location, const drawing::size& size);
190 static numeric_up_down create(double value, double maximum, const drawing::point& location, const drawing::size& size, const xtd::string& name);
196 static numeric_up_down create(double value, double minimum, double maximum);
203 static numeric_up_down create(double value, double minimum, double maximum, const drawing::point& location);
211 static numeric_up_down create(double value, double minimum, double maximum, const drawing::point& location, const drawing::size& size);
220 static numeric_up_down create(double value, double minimum, double maximum, const drawing::point& location, const drawing::size& size, const xtd::string& name);
229 static numeric_up_down create(const control& parent, const drawing::point& location);
235 static numeric_up_down create(const control& parent, const drawing::point& location, const drawing::size& size);
242 static numeric_up_down create(const control& parent, const drawing::point& location, const drawing::size& size, const xtd::string& name);
247 static numeric_up_down create(const control& parent, double value);
253 static numeric_up_down create(const control& parent, double value, const drawing::point& location);
260 static numeric_up_down create(const control& parent, double value, const drawing::point& location, const drawing::size& size);
268 static numeric_up_down create(const control& parent, double value, const drawing::point& location, const drawing::size& size, const xtd::string& name);
274 static numeric_up_down create(const control& parent, double value, double maximum);
281 static numeric_up_down create(const control& parent, double value, double maximum, const drawing::point& location);
289 static numeric_up_down create(const control& parent, double value, double maximum, const drawing::point& location, const drawing::size& size);
298 static numeric_up_down create(const control& parent, double value, double maximum, const drawing::point& location, const drawing::size& size, const xtd::string& name);
305 static numeric_up_down create(const control& parent, double value, double minimum, double maximum);
313 static numeric_up_down create(const control& parent, double value, double minimum, double maximum, const drawing::point& location);
322 static numeric_up_down create(const control& parent, double value, double minimum, double maximum, const drawing::point& location, const drawing::size& size);
332 static numeric_up_down create(const control& parent, double value, double minimum, double maximum, const drawing::point& location, const drawing::size& size, const xtd::string& name);
334
336
341
342 protected:
344
346 forms::create_params create_params() const noexcept override;
347 drawing::color default_back_color() const noexcept override;
348 drawing::color default_fore_color() const noexcept override;
350
352
358 xtd::uptr<xtd::object> clone() const override;
359
362 void on_handle_created(const event_args& e) override;
363
366 virtual void on_value_changed(const event_args& e);
367
368 void on_lost_focus(const event_args& e) override;
369
370 void wnd_proc(message& message) override;
372
374 void wm_command_control(message& message);
376
377 private:
378 xtd::sptr<data> data_;
379 };
380 }
381}
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.hpp:18
Represents an event.
Definition event.hpp:21
Defines the base class for controls, which are components with visual representation.
Definition control.hpp:81
virtual const xtd::string & name() const noexcept
Gets the name of the control.
virtual std::optional< control_ref > parent() const noexcept
Gets the parent container of the control.
virtual double decimal_place() const noexcept
Gets the number of decimal places to display in the spin box (also known as an up-down control)....
drawing::color default_back_color() const noexcept override
Gets the default background color of the control.
numeric_up_down()
Initializes a new instance of the numeric_up_down class.
xtd::uptr< xtd::object > clone() const override
Creates a new object that is a copy of the current instance.
virtual double increment() const noexcept
Gets the value to increment or decrement the spin box (also known as an up-down control) when the up ...
void set_range(double min_value, double max_value)
Sets the minimum and maximum values for a track_bar.
forms::create_params create_params() const noexcept override
Gets the required creation parameters when the control handle is created.
static numeric_up_down create()
A factory to create an xtd::forms::numeric_up_down.
virtual double minimum() const noexcept
Gets the minimum allowed value for the spin box (also known as an up-down control).
xtd::string to_string() const noexcept override
Returns a string that represents the track_bar control.
virtual bool wrapped() const noexcept
Gets a value indicate if value can be wrapped.
virtual double value() const noexcept
Gets 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 on_lost_focus(const event_args &e) override
Raises the xtd::forms::control::lost_focus event.
event< numeric_up_down, event_handler > value_changed
Occurs when the value property has been changed in some way.
Definition numeric_up_down.hpp:339
void wnd_proc(message &message) override
Processes Windows messages.
virtual double maximum() const noexcept
Gets the maximum value for the spin box (also known as an up-down control).
virtual void on_value_changed(const event_args &e)
Raises the numeric_up_down::value_changed event.
drawing::color default_fore_color() const noexcept override
Gets the default foreground color of the control.
up_down_base()
Initialize a new instance of up_down_base class.
generic_event_handler< const xtd::event_args & > event_handler
Represents the method that will handle an event that has no event data.
Definition event_handler.hpp:24
#define forms_export_
Define shared library export.
Definition forms_export.hpp:13
xtd::shared_ptr_object< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.hpp:25
int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
xtd::unique_ptr_object< type_t > uptr
The xtd::uptr object is a unique pointer.
Definition uptr.hpp:25
@ e
The E key.
Definition keys.hpp:207
@ location
Specifies that both the x and y coordinates of the control are defined.
Definition bounds_specified.hpp:30
@ size
Specifies that both the width and height property values of the control are defined.
Definition bounds_specified.hpp:36
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:219
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
constexpr const_pointer data() const noexcept
Gets direct access to the underlying contiguous storage.
Definition read_only_span.hpp:201
Implements a Windows message.
Definition message.hpp:33
Contains xtd::forms::up_down_base control.