]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/fontdlg.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxFontDialog
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
12 This class represents the font chooser dialog.
17 @see Overview(), wxFontData, wxGetFontFromUser()
19 class wxFontDialog
: public wxDialog
24 Constructor. Pass a parent window, and optionally the
25 @ref overview_wxfontdata "font data" object to be used to initialize the dialog
26 controls. If the default constructor is used,
27 Create() must be called before the dialog can be
31 wxFontDialog(wxWindow
* parent
);
32 wxFontDialog(wxWindow
* parent
, const wxFontData
& data
);
37 Creates the dialog if it the wxFontDialog object had been initialized using the
38 default constructor. Returns @true on success and @false if an error
41 bool Create(wxWindow
* parent
);
42 bool Create(wxWindow
* parent
, const wxFontData
& data
);
47 Returns the @ref overview_wxfontdata "font data" associated with the font
50 const wxFontData
GetFontData();
51 const wxFontData
& GetFontData();
55 Shows the dialog, returning @c wxID_OK if the user pressed Ok, and
56 @c wxID_CANCEL otherwise.
57 If the user cancels the dialog (ShowModal returns @c wxID_CANCEL), no font
58 will be created. If the user presses OK, a new wxFont will be created and
59 stored in the font dialog's wxFontData structure.
66 // ============================================================================
67 // Global functions/macros
68 // ============================================================================
70 /** @ingroup group_funcmacro_dialog */
74 Shows the font selection dialog and returns the font selected by user or
75 invalid font (use wxFont::IsOk() to test whether a font is valid) if the
79 The parent window for the font selection dialog.
81 If given, this will be the font initially selected in the dialog.
83 If given, this will be used for the dialog caption.
87 wxFont
wxGetFontFromUser(wxWindow
* parent
,
88 const wxFont
& fontInit
,
89 const wxString
& caption
= wxEmptyString
);