Prompts the user to choose a font from among those installed on the local computer.
- Namespace
- xtd::forms
- Library
- xtd.forms
- Examples
- The following code example demonstrate the use of font_dialog dialog.
#include <xtd/xtd>
class form1 :
public form {
public:
form1() {
text("Font dialog example");
client_size({400, 400});
controls().push_back_range({
button1, label1});
button1.location({10, 10});
button1.text("Font...");
button1.click += [&] {
}
};
label1.location({10, 50});
label1.size({380, 340});
label1.anchor(anchor_styles::left | anchor_styles::top | anchor_styles::right | anchor_styles::bottom);
label1.text(u8"The quick brown fox jumps over the lazy dog.\n"
u8"THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG.\n"
u8"0123456789+-*/%~^&|=<>≤≥±÷≠{{[()]}},;:.?¿!¡\n"
u8"àçéèêëïî@@°_#§$ù£€æœø𵩮∞\\\"'\n"
u8"\u0400\u0401\u0402\u0403\u0404\u0405\u0406\u0407\u0408\u0409\u040a\u040b\u040c\u040d\u040e\u040f\n"
u8"\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041a\u041b\u041c\u041d\u041e\u041f\n"
u8"\u4ea0\u4ea1\u4ea2\u4ea3\u4ea4\u4ea5\u4ea6\u4ea7\u4ea8\u4ea9\u4eaa\u4eab\u4eac\u4ead\u4eae\u4eaf\n"
u8"\u4eb0\u4eb1\u4eb2\u4eb3\u4eb4\u4eb5\u4eb6\u4eb7\u4eb8\u4eb9\u4eba\u4ebb\u4ebc\u4ebd\u4ebe\u4ebf\n"
u8"\U0001F428");
}
private:
};
int main() {
}
font(const font &prototype, float em_size)
IInitializes a new Font that uses the specified existing xtd::drawing::font and size.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition system_report.h:17
- Examples
- font_dialog.cpp.
|
| font_dialog ()=default |
| Initializes a new instance of the font_dialog class.
|
|
bool | allow_script_change () const |
| 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 & | 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.
|
|
bool | allow_simulation () const |
| Gets a value indicating whether the dialog box allows graphics device interface (GDI) font simulations.
|
|
font_dialog & | allow_simulation (bool allow_simulation) |
| Sets a value indicating whether the dialog box allows graphics device interface (GDI) font simulations.
|
|
bool | allow_vector_fonts () const |
| Gets a value indicating whether the dialog box allows vector font selections.
|
|
font_dialog & | allow_vector_fonts (bool allow_vector_fonts) |
| Sets a value indicating whether the dialog box allows vector font selections.
|
|
bool | allow_vertical_fonts () const |
| Gets a value indicating whether the dialog box displays both vertical and horizontal fonts or only horizontal fonts.
|
|
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.
|
|
drawing::color | color () const |
| Gets the selected font color.
|
|
font_dialog & | color (const drawing::color &color) |
| Sets the selected font color.
|
|
bool | fixed_pitch_only () const |
| Gets a value indicating whether the dialog box allows only the selection of fixed-pitch fonts.
|
|
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.
|
|
drawing::font | font () const |
| Gets the selected font.
|
|
font_dialog & | font (const drawing::font &font) |
| Sets the selected font.
|
|
bool | font_must_exist () const |
| 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 & | 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.
|
|
size_t | max_size () const |
| Gets the maximum point size a user can select.
|
|
font_dialog & | max_size (size_t max_size) |
| Sets the maximum point size a user can select.
|
|
size_t | min_size () const |
| Gets the minimum point size a user can select.
|
|
font_dialog & | min_size (size_t min_size) |
| Sets the minimum point size a user can select.
|
|
size_t | options () const |
| Gets values to initialize the font_dialog.
|
|
void | reset () override |
| Resets all dialog box options to their default values.
|
|
bool | script_only () const |
| 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 & | 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.
|
|
bool | show_apply () const |
| Gets a value indicating whether the dialog box contains an Apply button.
|
|
font_dialog & | show_apply (bool show_apply) |
| Sets a value indicating whether the dialog box contains an Apply button.
|
|
bool | show_color () const |
| Gets a value indicating whether the dialog box displays the color choice.
|
|
font_dialog & | show_color (bool show_color) |
| Sets a value indicating whether the dialog box displays the color choice.
|
|
bool | show_effect () const |
| Gets a value indicating whether the dialog box contains controls that allow the user to specify strikethrough, underline, and text color options.
|
|
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.
|
|
bool | show_help () const |
| Gets a value indicating whether the dialog box displays a Help button.
|
|
font_dialog & | show_help (bool show_help) |
| Sets a value indicating whether the dialog box displays a Help button.
|
|
| common_dialog ()=default |
| Initializes a new instance of the common_dialog class.
|
|
xtd::forms::dialog_result | dialog_result () const |
| Get async dialog_result result after dialog box is closing.
|
|
virtual void | reset ()=0 |
| When overridden in a derived class, resets the properties of a common dialog box to their default values.
|
|
xtd::forms::dialog_result | show_dialog () |
| Runs a common dialog box with a default owner.
|
|
xtd::forms::dialog_result | show_dialog (const iwin32_window &owner) |
| Runs a common dialog box with the specified owner.
|
|
void | show_sheet (const iwin32_window &owner) |
| Runs a common dialog box with the specified owner.
|
|
xtd::forms::dialog_result | show_sheet_dialog (const iwin32_window &owner) |
| Runs a common dialog box with the specified owner.
|
|
std::any | tag () const |
| Gets an object that contains data about the control.
|
|
common_dialog & | tag (const std::any &tag) |
| Sets an object that contains data about the control.
|
|
| object ()=default |
| Create a new instance of the ultimate base class object.
|
|
virtual bool | equals (const object &obj) const noexcept |
| Determines whether the specified object is equal to the current object.
|
|
virtual size_t | get_hash_code () const noexcept |
| Serves as a hash function for a particular type.
|
|
template<typename object_t > |
std::unique_ptr< object_t > | memberwise_clone () const |
| Gets the type of the current instance.
|
|
virtual xtd::ustring | to_string () const noexcept |
| Returns a std::string that represents the current object.
|
|