]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/fontdlg.h
88fc7e414a6a02bda0be38a39c782a60abe7ec96
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxFontDialog
4 // Author: wxWidgets team
5 // Licence: wxWindows licence
6 /////////////////////////////////////////////////////////////////////////////
11 This class represents the font chooser dialog.
16 @see overview_cmndlg_font, wxFontData, wxGetFontFromUser()
18 class wxFontDialog
: public wxDialog
23 Create() must be called before the dialog can be shown.
28 Constructor with parent window.
30 wxFontDialog(wxWindow
* parent
);
34 Pass a parent window, and the @ref wxFontData "font data" object
35 to be used to initialize the dialog controls.
37 wxFontDialog(wxWindow
* parent
, const wxFontData
& data
);
40 Creates the dialog if the wxFontDialog object had been initialized using
41 the default constructor.
43 @return @true on success and @false if an error occurred.
45 bool Create(wxWindow
* parent
);
48 Creates the dialog if the wxFontDialog object had been initialized using
49 the default constructor.
51 @return @true on success and @false if an error occurred.
53 bool Create(wxWindow
* parent
, const wxFontData
& data
);
57 Returns the @ref wxFontData "font data" associated with the
60 const wxFontData
& GetFontData() const;
61 wxFontData
& GetFontData();
65 Shows the dialog, returning @c wxID_OK if the user pressed Ok, and
66 @c wxID_CANCEL otherwise.
68 If the user cancels the dialog (ShowModal returns @c wxID_CANCEL), no font
69 will be created. If the user presses OK, a new wxFont will be created and
70 stored in the font dialog's wxFontData structure.
79 // ============================================================================
80 // Global functions/macros
81 // ============================================================================
83 /** @addtogroup group_funcmacro_dialog */
87 Shows the font selection dialog and returns the font selected by user or
88 invalid font (use wxFont::IsOk() to test whether a font is valid) if the
92 The parent window for the font selection dialog.
94 If given, this will be the font initially selected in the dialog.
96 If given, this will be used for the dialog caption.
100 wxFont
wxGetFontFromUser(wxWindow
* parent
,
101 const wxFont
& fontInit
,
102 const wxString
& caption
= wxEmptyString
);