Prompts the user to choose a font from among those installed on the local computer.
| Windows | macOS | Gnome | |
|---|---|---|---|
| Light |
|
|
|
| Dark |
|
|
|
Public Events | |
| xtd::event< font_dialog, xtd::event_handler > | apply |
| Occurs when the user clicks the Apply button in the font dialog box. | |
Public Constructors | |
| font_dialog () | |
| Initializes a new instance of the font_dialog class. | |
Public Properties | |
| auto | allow_script_change () const noexcept -> bool |
| 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. | |
| auto | allow_script_change (bool value) -> font_dialog & |
| 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. | |
| auto | allow_simulation () const noexcept -> bool |
| Gets a value indicating whether the dialog box allows graphics device interface (GDI) font simulations. | |
| auto | allow_simulation (bool value) -> font_dialog & |
| Sets a value indicating whether the dialog box allows graphics device interface (GDI) font simulations. | |
| auto | allow_vector_fonts () const noexcept -> bool |
| Gets a value indicating whether the dialog box allows vector font selections. | |
| auto | allow_vector_fonts (bool value) -> font_dialog & |
| Sets a value indicating whether the dialog box allows vector font selections. | |
| auto | allow_vertical_fonts () const noexcept -> bool |
| Gets a value indicating whether the dialog box displays both vertical and horizontal fonts or only horizontal fonts. | |
| auto | allow_vertical_fonts (bool value) -> font_dialog & |
| Sets a value indicating whether the dialog box displays both vertical and horizontal fonts or only horizontal fonts. | |
| auto | color () const noexcept -> xtd::drawing::color |
| Gets the selected font color. | |
| auto | color (const xtd::drawing::color &value) -> font_dialog & |
| Sets the selected font color. | |
| auto | fixed_pitch_only () const noexcept -> bool |
| Gets a value indicating whether the dialog box allows only the selection of fixed-pitch fonts. | |
| auto | fixed_pitch_only (bool value) -> font_dialog & |
| Sets a value indicating whether the dialog box allows only the selection of fixed-pitch fonts. | |
| auto | font () const noexcept -> xtd::drawing::font |
| Gets the selected font. | |
| auto | font (const xtd::drawing::font &value) -> font_dialog & |
| Sets the selected font. | |
| auto | font_must_exist () const noexcept -> bool |
| 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. | |
| auto | font_must_exist (bool value) -> font_dialog & |
| 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. | |
| auto | max_size () const noexcept -> xtd::usize |
| Gets the maximum point size a user can select. | |
| auto | max_size (xtd::usize value) -> font_dialog & |
| Sets the maximum point size a user can select. | |
| auto | min_size () const noexcept -> xtd::usize |
| Gets the minimum point size a user can select. | |
| auto | min_size (xtd::usize value) -> font_dialog & |
| Sets the minimum point size a user can select. | |
| auto | options () const noexcept -> xtd::usize |
| Gets values to initialize the font_dialog. | |
| auto | script_only () const noexcept -> bool |
| 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. | |
| auto | script_only (bool value) -> font_dialog & |
| 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. | |
| auto | show_apply () const noexcept -> bool |
| Gets a value indicating whether the dialog box contains an Apply button. | |
| auto | show_apply (bool value) -> font_dialog & |
| Sets a value indicating whether the dialog box contains an Apply button. | |
| auto | show_color () const noexcept -> bool |
| Gets a value indicating whether the dialog box displays the color choice. | |
| auto | show_color (bool value) -> font_dialog & |
| Sets a value indicating whether the dialog box displays the color choice. | |
| auto | show_effect () const noexcept -> bool |
| Gets a value indicating whether the dialog box contains controls that allow the user to specify strikethrough, underline, and text color options. | |
| auto | show_effect (bool value) -> font_dialog & |
| Sets a value indicating whether the dialog box contains controls that allow the user to specify strikethrough, underline, and text color options. | |
| auto | show_help () const noexcept -> bool |
| Gets a value indicating whether the dialog box displays a Help button. | |
| auto | show_help (bool value) -> font_dialog & |
| Sets a value indicating whether the dialog box displays a Help button. | |
Public Methods | |
| auto | reset () noexcept -> void override |
| Resets all dialog box options to their default values. | |
Protected Methods | |
| virtual auto | on_apply (const xtd::event_args &e) -> void |
| Raises the font_dialog::apply event. | |
| auto | run_dialog (xtd::intptr owner) -> bool override |
| auto | run_sheet (xtd::intptr owner) -> void override |
| When overridden in a derived class, specifies a common dialog box. | |
Additional Inherited Members | |
| xtd::event< common_dialog, xtd::forms::help_event_handler > | help_request |
| Occurs when the user clicks the Help button on a common dialog box. | |
| xtd::event< common_dialog, xtd::forms::dialog_closed_event_handler > | dialog_closed |
| Occurs when the user close a common dialog box with dialog close button or other dialog buttons. | |
| common_dialog () | |
| Initializes a new instance of the common_dialog class. | |
| auto | dialog_result () const noexcept -> xtd::forms::dialog_result |
| Gets async dialog_result result after dialog box is closing. | |
| auto | tag () const noexcept -> const xtd::any_object & |
| Gets an object that contains data about the control. | |
| auto | tag (const xtd::any_object &value) -> common_dialog & |
| Sets an object that contains data about the control. | |
| auto | show_dialog () -> xtd::forms::dialog_result |
| Runs a common dialog box with a default owner. | |
| auto | show_dialog (const iwin32_window &owner) -> xtd::forms::dialog_result |
| Runs a common dialog box with the specified owner. | |
| auto | show_sheet (const iwin32_window &owner) -> void |
| Runs a common dialog box with the specified owner. | |
| auto | show_sheet_dialog (const iwin32_window &owner) -> xtd::forms::dialog_result |
| Runs a common dialog box with the specified owner. | |
| object ()=default | |
| Create a new instance of the ultimate base class object. | |
| virtual auto | equals (const object &obj) const noexcept -> bool |
| Determines whether the specified object is equal to the current object. | |
| virtual auto | get_hash_code () const noexcept -> xtd::usize |
| Serves as a hash function for a particular type. | |
| virtual auto | get_type () const noexcept -> type_object |
| Gets the type of the current instance. | |
| template<typename object_t> | |
| auto | memberwise_clone () const -> xtd::unique_ptr_object< object_t > |
| Creates a shallow copy of the current object. | |
| virtual auto | to_string () const -> xtd::string |
| Returns a xtd::string that represents the current object. | |
| template<typename object_a_t, typename object_b_t> | |
| static auto | equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool |
| Determines whether the specified object instances are considered equal. | |
| template<typename object_a_t, typename object_b_t> | |
| static auto | reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool |
| Determines whether the specified object instances are the same instance. | |
| virtual auto | on_dialog_closed (const xtd::forms::dialog_closed_event_args &e) -> void |
| Raises the common_dialog::dialog_close event. | |
| virtual auto | on_help_request (xtd::forms::help_event_args &e) -> void |
| Raises the common_dialog::help_request event. | |
| auto | set_dialog_result (xtd::forms::dialog_result value) -> void |
| Sets async dialog_result result after dialog box is closing. | |
| component () | |
| Initialises a new instance of the component class. | |
| virtual auto | can_raise_events () const noexcept -> bool |
| Gets a value indicating whether the component can raise an event. | |
| auto | design_mode () const noexcept -> bool |
| Gets a value that indicates whether the component is currently in design mode. | |
| 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 |
|
nodiscardnoexcept |
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.
| auto xtd::forms::font_dialog::allow_script_change | ( | bool | value | ) | -> font_dialog & |
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.
| value | true if the user can change the character set specified in the Script combo box; otherwise, false. The default value is true. |
|
nodiscardnoexcept |
Gets a value indicating whether the dialog box allows graphics device interface (GDI) font simulations.
| auto xtd::forms::font_dialog::allow_simulation | ( | bool | value | ) | -> font_dialog & |
Sets a value indicating whether the dialog box allows graphics device interface (GDI) font simulations.
| value | true if font simulations are allowed; otherwise, false. The default value is true. |
|
nodiscardnoexcept |
Gets a value indicating whether the dialog box allows vector font selections.
| auto xtd::forms::font_dialog::allow_vector_fonts | ( | bool | value | ) | -> font_dialog & |
Sets a value indicating whether the dialog box allows vector font selections.
| value | true if vector fonts are allowed; otherwise, false. The default value is true. |
|
nodiscardnoexcept |
Gets a value indicating whether the dialog box displays both vertical and horizontal fonts or only horizontal fonts.
| auto xtd::forms::font_dialog::allow_vertical_fonts | ( | bool | value | ) | -> font_dialog & |
Sets a value indicating whether the dialog box displays both vertical and horizontal fonts or only horizontal fonts.
| value | true if both vertical and horizontal fonts are allowed; otherwise, false. The default value is true. |
|
nodiscardnoexcept |
Gets the selected font color.
| auto xtd::forms::font_dialog::color | ( | const xtd::drawing::color & | value | ) | -> font_dialog & |
Sets the selected font color.
| value | The color of the selected font. The default value is Black. |
|
nodiscardnoexcept |
Gets a value indicating whether the dialog box allows only the selection of fixed-pitch fonts.
| auto xtd::forms::font_dialog::fixed_pitch_only | ( | bool | value | ) | -> font_dialog & |
Sets a value indicating whether the dialog box allows only the selection of fixed-pitch fonts.
| value | true if only fixed-pitch fonts can be selected; otherwise, false. The default value is false. |
|
nodiscardnoexcept |
Gets the selected font.
| auto xtd::forms::font_dialog::font | ( | const xtd::drawing::font & | value | ) | -> font_dialog & |
|
nodiscardnoexcept |
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.
| auto xtd::forms::font_dialog::font_must_exist | ( | bool | value | ) | -> font_dialog & |
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.
| value | 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. |
|
nodiscardnoexcept |
Gets the maximum point size a user can select.
| auto xtd::forms::font_dialog::max_size | ( | xtd::usize | value | ) | -> font_dialog & |
Sets the maximum point size a user can select.
| value | The maximum point size a user can select. The default is 0. |
|
nodiscardnoexcept |
Gets the minimum point size a user can select.
| auto xtd::forms::font_dialog::min_size | ( | xtd::usize | value | ) | -> font_dialog & |
Sets the minimum point size a user can select.
| value | The minimum point size a user can select. The default is 0. |
|
nodiscardnoexcept |
Gets values to initialize the font_dialog.
|
nodiscardnoexcept |
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.
| auto xtd::forms::font_dialog::script_only | ( | bool | value | ) | -> font_dialog & |
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.
| value | = 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. |
|
nodiscardnoexcept |
Gets a value indicating whether the dialog box contains an Apply button.
| auto xtd::forms::font_dialog::show_apply | ( | bool | value | ) | -> font_dialog & |
Sets a value indicating whether the dialog box contains an Apply button.
| value | true if the dialog box contains an Apply button; otherwise, false. The default value is false. |
|
nodiscardnoexcept |
Gets a value indicating whether the dialog box displays the color choice.
| auto xtd::forms::font_dialog::show_color | ( | bool | value | ) | -> font_dialog & |
Sets a value indicating whether the dialog box displays the color choice.
| value | true if the dialog box displays the color choice; otherwise, false. The default value is false. |
|
nodiscardnoexcept |
Gets a value indicating whether the dialog box contains controls that allow the user to specify strikethrough, underline, and text color options.
| auto xtd::forms::font_dialog::show_effect | ( | bool | value | ) | -> font_dialog & |
Sets a value indicating whether the dialog box contains controls that allow the user to specify strikethrough, underline, and text color options.
| value | true if the dialog box contains controls to set strikethrough, underline, and text color options; otherwise, false. The default value is true. |
|
nodiscardnoexcept |
Gets a value indicating whether the dialog box displays a Help button.
| auto xtd::forms::font_dialog::show_help | ( | bool | value | ) | -> font_dialog & |
Sets a value indicating whether the dialog box displays a Help button.
| value | true if the dialog box displays a Help button; otherwise, false. The default value is false. |
|
overridevirtualnoexcept |
Resets all dialog box options to their default values.
Implements xtd::forms::common_dialog.
|
protectedvirtual |
Raises the font_dialog::apply event.
| e | An event_args that contains the data. |
|
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.
| xtd::event<font_dialog, xtd::event_handler> xtd::forms::font_dialog::apply |
Occurs when the user clicks the Apply button in the font dialog box.