]> git.saurik.com Git - wxWidgets.git/blob - interface/fontdlg.h
make it callable from any path
[wxWidgets.git] / interface / fontdlg.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: fontdlg.h
3 // Purpose: documentation for wxFontDialog class
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
10 @class wxFontDialog
11 @wxheader{fontdlg.h}
12
13 This class represents the font chooser dialog.
14
15 @library{wxcore}
16 @category{cmndlg}
17
18 @seealso
19 Overview, wxFontData, wxGetFontFromUser
20 */
21 class wxFontDialog : public wxDialog
22 {
23 public:
24 //@{
25 /**
26 Constructor. Pass a parent window, and optionally the
27 @ref overview_wxfontdata "font data" object to be used to initialize the dialog
28 controls. If the default constructor is used,
29 Create() must be called before the dialog can be
30 shown.
31 */
32 wxFontDialog();
33 wxFontDialog(wxWindow* parent);
34 wxFontDialog(wxWindow* parent, const wxFontData& data);
35 //@}
36
37 //@{
38 /**
39 Creates the dialog if it the wxFontDialog object had been initialized using the
40 default constructor. Returns @true on success and @false if an error
41 occurred.
42 */
43 bool Create(wxWindow* parent);
44 bool Create(wxWindow* parent, const wxFontData& data);
45 //@}
46
47 //@{
48 /**
49 Returns the @ref overview_wxfontdata "font data" associated with the font
50 dialog.
51 */
52 const wxFontData GetFontData();
53 wxFontData GetFontData();
54 //@}
55
56 /**
57 Shows the dialog, returning @c wxID_OK if the user pressed Ok, and
58 @c wxID_CANCEL otherwise.
59
60 If the user cancels the dialog (ShowModal returns @c wxID_CANCEL), no font
61 will be created. If the user presses OK, a new wxFont will be created and
62 stored in the font dialog's wxFontData structure.
63 */
64 int ShowModal();
65 };
66
67
68 // ============================================================================
69 // Global functions/macros
70 // ============================================================================
71
72 /**
73 Shows the font selection dialog and returns the font selected by user or
74 invalid font (use @ref wxFont::isok wxFont:IsOk to test whether a font
75 is valid) if the dialog was cancelled.
76
77 @param parent
78 The parent window for the font selection dialog
79
80 @param fontInit
81 If given, this will be the font initially selected in the dialog.
82
83 @param caption
84 If given, this will be used for the dialog caption.
85 */
86 wxFont wxGetFontFromUser(wxWindow * parent,
87 const wxFont& fontInit,
88 const wxString& caption = wxEmptyString);
89