xtd 0.2.0
color_dialog.h
Go to the documentation of this file.
1 #pragma once
5 #include "../forms_export.h"
6 #include "common_dialog.h"
7 #include <xtd/forms/choose_color_flags>
8 #include <xtd/drawing/color>
9 
11 namespace xtd {
13  namespace forms {
32  class forms_export_ color_dialog : public common_dialog {
33  struct data;
34 
35  public:
37  using colors = std::vector<xtd::drawing::color>;
38 
40 
55  color_dialog();
57 
59 
63  bool alpha_color() const noexcept;
67 
70  bool allow_full_open() const noexcept;
74 
77  bool any_color() const noexcept;
81 
85  drawing::color color() const noexcept;
89  color_dialog& color(const drawing::color& color);
90 
95  const colors& custom_colors() const noexcept;
100  color_dialog& custom_colors(const colors& custom_colors);
101 
106  bool full_open() const noexcept;
112 
116  size_t options() const noexcept;
117 
120  bool show_help() const noexcept;
124 
128  bool solid_color_only() const noexcept;
133 
137  virtual const xtd::ustring& title() const noexcept;
142  virtual color_dialog& title(const xtd::ustring& value);
144 
146 
149  void reset() noexcept override;
151 
152  protected:
154 
159  bool run_dialog(intptr owner) override;
160 
163  void run_sheet(intptr owner) override;
165 
166  private:
167  bool get_option(size_t flag) const noexcept;
168  void set_option(size_t flag, bool value);
169 
170  std::shared_ptr<data> data_;
171  };
172  }
173 }
A Help button appears in the color dialog box.
Represents a common dialog box that displays available colors along with controls that enable the use...
Definition: color_dialog.h:32
intmax_t intptr
Represent a pointer or a handle.
Definition: types.h:151
The controls used to create custom colors are visible when the dialog box is opened.
Contains xtd::forms::common_dialog class.
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).
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:46
The dialog box will restrict users to selecting solid colors only.
The dialog box displays all available colors in the set of basic colors.
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
The user can use the dialog box to define custom colors.
std::vector< xtd::drawing::color > colors
@ brief Represents an xtd::drawing::color array.
Definition: color_dialog.h:37
Specifies the base class used for displaying dialog boxes on the screen.
Definition: common_dialog.h:32