Represents a common dialog box that displays a dialog to the user to choose a font from among those installed on the local computer.
- Header
#include <xtd/forms/font_box>
- Namespace
- xtd::forms
- Library
- xtd.forms
- Appearance
| 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
|
- Examples
- The following code example demonstrates the use of xtd::forms::font_box dialog.
#include <xtd/forms/application>
#include <xtd/forms/button>
#include <xtd/forms/font_box>
#include <xtd/forms/form>
#include <xtd/forms/message_box>
#include <xtd/forms/label>
class form1 :
public form {
public:
form1() {
text(
"Font box example");
client_size({220, 160});
controls().push_back_range({button_font, button_font_and_color});
button_font.parent(*this)
.location({10, 10})
.size({200, 45})
.click += [this] {
auto font = system_fonts::default_font();
};
button_font_and_color.parent(*this)
.location({10, 60})
.
text(
"Select a font and a font color")
.size({200, 45})
.click += [] {
};
}
private:
};
auto main()->int {
}
|
static dialog_result | show (xtd::drawing::font &font) |
| Displays a font dialog box. More...
|
|
static dialog_result | show (xtd::drawing::font &font, const font_box_options options) |
| Displays a font dialog box. More...
|
|
static dialog_result | show (xtd::drawing::font &font, const iwin32_window &owner) |
| Displays a font dialog box in front of a specified window. More...
|
|
static dialog_result | show (xtd::drawing::font &font, const iwin32_window &owner, const font_box_options options) |
| Displays a font dialog box in front of a specified window. More...
|
|
static dialog_result | show (xtd::drawing::font &font, xtd::drawing::color &color) |
| Displays a font dialog box. More...
|
|
static dialog_result | show (xtd::drawing::font &font, xtd::drawing::color &color, const font_box_options options) |
| Displays a font dialog box. More...
|
|
static dialog_result | show (xtd::drawing::font &font, xtd::drawing::color &color, const iwin32_window &owner) |
| Displays a font dialog box in front of a specified window. More...
|
|
static dialog_result | show (xtd::drawing::font &font, xtd::drawing::color &color, const iwin32_window &owner, const font_box_options options) |
| Displays a font dialog box in front of a specified window. More...
|
|