xtd 0.2.0
font_dialog.h
Go to the documentation of this file.
1 #pragma once
5 #include "common_dialog.h"
6 #include <xtd/drawing/color>
7 #include <xtd/drawing/font>
8 #include <xtd/drawing/system_colors>
9 #include <xtd/drawing/system_fonts>
10 #include <xtd/forms/choose_font_flags>
11 
13 namespace xtd {
15  namespace forms {
34  class forms_export_ font_dialog : public common_dialog {
35  struct data;
36 
37  public:
39 
59  font_dialog();
61 
63 
68  bool allow_script_change() const noexcept;
74 
77  bool allow_simulation() const noexcept;
81  font_dialog& allow_simulation(bool allow_simulation);
82 
85  bool allow_vector_fonts() const noexcept;
90 
93  bool allow_vertical_fonts() const noexcept;
98 
101  drawing::color color() const noexcept;
105  font_dialog& color(const drawing::color& color);
106 
109  bool fixed_pitch_only() const noexcept;
114 
117  drawing::font font() const noexcept;
121  font_dialog& font(const drawing::font& font);
122 
125  bool font_must_exist() const noexcept;
129  font_dialog& font_must_exist(bool font_must_exist);
130 
133  size_t max_size() const noexcept;
137  font_dialog& max_size(size_t max_size);
138 
141  size_t min_size() const noexcept;
145  font_dialog& min_size(size_t min_size);
146 
150  size_t options() const noexcept;
151 
154  bool script_only() const noexcept;
158  font_dialog& script_only(bool script_only);
159 
162  bool show_apply() const noexcept;
167 
170  bool show_color() const noexcept;
175 
178  bool show_effect() const noexcept;
182  font_dialog& show_effect(bool show_effect);
183 
186  bool show_help() const noexcept;
192 
194 
198  void reset() noexcept override;
200 
202 
209 
210  protected:
212 
219  virtual void on_apply(const event_args& e);
220 
225  bool run_dialog(intptr owner) override;
226 
229  void run_sheet(intptr owner) override;
231 
232  private:
233  bool get_option(size_t flag) const noexcept;
234  void set_option(size_t flag, bool value);
235 
236  std::shared_ptr<data> data_;
237  };
238  }
239 }
A Help button appears in the color dialog box.
Whether the dialog box allows vector font selections.
Defines a particular format for text, including font face, size, and style attributes. This class cannot be inherited.
Definition: font.h:45
intmax_t intptr
Represent a pointer or a handle.
Definition: types.h:151
Represents the base class for classes that contain event data, and provides a value to use for events...
Definition: event_args.h:18
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
event< font_dialog, event_handler > apply
Occurs when the user clicks the Apply button in the font dialog box.
Definition: font_dialog.h:207
Represents an ARGB (alpha, red, green, blue) color.
Definition: color.h:45
Represents an event.
Definition: event.h:21
Prompts the user to choose a font from among those installed on the local computer.
Definition: font_dialog.h:34
Whether the dialog box contains an Apply button.
Whether the dialog box allows only the selection of fixed-pitch fonts.
Whether the dialog box displays the color choice.
Whether the user can change the character set specified in the Script combo box to display a characte...
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
Whether the dialog box displays both vertical and horizontal fonts or only horizontal fonts...
Specifies the base class used for displaying dialog boxes on the screen.
Definition: common_dialog.h:32