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