xtd - Reference Guide  0.1.1
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
loading_indicator.h
Go to the documentation of this file.
1 #pragma once
5 #include "control.h"
6 #include "border_style.h"
7 #include "content_alignment.h"
9 
11 namespace xtd {
13  namespace forms {
27  public:
30 
31  xtd::drawing::size default_size() const override {return {32, 32};}
32 
36  virtual xtd::forms::loading_indicator_style loading_indicator_style() const {return loading_indicator_style_;}
42 
45  bool is_running() const {return is_running_;}
46 
48  void start();
50  void stop();
51 
52  protected:
53  xtd::forms::create_params create_params() const override;
54 
56 
57  void on_handle_created(const event_args& e) override;
58 
60 
61  private:
62  void on_timer_tick(object& timer, const xtd::event_args& e);
63 
64  bool is_running_ = false;
66  xtd::forms::timer timer_;
67  int32_t intervals_ = 8;
68  int32_t radius_factor_ = 10;
69  int32_t frame_ = 0;
70  int32_t interval_ = 150;
71  };
72  }
73 }
Contains xtd::forms::border_style enum class.
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
Defines the base class for controls, which are components with visual representation.
Definition: control.h:67
Represents a loading indicator control.
Definition: loading_indicator.h:26
loading_indicator()
Initialize a new instance of loading_indicator class.
bool is_running() const
Returns if the loading indicator animation is started.
Definition: loading_indicator.h:45
virtual xtd::forms::loading_indicator & loading_indicator_style(xtd::forms::loading_indicator_style loading_indicator_style)
Sets the flat style appearance of the loading_indicator control.
xtd::forms::create_params create_params() const override
Gets the required creation parameters when the control handle is created.
void stop()
Stops animation of the loading indicator.
virtual xtd::forms::loading_indicator_style loading_indicator_style() const
Gets the flat style appearance of the loading_indicator control.
Definition: loading_indicator.h:36
xtd::drawing::size default_size() const override
Gets the default size of the control.
Definition: loading_indicator.h:31
void on_handle_created(const event_args &e) override
Raises the control::handle_created event.
void start()
Starts animation of the loading indicator.
void on_paint(xtd::forms::paint_event_args &e) override
Raises the control::paint event.
xtd::drawing::size measure_control() const override
Measure this control.
Provides data for the paint event.
Definition: paint_event_args.h:26
Implements a timer that raises an event at user-defined intervals. This timer is optimized for use in...
Definition: timer.h:29
Contains xtd::forms::content_alignment enum class.
Contains xtd::forms::control control.
#define forms_export_
Define shared library export.
Definition: forms_export.h:13
loading_indicator_style
Specifies the appearance of a loading indicator control.
Definition: loading_indicator_style.h:18
@ standard
The control appears with standard style.
Contains xtd::forms::loading_indicator_style enum class.
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