]>
Commit | Line | Data |
---|---|---|
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 | |
11 | @wxheader{fontdlg.h} | |
7c913512 | 12 | |
23324ae1 | 13 | This class represents the font chooser dialog. |
7c913512 | 14 | |
23324ae1 FM |
15 | @library{wxcore} |
16 | @category{cmndlg} | |
7c913512 | 17 | |
e54c96f1 | 18 | @see Overview(), wxFontData, wxGetFontFromUser() |
23324ae1 FM |
19 | */ |
20 | class wxFontDialog : public wxDialog | |
21 | { | |
22 | public: | |
23 | //@{ | |
24 | /** | |
7c913512 | 25 | Constructor. Pass a parent window, and optionally the |
23324ae1 | 26 | @ref overview_wxfontdata "font data" object to be used to initialize the dialog |
7c913512 | 27 | controls. If the default constructor is used, |
23324ae1 FM |
28 | Create() must be called before the dialog can be |
29 | shown. | |
30 | */ | |
31 | wxFontDialog(); | |
7c913512 FM |
32 | wxFontDialog(wxWindow* parent); |
33 | wxFontDialog(wxWindow* parent, const wxFontData& data); | |
23324ae1 FM |
34 | //@} |
35 | ||
36 | //@{ | |
37 | /** | |
38 | Creates the dialog if it the wxFontDialog object had been initialized using the | |
39 | default constructor. Returns @true on success and @false if an error | |
40 | occurred. | |
41 | */ | |
42 | bool Create(wxWindow* parent); | |
7c913512 | 43 | bool Create(wxWindow* parent, const wxFontData& data); |
23324ae1 FM |
44 | //@} |
45 | ||
46 | //@{ | |
47 | /** | |
48 | Returns the @ref overview_wxfontdata "font data" associated with the font | |
49 | dialog. | |
50 | */ | |
51 | const wxFontData GetFontData(); | |
328f5751 | 52 | const wxFontData& GetFontData(); |
23324ae1 FM |
53 | //@} |
54 | ||
55 | /** | |
7c913512 | 56 | Shows the dialog, returning @c wxID_OK if the user pressed Ok, and |
23324ae1 | 57 | @c wxID_CANCEL otherwise. |
23324ae1 FM |
58 | If the user cancels the dialog (ShowModal returns @c wxID_CANCEL), no font |
59 | will be created. If the user presses OK, a new wxFont will be created and | |
60 | stored in the font dialog's wxFontData structure. | |
61 | */ | |
62 | int ShowModal(); | |
63 | }; | |
64 | ||
65 | ||
e54c96f1 | 66 | |
23324ae1 FM |
67 | // ============================================================================ |
68 | // Global functions/macros | |
69 | // ============================================================================ | |
70 | ||
71 | /** | |
72 | Shows the font selection dialog and returns the font selected by user or | |
73 | invalid font (use @ref wxFont::isok wxFont:IsOk to test whether a font | |
74 | is valid) if the dialog was cancelled. | |
7c913512 FM |
75 | |
76 | @param parent | |
4cc4bfaf | 77 | The parent window for the font selection dialog |
7c913512 | 78 | @param fontInit |
4cc4bfaf | 79 | If given, this will be the font initially selected in the dialog. |
7c913512 | 80 | @param caption |
4cc4bfaf | 81 | If given, this will be used for the dialog caption. |
23324ae1 | 82 | */ |
4cc4bfaf | 83 | wxFont wxGetFontFromUser(wxWindow* parent, |
23324ae1 FM |
84 | const wxFont& fontInit, |
85 | const wxString& caption = wxEmptyString); | |
86 |