xtd - Reference Guide  0.2.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
up_down_button.h
Go to the documentation of this file.
1 #pragma once
5 #include "button_base.h"
6 #include "orientation.h"
7 
9 namespace xtd {
11  namespace forms {
21  class forms_export_ up_down_button : public button_base {
22  public:
25 
29  virtual int32_t maximum() {return maximum_;}
34  virtual up_down_button& maximum(int32_t value);
35 
39  virtual int32_t minimum() {return minimum_;}
44  virtual up_down_button& minimum(int32_t value);
45 
48  virtual forms::orientation orientation() const {return orientation_;}
53 
57  virtual int32_t value() {return value_;}
62  virtual up_down_button& value(int32_t value);
63 
66  virtual bool wrapped() {return wrapped_;}
70  virtual up_down_button& wrapped(bool value);
71 
76  void set_range(int min_value, int max_value) {
77  minimum(min_value);
78  maximum(min_value > max_value ? min_value : max_value);
79  }
80 
84  xtd::ustring to_string() const noexcept override {return ustring::format("{}, minimum: {}, maximum: {}, value: {}", ustring::full_class_name(*this), minimum_, maximum_, value_);}
85 
89 
93 
94  protected:
95 
96  drawing::size default_size() const override {return {18, 34};}
97 
98  forms::create_params create_params() const override;
99 
102  void on_handle_created(const event_args& e) override;
103 
111  virtual void on_scroll(const event_args& e);
112 
115  virtual void on_value_changed(const event_args& e);
116 
120  void wnd_proc(message& message) override;
121 
123  bool wrapped_ = false;
124  int32_t maximum_ = 100;
125  int32_t minimum_ = 0;
127  int32_t value_ = 0;
129 
130  private:
131  void wm_scroll(message& message);
132  };
133  }
134 }
Contains xtd::forms::button_base class.
virtual bool wrapped()
Get a value indicate if value can be wrapped.
Definition: up_down_button.h:66
Represents the base class for classes that contain event data, and provides a value to use for events...
Definition: event_args.h:18
Contains xtd::forms::orientation enum class.
virtual int32_t value()
Gets the value assigned to the up_down_button control.
Definition: up_down_button.h:57
Stores an ordered pair of integers, which specify a height and width.
Definition: size.h:25
Implements the basic functionality common to button controls.
Definition: button_base.h:26
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
virtual int32_t maximum()
Gets the maximum value for the up_down_button control.
Definition: up_down_button.h:29
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:48
Represents a standard Windows up down button.
Definition: up_down_button.h:21
orientation
Specifies the orientation of controls or elements of controls.
Definition: orientation.h:18
event< up_down_button, event_handler > scroll
Occurs when either a mouse or keyboard action moves the scroll box.
Definition: up_down_button.h:88
Represents an event.
Definition: event.h:21
event< up_down_button, event_handler > value_changed
Occurs when the value of the value property changes.
Definition: up_down_button.h:92
xtd::ustring to_string() const noexcept override
Returns a string that represents the track_bar control.
Definition: up_down_button.h:84
virtual int32_t minimum()
Gets the minimum allowed value for the up_down_button control.
Definition: up_down_button.h:39
Implements a Windows message.
Definition: message.h:25
drawing::size default_size() const override
Gets the default size of the control.
Definition: up_down_button.h:96
void set_range(int min_value, int max_value)
Sets the minimum and maximum values for a track_bar.
Definition: up_down_button.h:76
static ustring full_class_name()
Gets the fully qualified class name of the objec_t, including the namespace of the objec_t...
Definition: ustring.h:427
static ustring format(const ustring &fmt, args_t &&... args)
Writes the text representation of the specified arguments list, to string using the specified format ...
Definition: ustring.h:689
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
virtual forms::orientation orientation() const
Gets a value indicating the horizontal or vertical orientation of the up down button.
Definition: up_down_button.h:48
The control or element is oriented vertically.