xtd 0.2.0
date_time_picker.h
Go to the documentation of this file.
1 #pragma once
5 #include "application.h"
6 #include "control.h"
8 #include <xtd/chrono>
9 #include <xtd/date_time>
10 
12 namespace xtd {
14  namespace forms {
31  class forms_export_ date_time_picker : public control {
32  struct data;
33 
34  public:
36 
41 
43 
48  virtual date_time_picker_format format() const noexcept;
53  virtual date_time_picker& format(date_time_picker_format format);
54 
57  virtual date_time max_date() const noexcept;
61  virtual date_time_picker& max_date(date_time value);
62 
65  virtual date_time min_date() const noexcept;
69  virtual date_time_picker& min_date(date_time value);
70 
73  virtual date_time value() const noexcept;
76  virtual date_time_picker& value(date_time value);
78 
80 
82  using control::create;
91  static date_time_picker create(const xtd::date_time& value, const xtd::date_time& min_date = xtd::date_time::min_value, const xtd::date_time& max_date = xtd::date_time::max_value, const drawing::point& location = {-1, -1}, const drawing::size& size = {-1, -1}, const xtd::ustring& name = xtd::ustring::empty_string);
101  static date_time_picker create(const control& parent, const xtd::date_time& value, const xtd::date_time& min_date = xtd::date_time::min_value, const xtd::date_time& max_date = xtd::date_time::max_value, const drawing::point& location = {-1, -1}, const drawing::size& size = {-1, -1}, const xtd::ustring& name = xtd::ustring::empty_string);
103 
105 
117 
118  protected:
120 
122  forms::create_params create_params() const noexcept override;
123  drawing::color default_back_color() const noexcept override;
124  drawing::color default_fore_color() const noexcept override;
126 
128 
132  virtual void on_close_up(const event_args& e);
135  virtual void on_drop_down(const event_args& e);
138  virtual void on_value_changed(const event_args& e);
139 
140  void on_handle_created(const event_args& e) override;
141  void wnd_proc(message& message) override;
143 
144  private:
145  void wm_nottify_control(message& message);
146  void wm_nottify_control_closeup(message& message);
147  void wm_nottify_control_dropdown(message& message);
148  void wm_nottify_control_datetimechange(message& message);
149 
150  std::shared_ptr<data> data_;
151  };
152  }
153 }
Represents a picker control that displays available date time along with controls.
Definition: date_time_picker.h:31
Contains xtd::forms::application class.
Represents the base class for classes that contain event data, and provides a value to use for events...
Definition: event_args.h:18
Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional ...
Definition: point.h:54
Stores an ordered pair of integers, which specify a height and width.
Definition: size.h:31
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
Encapsulates the information needed when creating a control.
Definition: create_params.h:27
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:46
static control create(const drawing::point &location={-1, -1}, const drawing::size &size={-1, -1}, const xtd::ustring &name=xtd::ustring::empty_string)
A factory to create a specified control with specified location, size, and name.
date_time_picker_format
Specifies the date and time format the date_time_picker control displays.
Definition: date_time_picker_format.h:20
event< date_time_picker, event_handler > drop_down
Occurs when the drop-down calendar is shown.
Definition: date_time_picker.h:112
Represents an event.
Definition: event.h:21
Represents an instant in time, typically expressed as a date and time of day.
Definition: date_time.h:78
static const date_time min_value
Represents the smallest possible value of xtd::date_time. This field is read-only.
Definition: date_time.h:100
Implements a Windows message.
Definition: message.h:26
Contains xtd::forms::date_time_picker_format enum class.
Defines the base class for controls, which are components with visual representation.
Definition: control.h:78
event< date_time_picker, event_handler > value_changed
Occurs when the value of the value property changes.
Definition: date_time_picker.h:115
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
static const ustring empty_string
Represents the empty string.
Definition: ustring.h:53
Specifies that both the x and y coordinates of the control are defined.
event< date_time_picker, event_handler > close_up
Occurs when the drop-down calendar is dismissed and disappears.
Definition: date_time_picker.h:109
size_t size
Represents a size of any object in bytes.
Definition: types.h:195
static const date_time max_value
Represents the largest possible value of xtd::date_time. This field is read-only. ...
Definition: date_time.h:90