Prompts the user to choose a font from among those installed on the local computer.
| Windows | macOS | Gnome | |
|---|---|---|---|
| Light |
html dialog_font_dialog_m.png html dialog_font_dialog_g.png | ||
| Dark |
html dialog_font_dialog_md.png html dialog_font_dialog_gd.png |
Constructors | |
| font_dialog () | |
| Initializes a new instance of the font_dialog class. More... | |
Properties | |
| bool | allow_script_change () const noexcept |
| Gets a value indicating whether the user can change the character set specified in the Script combo box to display a character set other than the one currently displayed. More... | |
| font_dialog & | allow_script_change (bool allow_script_change) |
| Sets a value indicating whether the user can change the character set specified in the Script combo box to display a character set other than the one currently displayed. More... | |
| bool | allow_simulation () const noexcept |
| Gets a value indicating whether the dialog box allows graphics device interface (GDI) font simulations. More... | |
| font_dialog & | allow_simulation (bool allow_simulation) |
| Sets a value indicating whether the dialog box allows graphics device interface (GDI) font simulations. More... | |
| bool | allow_vector_fonts () const noexcept |
| Gets a value indicating whether the dialog box allows vector font selections. More... | |
| font_dialog & | allow_vector_fonts (bool allow_vector_fonts) |
| Sets a value indicating whether the dialog box allows vector font selections. More... | |
| bool | allow_vertical_fonts () const noexcept |
| Gets a value indicating whether the dialog box displays both vertical and horizontal fonts or only horizontal fonts. More... | |
| font_dialog & | allow_vertical_fonts (bool allow_vertical_fonts) |
| Sets a value indicating whether the dialog box displays both vertical and horizontal fonts or only horizontal fonts. More... | |
| drawing::color | color () const noexcept |
| Gets the selected font color. More... | |
| font_dialog & | color (const drawing::color &color) |
| Sets the selected font color. More... | |
| bool | fixed_pitch_only () const noexcept |
| Gets a value indicating whether the dialog box allows only the selection of fixed-pitch fonts. More... | |
| font_dialog & | fixed_pitch_only (bool fixed_pitch_only) |
| Sets a value indicating whether the dialog box allows only the selection of fixed-pitch fonts. More... | |
| drawing::font | font () const noexcept |
| Gets the selected font. More... | |
| font_dialog & | font (const drawing::font &font) |
| Sets the selected font. More... | |
| bool | font_must_exist () const noexcept |
| Gets a value indicating whether the dialog box specifies an error condition if the user attempts to select a font or style that does not exist. More... | |
| font_dialog & | font_must_exist (bool font_must_exist) |
| Sets a value indicating whether the dialog box specifies an error condition if the user attempts to select a font or style that does not exist. More... | |
| size_t | max_size () const noexcept |
| Gets the maximum point size a user can select. More... | |
| font_dialog & | max_size (size_t max_size) |
| Sets the maximum point size a user can select. More... | |
| size_t | min_size () const noexcept |
| Gets the minimum point size a user can select. More... | |
| font_dialog & | min_size (size_t min_size) |
| Sets the minimum point size a user can select. More... | |
| size_t | options () const noexcept |
| Gets values to initialize the font_dialog. More... | |
| bool | script_only () const noexcept |
| Gets a value indicating whether the dialog box allows selection of fonts for all non-OEM and Symbol character sets, as well as the ANSI character set. More... | |
| font_dialog & | script_only (bool script_only) |
| Sets a value indicating whether the dialog box allows selection of fonts for all non-OEM and Symbol character sets, as well as the ANSI character set. More... | |
| bool | show_apply () const noexcept |
| Gets a value indicating whether the dialog box contains an Apply button. More... | |
| font_dialog & | show_apply (bool show_apply) |
| Sets a value indicating whether the dialog box contains an Apply button. More... | |
| bool | show_color () const noexcept |
| Gets a value indicating whether the dialog box displays the color choice. More... | |
| font_dialog & | show_color (bool show_color) |
| Sets a value indicating whether the dialog box displays the color choice. More... | |
| bool | show_effect () const noexcept |
| Gets a value indicating whether the dialog box contains controls that allow the user to specify strikethrough, underline, and text color options. More... | |
| font_dialog & | show_effect (bool show_effect) |
| Sets a value indicating whether the dialog box contains controls that allow the user to specify strikethrough, underline, and text color options. More... | |
| bool | show_help () const noexcept |
| Gets a value indicating whether the dialog box displays a Help button. More... | |
| font_dialog & | show_help (bool show_help) |
| Sets a value indicating whether the dialog box displays a Help button. More... | |
Methods | |
| void | reset () noexcept override |
| Resets all dialog box options to their default values. More... | |
Events | |
| event< font_dialog, event_handler > | apply |
| Occurs when the user clicks the Apply button in the font dialog box. More... | |
Protected methods | |
| virtual void | on_apply (const event_args &e) |
| Raises the font_dialog::apply event. More... | |
| bool | run_dialog (intptr owner) override |
| void | run_sheet (intptr owner) override |
| When overridden in a derived class, specifies a common dialog box. More... | |
Additional Inherited Members | |
Public Attributes inherited from xtd::forms::common_dialog | |
| event< common_dialog, help_event_handler > | help_request |
| Occurs when the user clicks the Help button on a common dialog box. More... | |
| event< common_dialog, dialog_closed_event_handler > | dialog_closed |
| Occurs when the user close a common dialog box with dialog close button or other dialog buttons. More... | |
Public Member Functions inherited from xtd::forms::common_dialog | |
| common_dialog () | |
| Initializes a new instance of the common_dialog class. More... | |
| xtd::forms::dialog_result | dialog_result () const noexcept |
| Gets async dialog_result result after dialog box is closing. More... | |
| std::any | tag () const noexcept |
| Gets an object that contains data about the control. More... | |
| common_dialog & | tag (const std::any &tag) |
| Sets an object that contains data about the control. More... | |
| xtd::forms::dialog_result | show_dialog () |
| Runs a common dialog box with a default owner. More... | |
| xtd::forms::dialog_result | show_dialog (const iwin32_window &owner) |
| Runs a common dialog box with the specified owner. More... | |
| void | show_sheet (const iwin32_window &owner) |
| Runs a common dialog box with the specified owner. More... | |
| xtd::forms::dialog_result | show_sheet_dialog (const iwin32_window &owner) |
| Runs a common dialog box with the specified owner. More... | |
Public Member Functions inherited from xtd::object | |
| object ()=default | |
| Create a new instance of the ultimate base class object. More... | |
| bool | equals (const object &obj) const noexcept |
| Determines whether the specified object is equal to the current object. More... | |
| virtual size_t | get_hash_code () const noexcept |
| Serves as a hash function for a particular type. More... | |
| virtual type_object | get_type () const noexcept |
| Gets the type of the current instance. More... | |
| template<typename object_t > | |
| std::unique_ptr< object_t > | memberwise_clone () const noexcept |
| Creates a shallow copy of the current object. More... | |
| virtual xtd::ustring | to_string () const noexcept |
| Returns a sxd::ustring that represents the current object. More... | |
Static Public Member Functions inherited from xtd::object | |
| static bool | equals (const object &object_a, const object &object_b) noexcept |
| Determines whether the specified object instances are considered equal. More... | |
| static bool | reference_equals (const object &object_a, const object &object_b) noexcept |
| Determines whether the specified object instances are the same instance. More... | |
Protected Member Functions inherited from xtd::forms::common_dialog | |
| virtual void | on_dialog_closed (const dialog_closed_event_args &e) |
| Raises the common_dialog::dialog_close event. More... | |
| virtual void | on_help_request (help_event_args &e) |
| Raises the common_dialog::help_request event. More... | |
| void | set_dialog_result (xtd::forms::dialog_result value) |
| Sets async dialog_result result after dialog box is closing. More... | |
Protected Member Functions inherited from xtd::forms::component | |
| component () | |
| Initialises a new instance of the component class. More... | |
| virtual bool | can_raise_events () const noexcept |
| Gets a value indicating whether the component can raise an event. More... | |
| bool | design_mode () const noexcept |
| Gets a value that indicates whether the component is currently in design mode. More... | |
| xtd::forms::font_dialog::font_dialog | ( | ) |
Initializes a new instance of the font_dialog class.
| Property | Initial value |
|---|---|
| allow_simulations | true |
| allow_vector_fonts | true |
| allow_vertical_fonts | true |
| allow_script_change | true |
| color | color::black |
| fixed_pitch_only | false |
| max_size | 0 |
| min_size | 0 |
| scripts_only | false |
| show_apply | false |
| show_color | false |
| show_effects | true |
| show_help | false |
|
noexcept |
Gets a value indicating whether the user can change the character set specified in the Script combo box to display a character set other than the one currently displayed.
| font_dialog& xtd::forms::font_dialog::allow_script_change | ( | bool | allow_script_change | ) |
Sets a value indicating whether the user can change the character set specified in the Script combo box to display a character set other than the one currently displayed.
| allow_script_change | true if the user can change the character set specified in the Script combo box; otherwise, false. The default value is true. |
|
noexcept |
Gets a value indicating whether the dialog box allows graphics device interface (GDI) font simulations.
| font_dialog& xtd::forms::font_dialog::allow_simulation | ( | bool | allow_simulation | ) |
Sets a value indicating whether the dialog box allows graphics device interface (GDI) font simulations.
| allow_simulation | true if font simulations are allowed; otherwise, false. The default value is true. |
|
noexcept |
Gets a value indicating whether the dialog box allows vector font selections.
| font_dialog& xtd::forms::font_dialog::allow_vector_fonts | ( | bool | allow_vector_fonts | ) |
Sets a value indicating whether the dialog box allows vector font selections.
| allow_vector_fonts | true if vector fonts are allowed; otherwise, false. The default value is true. |
|
noexcept |
Gets a value indicating whether the dialog box displays both vertical and horizontal fonts or only horizontal fonts.
| font_dialog& xtd::forms::font_dialog::allow_vertical_fonts | ( | bool | allow_vertical_fonts | ) |
Sets a value indicating whether the dialog box displays both vertical and horizontal fonts or only horizontal fonts.
| allow_vertical_fonts | true if both vertical and horizontal fonts are allowed; otherwise, false. The default value is true. |
|
noexcept |
Gets the selected font color.
| font_dialog& xtd::forms::font_dialog::color | ( | const drawing::color & | color | ) |
Sets the selected font color.
| color | The color of the selected font. The default value is Black. |
|
noexcept |
Gets a value indicating whether the dialog box allows only the selection of fixed-pitch fonts.
| font_dialog& xtd::forms::font_dialog::fixed_pitch_only | ( | bool | fixed_pitch_only | ) |
Sets a value indicating whether the dialog box allows only the selection of fixed-pitch fonts.
| fixed_pitch_only | true if only fixed-pitch fonts can be selected; otherwise, false. The default value is false. |
|
noexcept |
| font_dialog& xtd::forms::font_dialog::font | ( | const drawing::font & | font | ) |
|
noexcept |
Gets a value indicating whether the dialog box specifies an error condition if the user attempts to select a font or style that does not exist.
| font_dialog& xtd::forms::font_dialog::font_must_exist | ( | bool | font_must_exist | ) |
Sets a value indicating whether the dialog box specifies an error condition if the user attempts to select a font or style that does not exist.
| font_must_exist | true if the dialog box specifies an error condition when the user tries to select a font or style that does not exist; otherwise, false. The default is false. |
|
noexcept |
Gets the maximum point size a user can select.
| font_dialog& xtd::forms::font_dialog::max_size | ( | size_t | max_size | ) |
Sets the maximum point size a user can select.
| max_size | The maximum point size a user can select. The default is 0. |
|
noexcept |
Gets the minimum point size a user can select.
| font_dialog& xtd::forms::font_dialog::min_size | ( | size_t | min_size | ) |
Sets the minimum point size a user can select.
| min_size | The minimum point size a user can select. The default is 0. |
|
protectedvirtual |
Raises the font_dialog::apply event.
| e | An event_args that contains the data. |
|
noexcept |
Gets values to initialize the font_dialog.
|
overridevirtualnoexcept |
Resets all dialog box options to their default values.
Implements xtd::forms::common_dialog.
|
overrideprotectedvirtual |
| owner | The window handle of the owner window for the common dialog box. |
Implements xtd::forms::common_dialog.
|
overrideprotectedvirtual |
When overridden in a derived class, specifies a common dialog box.
| owner | A value that represents the window handle of the owner window for the common dialog box. |
Implements xtd::forms::common_dialog.
|
noexcept |
Gets a value indicating whether the dialog box allows selection of fonts for all non-OEM and Symbol character sets, as well as the ANSI character set.
| font_dialog& xtd::forms::font_dialog::script_only | ( | bool | script_only | ) |
Sets a value indicating whether the dialog box allows selection of fonts for all non-OEM and Symbol character sets, as well as the ANSI character set.
| script_script | = true if selection of fonts for all non-OEM and Symbol character sets, as well as the ANSI character set, is allowed; otherwise, false. The default value is false. |
|
noexcept |
Gets a value indicating whether the dialog box contains an Apply button.
| font_dialog& xtd::forms::font_dialog::show_apply | ( | bool | show_apply | ) |
Sets a value indicating whether the dialog box contains an Apply button.
| show_apply | true if the dialog box contains an Apply button; otherwise, false. The default value is false. |
|
noexcept |
Gets a value indicating whether the dialog box displays the color choice.
| font_dialog& xtd::forms::font_dialog::show_color | ( | bool | show_color | ) |
Sets a value indicating whether the dialog box displays the color choice.
| show_color | true if the dialog box displays the color choice; otherwise, false. The default value is false. |
|
noexcept |
Gets a value indicating whether the dialog box contains controls that allow the user to specify strikethrough, underline, and text color options.
| font_dialog& xtd::forms::font_dialog::show_effect | ( | bool | show_effect | ) |
Sets a value indicating whether the dialog box contains controls that allow the user to specify strikethrough, underline, and text color options.
| show_effect | true if the dialog box contains controls to set strikethrough, underline, and text color options; otherwise, false. The default value is true. |
|
noexcept |
Gets a value indicating whether the dialog box displays a Help button.
| font_dialog& xtd::forms::font_dialog::show_help | ( | bool | show_help | ) |
Sets a value indicating whether the dialog box displays a Help button.
| show_help | true if the dialog box displays a Help button; otherwise, false. The default value is false. |
| event<font_dialog, event_handler> xtd::forms::font_dialog::apply |
Occurs when the user clicks the Apply button in the font dialog box.