xtd 0.2.0
color_picker.h
Go to the documentation of this file.
1 #pragma once
5 #include "control.h"
7 
9 namespace xtd {
11  namespace forms {
30  class forms_export_ color_picker : public control {
31  struct data;
32 
33  public:
35 
38  color_picker();
40 
42 
46  virtual bool alpha_color() const noexcept;
49  virtual color_picker& alpha_color(bool alpha_color);
50 
54  virtual const drawing::color& color() const noexcept;
58  virtual color_picker& color(const drawing::color& color);
60 
61 
63 
65  using control::create;
72  static color_picker create(const xtd::drawing::color& color, const drawing::point& location = {-1, -1}, const drawing::size& size = {-1, -1}, const xtd::ustring& name = xtd::ustring::empty_string);
80  static color_picker create(const control& parent, const xtd::drawing::color& color, const drawing::point& location = {-1, -1}, const drawing::size& size = {-1, -1}, const xtd::ustring& name = xtd::ustring::empty_string);
82 
84 
90 
91  protected:
93 
95  forms::create_params create_params() const noexcept override;
97 
99 
103  void on_color_picker_changed(const color_picker_event_args& e);
104 
105  void on_handle_created(const event_args& e) override;
106  void wnd_proc(message& message) override;
108 
109  private:
110  void wm_command_control(message& message);
111  void wm_command_control_selchange(message& message);
112 
113  std::shared_ptr<data> data_;
114  };
115  }
116 }
Contains xtd::forms::color_picker_event_handler event handler.
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
The color box shows alpha values and an opacity selector (slider).
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.
Provides data for the xtd::forms::color_picker::color_picker_changed event.
Definition: color_picker_event_args.h:25
Represents an ARGB (alpha, red, green, blue) color.
Definition: color.h:45
Represents an event.
Definition: event.h:21
Represents a picker control that displays available colors along with controls that enable the user t...
Definition: color_picker.h:30
Implements a Windows message.
Definition: message.h:26
Defines the base class for controls, which are components with visual representation.
Definition: control.h:78
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.
size_t size
Represents a size of any object in bytes.
Definition: types.h:195
event< color_picker, color_picker_event_handler > color_picker_changed
Occurs when the value of the color property changes.
Definition: color_picker.h:88