xtd 1.0.0
Loading...
Searching...
No Matches
track_bar.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "control.hpp"
6#include "orientation.hpp"
7#include "tick_style.hpp"
8
10namespace xtd {
12 namespace forms {
35 struct data;
36
37 public:
39
45
47
52 [[nodiscard]] virtual auto large_change() const noexcept -> xtd::int32;
58
61 [[nodiscard]] virtual auto maximum() const noexcept -> xtd::int32;
66 virtual auto maximum(xtd::int32 maximum) -> track_bar&;
67
70 [[nodiscard]] virtual auto minimum() const noexcept -> xtd::int32;
75 virtual auto minimum(xtd::int32 minimum) -> track_bar&;
76
79 [[nodiscard]] virtual auto orientation() const noexcept -> xtd::forms::orientation;
85
90 [[nodiscard]] virtual auto small_change() const noexcept -> xtd::int32;
97
101 [[nodiscard]] virtual auto tick_frequency() const noexcept -> xtd::int32;
107
111 [[nodiscard]] virtual auto tick_style() const noexcept -> xtd::forms::tick_style;
117
121 [[nodiscard]] virtual auto value() const noexcept -> xtd::int32;
126 virtual auto value(xtd::int32 value) -> track_bar&;
128
130
136 auto set_range(xtd::int32 min_value, xtd::int32 max_value) -> void;
137
141 [[nodiscard]] auto to_string() const noexcept -> xtd::string override;
143
145
149 [[nodiscard]] static auto create() -> track_bar;
153 [[nodiscard]] static auto create(const xtd::drawing::point& location) -> track_bar;
158 [[nodiscard]] static auto create(const xtd::drawing::point& location, const xtd::drawing::size& size) -> track_bar;
164 [[nodiscard]] static auto create(const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> track_bar;
168 [[nodiscard]] static auto create(xtd::int32 value) -> track_bar;
173 [[nodiscard]] static auto create(xtd::int32 value, const xtd::drawing::point& location) -> track_bar;
179 [[nodiscard]] static auto create(xtd::int32 value, const xtd::drawing::point& location, const xtd::drawing::size& size) -> track_bar;
186 [[nodiscard]] static auto create(xtd::int32 value, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> track_bar;
191 [[nodiscard]] static auto create(xtd::int32 value, xtd::int32 maximum) -> track_bar;
197 [[nodiscard]] static auto create(xtd::int32 value, xtd::int32 maximum, const xtd::drawing::point& location) -> track_bar;
204 [[nodiscard]] static auto create(xtd::int32 value, xtd::int32 maximum, const xtd::drawing::point& location, const xtd::drawing::size& size) -> track_bar;
212 [[nodiscard]] static auto create(xtd::int32 value, xtd::int32 maximum, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> track_bar;
218 [[nodiscard]] static auto create(xtd::int32 value, xtd::int32 minimum, xtd::int32 maximum) -> track_bar;
225 [[nodiscard]] static auto create(xtd::int32 value, xtd::int32 minimum, xtd::int32 maximum, const xtd::drawing::point& location) -> track_bar;
233 [[nodiscard]] static auto create(xtd::int32 value, xtd::int32 minimum, xtd::int32 maximum, const xtd::drawing::point& location, const xtd::drawing::size& size) -> track_bar;
242 [[nodiscard]] static auto create(xtd::int32 value, xtd::int32 minimum, xtd::int32 maximum, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> track_bar;
246 [[nodiscard]] static auto create(const xtd::forms::control& parent) -> track_bar;
251 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::drawing::point& location) -> track_bar;
257 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::drawing::point& location, const xtd::drawing::size& size) -> track_bar;
264 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> track_bar;
269 [[nodiscard]] static auto create(const xtd::forms::control& parent, xtd::int32 value) -> track_bar;
275 [[nodiscard]] static auto create(const xtd::forms::control& parent, xtd::int32 value, const xtd::drawing::point& location) -> track_bar;
282 [[nodiscard]] static auto create(const xtd::forms::control& parent, xtd::int32 value, const xtd::drawing::point& location, const xtd::drawing::size& size) -> track_bar;
290 [[nodiscard]] static auto create(const xtd::forms::control& parent, xtd::int32 value, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> track_bar;
296 [[nodiscard]] static auto create(const xtd::forms::control& parent, xtd::int32 value, xtd::int32 maximum) -> track_bar;
303 [[nodiscard]] static auto create(const xtd::forms::control& parent, xtd::int32 value, xtd::int32 maximum, const xtd::drawing::point& location) -> track_bar;
311 [[nodiscard]] static auto create(const xtd::forms::control& parent, xtd::int32 value, xtd::int32 maximum, const xtd::drawing::point& location, const xtd::drawing::size& size) -> track_bar;
320 [[nodiscard]] static auto create(const xtd::forms::control& parent, xtd::int32 value, xtd::int32 maximum, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> track_bar;
327 [[nodiscard]] static auto create(const xtd::forms::control& parent, xtd::int32 value, xtd::int32 minimum, xtd::int32 maximum) -> track_bar;
335 [[nodiscard]] static auto create(const xtd::forms::control& parent, xtd::int32 value, xtd::int32 minimum, xtd::int32 maximum, const xtd::drawing::point& location) -> track_bar;
344 [[nodiscard]] static auto create(const xtd::forms::control& parent, xtd::int32 value, xtd::int32 minimum, xtd::int32 maximum, const xtd::drawing::point& location, const xtd::drawing::size& size) -> track_bar;
354 [[nodiscard]] static auto create(const xtd::forms::control& parent, xtd::int32 value, xtd::int32 minimum, xtd::int32 maximum, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> track_bar;
356
358
363
368
369 protected:
371
375 [[nodiscard]] auto create_params() const noexcept -> xtd::forms::create_params override;
376
377 [[nodiscard]] auto default_size() const noexcept -> xtd::drawing::size override;
379
381
385 auto on_handle_created(const xtd::event_args& e) -> void override;
386
394 virtual auto on_scroll(const xtd::event_args& e) -> void;
395
398 virtual auto on_value_changed(const xtd::event_args& e) -> void;
399
406 auto set_bounds_core(xtd::int32 x, xtd::int32 y, xtd::int32 width, xtd::int32 height, xtd::forms::bounds_specified specified) -> void override;
407
411 auto set_client_size_core(xtd::int32 width, xtd::int32 height) -> void override;
412
416 auto wnd_proc(xtd::forms::message& message) -> void override;
418
419 private:
420 auto wm_scroll_control(xtd::forms::message& message) -> void;
421
422 xtd::sptr<data> data_;
423 };
424 }
425}
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:23
Defines the base class for controls, which are components with visual representation.
Definition control.hpp:81
virtual auto size() const noexcept -> xtd::drawing::size
Gets the height and width of the control.
virtual auto width() const noexcept -> xtd::int32
Gets the width of the control.
virtual auto parent() const noexcept -> std::optional< xtd::forms::control_ref >
Gets the parent container of the control.
virtual auto name() const noexcept -> const xtd::string &
Gets the name of the control.
control()
Initializes a new instance of the xtd::forms::control class with default settings.
virtual auto location() const noexcept -> xtd::drawing::point
Gets the coordinates of the upper-left corner of the control relative to the upper-left corner of its...
virtual auto height() const noexcept -> xtd::int32
Gets the height of the control.
virtual auto orientation() const noexcept -> xtd::forms::orientation
Gets a value indicating the horizontal or vertical orientation of the track bar.
static auto create() -> track_bar
A factory to create an xtd::forms::track_bar.
xtd::event< track_bar, xtd::event_handler > scroll
Occurs when either a mouse or keyboard action moves the scroll box.
Definition track_bar.hpp:362
auto wnd_proc(xtd::forms::message &message) -> void override
Processes Windows messages.
xtd::event< track_bar, xtd::event_handler > value_changed
Occurs when the value property of a track bar changes, either by movement of the scroll box or by man...
Definition track_bar.hpp:366
auto to_string() const noexcept -> xtd::string override
Returns a string that represents the track_bar control.
virtual auto tick_style() const noexcept -> xtd::forms::tick_style
Gets a value indicating how to display the tick marks on the track bar.
virtual auto large_change() const noexcept -> xtd::int32
Gets a value to be added to or subtracted from the value property when the scroll box is moved a larg...
virtual auto on_scroll(const xtd::event_args &e) -> void
Raises the track_bar::scroll event.
virtual auto minimum() const noexcept -> xtd::int32
Gets the lower limit of the range this track_bar is working with.
auto on_handle_created(const xtd::event_args &e) -> void override
Overrides control::on_handle_created(const event_args&).
auto set_range(xtd::int32 min_value, xtd::int32 max_value) -> void
Sets the minimum and maximum values for a xtd::forms::track_bar.
virtual auto maximum() const noexcept -> xtd::int32
Gets the upper limit of the range this track_bar is working with.
auto create_params() const noexcept -> xtd::forms::create_params override
Gets the required creation parameters when the control handle is created.
virtual auto value() const noexcept -> xtd::int32
Gets a numeric value that represents the current position of the scroll box on the track bar.
virtual auto tick_frequency() const noexcept -> xtd::int32
Gets a value that specifies the delta between ticks drawn on the control.
virtual auto small_change() const noexcept -> xtd::int32
Gets he value added to or subtracted from the Value property when the scroll box is moved a small dis...
auto default_size() const noexcept -> xtd::drawing::size override
Gets the default size of the control.
auto set_client_size_core(xtd::int32 width, xtd::int32 height) -> void override
Sets the size of the client area of the control.
track_bar()
Initializes a new instance of the track_bar class.
auto set_bounds_core(xtd::int32 x, xtd::int32 y, xtd::int32 width, xtd::int32 height, xtd::forms::bounds_specified specified) -> void override
Performs the work of setting the specified bounds of this control.
virtual auto on_value_changed(const xtd::event_args &e) -> void
Raises the track_bar::value_changed event.
Contains xtd::forms::control control.
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
std::int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:25
bounds_specified
Specifies the bounds of the control to use when defining a control's size and position....
Definition bounds_specified.hpp:22
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 auto data() const noexcept -> const_pointer
Gets direct access to the underlying contiguous storage.
Definition read_only_span.hpp:197
Contains xtd::forms::orientation enum class.
Implements a Windows message.
Definition message.hpp:33
Contains xtd::forms::tick_style enum class.