]> git.saurik.com Git - wxWidgets.git/blame - interface/wx/fontdlg.h
Make storing non-trivial data in wxThreadSpecificInfo possible.
[wxWidgets.git] / interface / wx / fontdlg.h
CommitLineData
23324ae1
FM
1/////////////////////////////////////////////////////////////////////////////
2// Name: fontdlg.h
e54c96f1 3// Purpose: interface of wxFontDialog
23324ae1 4// Author: wxWidgets team
526954c5 5// Licence: wxWindows licence
23324ae1
FM
6/////////////////////////////////////////////////////////////////////////////
7
8/**
9 @class wxFontDialog
7c913512 10
23324ae1 11 This class represents the font chooser dialog.
7c913512 12
23324ae1
FM
13 @library{wxcore}
14 @category{cmndlg}
7c913512 15
674d80a7 16 @see overview_cmndlg_font, wxFontData, wxGetFontFromUser()
23324ae1
FM
17*/
18class wxFontDialog : public wxDialog
19{
20public:
23324ae1 21 /**
0b70c946
FM
22 Default ctor.
23 Create() must be called before the dialog can be shown.
23324ae1
FM
24 */
25 wxFontDialog();
0b70c946
FM
26
27 /**
28 Constructor with parent window.
29 */
7c913512 30 wxFontDialog(wxWindow* parent);
0b70c946
FM
31
32 /**
33 Constructor.
674d80a7 34 Pass a parent window, and the @ref wxFontData "font data" object
0b70c946
FM
35 to be used to initialize the dialog controls.
36 */
7c913512 37 wxFontDialog(wxWindow* parent, const wxFontData& data);
23324ae1 38
23324ae1 39 /**
0b70c946
FM
40 Creates the dialog if the wxFontDialog object had been initialized using
41 the default constructor.
42
43 @return @true on success and @false if an error occurred.
23324ae1
FM
44 */
45 bool Create(wxWindow* parent);
0b70c946
FM
46
47 /**
48 Creates the dialog if the wxFontDialog object had been initialized using
49 the default constructor.
50
51 @return @true on success and @false if an error occurred.
52 */
7c913512 53 bool Create(wxWindow* parent, const wxFontData& data);
23324ae1
FM
54
55 //@{
56 /**
674d80a7 57 Returns the @ref wxFontData "font data" associated with the
0b70c946 58 font dialog.
23324ae1 59 */
0b70c946
FM
60 const wxFontData& GetFontData() const;
61 wxFontData& GetFontData();
23324ae1
FM
62 //@}
63
64 /**
7c913512 65 Shows the dialog, returning @c wxID_OK if the user pressed Ok, and
23324ae1 66 @c wxID_CANCEL otherwise.
0b70c946 67
23324ae1
FM
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.
0b70c946
FM
71
72 @see GetFontData()
23324ae1
FM
73 */
74 int ShowModal();
75};
76
77
e54c96f1 78
23324ae1
FM
79// ============================================================================
80// Global functions/macros
81// ============================================================================
82
b21126db 83/** @addtogroup group_funcmacro_dialog */
ba2874ff
BP
84//@{
85
23324ae1
FM
86/**
87 Shows the font selection dialog and returns the font selected by user or
ba2874ff
BP
88 invalid font (use wxFont::IsOk() to test whether a font is valid) if the
89 dialog was cancelled.
7c913512
FM
90
91 @param parent
ba2874ff 92 The parent window for the font selection dialog.
7c913512 93 @param fontInit
4cc4bfaf 94 If given, this will be the font initially selected in the dialog.
7c913512 95 @param caption
4cc4bfaf 96 If given, this will be used for the dialog caption.
ba2874ff
BP
97
98 @header{wx/fontdlg.h}
23324ae1 99*/
4cc4bfaf 100wxFont wxGetFontFromUser(wxWindow* parent,
23324ae1
FM
101 const wxFont& fontInit,
102 const wxString& caption = wxEmptyString);
103
ba2874ff
BP
104//@}
105