xtd 0.2.0
loading_indicator.cpp

xtd::forms::loading_indicator represents a Windows control to display a loading indicator animation.

Windows

macOS

Gnome

#include <xtd/forms/application>
#include <xtd/forms/loading_indicator>
#include <xtd/forms/form>
#include <xtd/forms/list_box>
#include <xtd/forms/panel>
#include <xtd/drawing/system_colors>
using namespace xtd;
using namespace xtd::forms;
namespace loading_indicator_example {
class form1 : public form {
public:
form1() {
text("Loading indicator example");
start_position(form_start_position::manual);
location({200, 200});
client_size({360, 240});
list_box1.parent(*this);
list_box1.bounds({20, 20, 150, 200});
list_box1.selected_index_changed += [&] {
loading_indicator1.loading_indicator_style(as<forms::loading_indicator_style>(list_box1.selected_item().tag()));
};
list_box1.selected_item("Standard");
panel1.parent(*this);
panel1.border_style(border_style::fixed_3d);
panel1.back_color(drawing::system_colors::window());
panel1.bounds({190, 20, 150, 200});
panel1.click += loading_indicator1.click += [&] {
loading_indicator1.running(!loading_indicator1.running());
};
loading_indicator1.parent(panel1);
loading_indicator1.location({59, 84});
loading_indicator1.running(true);
}
private:
list_box list_box1;
panel panel1;
loading_indicator loading_indicator1;
};
}
auto main() -> int {
application::run(loading_indicator_example::form1 {});
}
static xtd::drawing::color window()
Gets a xtd::drawing::color structure that is the color of the background in the client area of a wind...
static void run()
Begins running a standard application message loop on the current thread, without a form.
Represents a window or dialog box that makes up an application's user interface.
Definition form.hpp:54
Represents a loading indicator control.
Definition loading_indicator.hpp:31
Used to group collections of controls.
Definition panel.hpp:32
type_t as(any_object &o)
Casts a type into another type.
Definition __as_any_object.hpp:59
@ pulse
The control appears with pulse style.
Definition loading_indicator_style.hpp:40
@ three_balls_rotation
The control appears with three balls rotation style.
Definition loading_indicator_style.hpp:52
@ five_lines_pulse
The control appears with five lines pulse style.
Definition loading_indicator_style.hpp:36
@ bar
The control appears with bar style.
Definition loading_indicator_style.hpp:24
@ five_lines
The control appears with five lines style.
Definition loading_indicator_style.hpp:30
@ pulse_outline
The control appears with pulse outline style.
Definition loading_indicator_style.hpp:42
@ five_lines_wave
The control appears with five lines wave style.
Definition loading_indicator_style.hpp:38
@ system
The appearance of the control is determined by the user's operating system.
Definition loading_indicator_style.hpp:46
@ three_balls
The control appears with three balls style.
Definition loading_indicator_style.hpp:48
@ five_lines_chronological
The control appears with five lines chronological style.
Definition loading_indicator_style.hpp:34
@ five_lines_center
The control appears with five lines center style.
Definition loading_indicator_style.hpp:32
@ circle_blinks
The control appears with circle blinks style.
Definition loading_indicator_style.hpp:28
@ three_balls_bouncing
The control appears with three balls bouncing style.
Definition loading_indicator_style.hpp:50
@ circle_bars
The control appears with circle bars style.
Definition loading_indicator_style.hpp:26
@ standard
The control appears with standard style.
Definition loading_indicator_style.hpp:44
@ location
Specifies that both the x and y coordinates of the control are defined.
Definition bounds_specified.hpp:30
@ fixed_3d
A three-dimensional border. Same as xtd::forms::border_style::inset.
Definition border_style.hpp:58
@ bottom
Bind control edges to the bottom of its container.
Definition anchor_styles.hpp:25
@ right
Bind control edges to the right of its container.
Definition anchor_styles.hpp:29
@ left
Bind control edges to the left of its container.
Definition anchor_styles.hpp:27
@ top
Bind control edges to the top of its container.
Definition anchor_styles.hpp:23
@ manual
The position of the form is determined by the Location property.
Definition form_start_position.hpp:24
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition texts.hpp:217
Contains classes that represent ASCII and Unicode character encodings; abstract base classes for conv...
Definition basic_string_builder.hpp:16
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8