]> git.saurik.com Git - wxWidgets.git/blame - interface/wx/fontdlg.h
don't call OnCloseDocument() from OnNewDocument(), this plainly doesn't make sense...
[wxWidgets.git] / interface / wx / fontdlg.h
CommitLineData
23324ae1
FM
1/////////////////////////////////////////////////////////////////////////////
2// Name: fontdlg.h
e54c96f1 3// Purpose: interface of wxFontDialog
23324ae1
FM
4// Author: wxWidgets team
5// RCS-ID: $Id$
6// Licence: wxWindows license
7/////////////////////////////////////////////////////////////////////////////
8
9/**
10 @class wxFontDialog
7c913512 11
23324ae1 12 This class represents the font chooser dialog.
7c913512 13
23324ae1
FM
14 @library{wxcore}
15 @category{cmndlg}
7c913512 16
e54c96f1 17 @see Overview(), wxFontData, wxGetFontFromUser()
23324ae1
FM
18*/
19class wxFontDialog : public wxDialog
20{
21public:
22 //@{
23 /**
7c913512 24 Constructor. Pass a parent window, and optionally the
23324ae1 25 @ref overview_wxfontdata "font data" object to be used to initialize the dialog
7c913512 26 controls. If the default constructor is used,
23324ae1
FM
27 Create() must be called before the dialog can be
28 shown.
29 */
30 wxFontDialog();
7c913512
FM
31 wxFontDialog(wxWindow* parent);
32 wxFontDialog(wxWindow* parent, const wxFontData& data);
23324ae1
FM
33 //@}
34
35 //@{
36 /**
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
39 occurred.
40 */
41 bool Create(wxWindow* parent);
7c913512 42 bool Create(wxWindow* parent, const wxFontData& data);
23324ae1
FM
43 //@}
44
45 //@{
46 /**
47 Returns the @ref overview_wxfontdata "font data" associated with the font
48 dialog.
49 */
50 const wxFontData GetFontData();
328f5751 51 const wxFontData& GetFontData();
23324ae1
FM
52 //@}
53
54 /**
7c913512 55 Shows the dialog, returning @c wxID_OK if the user pressed Ok, and
23324ae1 56 @c wxID_CANCEL otherwise.
23324ae1
FM
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.
60 */
61 int ShowModal();
62};
63
64
e54c96f1 65
23324ae1
FM
66// ============================================================================
67// Global functions/macros
68// ============================================================================
69
ba2874ff
BP
70/** @ingroup group_funcmacro_dialog */
71//@{
72
23324ae1
FM
73/**
74 Shows the font selection dialog and returns the font selected by user or
ba2874ff
BP
75 invalid font (use wxFont::IsOk() to test whether a font is valid) if the
76 dialog was cancelled.
7c913512
FM
77
78 @param parent
ba2874ff 79 The parent window for the font selection dialog.
7c913512 80 @param fontInit
4cc4bfaf 81 If given, this will be the font initially selected in the dialog.
7c913512 82 @param caption
4cc4bfaf 83 If given, this will be used for the dialog caption.
ba2874ff
BP
84
85 @header{wx/fontdlg.h}
23324ae1 86*/
4cc4bfaf 87wxFont wxGetFontFromUser(wxWindow* parent,
23324ae1
FM
88 const wxFont& fontInit,
89 const wxString& caption = wxEmptyString);
90
ba2874ff
BP
91//@}
92