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.
Go to the documentation of this file.
1 #pragma once
5 #include "control.h"
6 #include "orientation.h"
7 #include "progress_bar_style.h"
10 namespace xtd {
12  namespace forms {
31  class forms_export_ progress_bar : public control {
32  public:
35  progress_bar();
39  drawing::size default_size() const override {return {100, 23};}
45  virtual size_t marquee_animation_speed() {return marquee_animation_speed_;}
50  virtual progress_bar& marquee_animation_speed(size_t marquee_animation_speed);
56  virtual int32_t maximum() {return maximum_;}
61  virtual progress_bar& maximum(int32_t maximum);
66  virtual int32_t minimum() {return minimum_;}
70  virtual progress_bar& minimum(int32_t minimum);
75  virtual forms::orientation orientation() const {return orientation_;}
84  virtual int32_t step() {return step_;}
88  virtual progress_bar& step(int32_t step);
93  virtual progress_bar_style style() const {return style_;}
97  virtual progress_bar& style(progress_bar_style style);
104  virtual int32_t value() {return value_;}
110  virtual progress_bar& value(int32_t value);
116  void increment(int32_t value) {
117  if (value_ + value < minimum_)
118  this->value(minimum_);
119  if (value_ + value > maximum_)
120  this->value(maximum_);
121  else
122  this->value(value_ + value);
123  }
127  void perform_step() {increment(step());}
133  void set_range(int min_value, int max_value) {
134  minimum(min_value);
135  maximum(min_value > max_value ? min_value : max_value);
136  }
141  xtd::ustring to_string() const noexcept override {return ustring::format("{}, minimum: {}, maximum: {}, value: {}", ustring::full_class_name(*this), minimum_, maximum_, value_);}
143  protected:
146  forms::create_params create_params() const override;
150  void on_handle_created(const event_args& e) override;
153  size_t marquee_animation_speed_ = 100;
154  int32_t maximum_ = 100;
155  int32_t minimum_ = 0;
157  int32_t step_ = 10;
159  int32_t value_ = 0;
161  };
162  }
163 }
The control or element is oriented horizontally.
void perform_step()
Advances the current position of the progress bar by the amount of the Step property.
Definition: progress_bar.h:127
Indicates progress by increasing the number of segmented blocks in a progress_bar.
xtd::ustring to_string() const noexcept override
Returns a string that represents the progress_bar control.
Definition: progress_bar.h:141
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.
Stores an ordered pair of integers, which specify a height and width.
Definition: size.h:25
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
void increment(int32_t value)
Advances the current position of the progress bar by the specified amount.
Definition: progress_bar.h:116
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:48
virtual progress_bar_style style() const
Gets the manner in which progress should be indicated on the progress bar.
Definition: progress_bar.h:93
virtual int32_t step()
Gets the amount by which a call to the PerformStep() method increases the current position of the pro...
Definition: progress_bar.h:84
Specifies the orientation of controls or elements of controls.
Definition: orientation.h:18
Represents a Windows progress bar control.
Definition: progress_bar.h:31
Specifies the progress_bar_style of controls or elements of controls.
Definition: progress_bar_style.h:18
virtual size_t marquee_animation_speed()
Gets he time period, in milliseconds, that it takes the progress block to scroll across the progress ...
Definition: progress_bar.h:45
virtual int32_t value()
Gets the current position of the progress bar.
Definition: progress_bar.h:104
virtual int32_t minimum()
Gets the minimum value of the range of the control.
Definition: progress_bar.h:66
void set_range(int min_value, int max_value)
Sets the minimum and maximum values for a xtd::forms::progress_bar.
Definition: progress_bar.h:133
Contains xtd::forms::progress_bar_style enum class.
Defines the base class for controls, which are components with visual representation.
Definition: control.h:68
drawing::size default_size() const override
Gets the default size of the control.
Definition: progress_bar.h:39
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
Contains xtd::forms::control control.
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 progress bar.
Definition: progress_bar.h:75
virtual int32_t maximum()
Gets the maximum value of the range of the control.
Definition: progress_bar.h:56