xtd 1.0.0
Loading...
Searching...
No Matches
date_time_picker.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "application.hpp"
6#include "control.hpp"
8#include <xtd/chrono>
9#include <xtd/date_time>
10
12namespace xtd {
14 namespace forms {
34 struct data;
35
36 public:
38
43
45
50 [[nodiscard]] virtual auto format() const noexcept -> xtd::forms::date_time_picker_format;
56
59 [[nodiscard]] virtual auto max_date() const noexcept -> xtd::date_time;
64
67 [[nodiscard]] virtual auto min_date() const noexcept -> xtd::date_time;
72
75 [[nodiscard]] virtual auto value() const noexcept -> xtd::date_time;
80
82
86 [[nodiscard]] static auto create() -> date_time_picker;
90 [[nodiscard]] static auto create(const xtd::drawing::point& location) -> date_time_picker;
95 [[nodiscard]] static auto create(const xtd::drawing::point& location, const xtd::drawing::size& size) -> date_time_picker;
101 [[nodiscard]] static auto create(const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> date_time_picker;
105 [[nodiscard]] static auto create(const xtd::date_time& value) -> date_time_picker;
110 [[nodiscard]] static auto create(const xtd::date_time& value, const xtd::drawing::point& location) -> date_time_picker;
116 [[nodiscard]] static auto create(const xtd::date_time& value, const xtd::drawing::point& location, const xtd::drawing::size& size) -> date_time_picker;
123 [[nodiscard]] static auto create(const xtd::date_time& value, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> date_time_picker;
128 [[nodiscard]] static auto create(const xtd::date_time& value, const xtd::date_time& max_date) -> date_time_picker;
134 [[nodiscard]] static auto create(const xtd::date_time& value, const xtd::date_time& max_date, const xtd::drawing::point& location) -> date_time_picker;
141 [[nodiscard]] static auto create(const xtd::date_time& value, const xtd::date_time& max_date, const xtd::drawing::point& location, const xtd::drawing::size& size) -> date_time_picker;
149 [[nodiscard]] static auto create(const xtd::date_time& value, const xtd::date_time& max_date, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> date_time_picker;
155 [[nodiscard]] static auto create(const xtd::date_time& value, const xtd::date_time& min_date, const xtd::date_time& max_date) -> date_time_picker;
162 [[nodiscard]] static auto create(const xtd::date_time& value, const xtd::date_time& min_date, const xtd::date_time& max_date, const xtd::drawing::point& location) -> date_time_picker;
170 [[nodiscard]] static auto create(const xtd::date_time& value, const xtd::date_time& min_date, const xtd::date_time& max_date, const xtd::drawing::point& location, const xtd::drawing::size& size) -> date_time_picker;
179 [[nodiscard]] static auto create(const xtd::date_time& value, const xtd::date_time& min_date, const xtd::date_time& max_date, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> date_time_picker;
189 [[nodiscard]] static auto create(const xtd::forms::control& parent) -> date_time_picker;
196 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::drawing::point& location) -> date_time_picker;
203 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::drawing::point& location, const xtd::drawing::size& size) -> date_time_picker;
210 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> date_time_picker;
215 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::date_time& value) -> date_time_picker;
223 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::date_time& value, const xtd::drawing::point& location) -> date_time_picker;
231 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::date_time& value, const xtd::drawing::point& location, const xtd::drawing::size& size) -> date_time_picker;
239 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::date_time& value, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> date_time_picker;
245 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::date_time& value, const xtd::date_time& max_date) -> date_time_picker;
254 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::date_time& value, const xtd::date_time& max_date, const xtd::drawing::point& location) -> date_time_picker;
263 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::date_time& value, const xtd::date_time& max_date, const xtd::drawing::point& location, const xtd::drawing::size& size) -> date_time_picker;
272 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::date_time& value, const xtd::date_time& max_date, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> date_time_picker;
279 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::date_time& value, const xtd::date_time& min_date, const xtd::date_time& max_date) -> date_time_picker;
289 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::date_time& value, const xtd::date_time& min_date, const xtd::date_time& max_date, const xtd::drawing::point& location) -> date_time_picker;
299 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::date_time& value, const xtd::date_time& min_date, const xtd::date_time& max_date, const xtd::drawing::point& location, const xtd::drawing::size& size) -> date_time_picker;
309 [[nodiscard]] static auto create(const xtd::forms::control& parent, const xtd::date_time& value, const xtd::date_time& min_date, const xtd::date_time& max_date, const xtd::drawing::point& location, const xtd::drawing::size& size, const xtd::string& name) -> date_time_picker;
311
313
325
326 protected:
328
330 [[nodiscard]] auto create_params() const noexcept -> xtd::forms::create_params override;
331 [[nodiscard]] auto default_back_color() const noexcept -> xtd::drawing::color override;
332 [[nodiscard]] auto default_fore_color() const noexcept -> xtd::drawing::color override;
334
336
340 virtual auto on_close_up(const xtd::event_args& e) -> void;
343 virtual auto on_drop_down(const xtd::event_args& e) -> void;
346 virtual auto on_value_changed(const xtd::event_args& e) -> void;
347
348 auto on_handle_created(const xtd::event_args& e) -> void override;
349 auto wnd_proc(xtd::forms::message& message) -> void override;
351
352 private:
353 auto wm_nottify_control(xtd::forms::message& message) -> void;
354 auto wm_nottify_control_closeup(xtd::forms::message& message) -> void;
355 auto wm_nottify_control_dropdown(xtd::forms::message& message) -> void;
356 auto wm_nottify_control_datetimechange(xtd::forms::message& message) -> void;
357
358 xtd::sptr<data> data_;
359 };
360 }
361}
Contains xtd::forms::application class.
Represents an instant in time, typically expressed as a date and time of day.
Definition date_time.hpp:83
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 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...
xtd::event< date_time_picker, xtd::event_handler > drop_down
Occurs when the drop-down calendar is shown.
Definition date_time_picker.hpp:320
virtual auto format() const noexcept -> xtd::forms::date_time_picker_format
Gets the format of the date and time displayed in the control.
auto wnd_proc(xtd::forms::message &message) -> void override
Processes Windows messages.
xtd::event< date_time_picker, xtd::event_handler > close_up
Occurs when the drop-down calendar is dismissed and disappears.
Definition date_time_picker.hpp:317
virtual auto value() const noexcept -> xtd::date_time
Gets the date/time value assigned to the control.
auto on_handle_created(const xtd::event_args &e) -> void override
Raises the xtd::forms::control::handle_created event.
static auto create() -> date_time_picker
A factory to create an xtd::forms::date_time_picker.
xtd::event< date_time_picker, xtd::event_handler > value_changed
Occurs when the value of the value property changes.
Definition date_time_picker.hpp:323
virtual auto on_drop_down(const xtd::event_args &e) -> void
Raises the date_time_picker::drop_down event.
virtual auto max_date() const noexcept -> xtd::date_time
Gets the maximum date and time that can be selected in the control.
date_time_picker()
Initializes a new instance of the date_time_picker class.
virtual auto on_value_changed(const xtd::event_args &e) -> void
Raises the date_time_picker::value_changed event.
auto default_fore_color() const noexcept -> xtd::drawing::color override
Gets the default foreground color of the control.
virtual auto min_date() const noexcept -> xtd::date_time
Gets the minimum date and time that can be selected in the control.
virtual auto on_close_up(const xtd::event_args &e) -> void
Raises the date_time_picker::close_up event.
auto default_back_color() const noexcept -> xtd::drawing::color override
Gets the default background color of the control.
auto create_params() const noexcept -> xtd::forms::create_params override
Gets the required creation parameters when the control handle is created.
Contains xtd::forms::control control.
Contains xtd::forms::date_time_picker_format enum class.
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
date_time_picker_format
Specifies the date and time format the date_time_picker control displays.
Definition date_time_picker_format.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
Implements a Windows message.
Definition message.hpp:33