]> git.saurik.com Git - wxWidgets.git/blob - include/wx/generic/fontdlgg.h
A little black magic... When the C++ object (for a window or
[wxWidgets.git] / include / wx / generic / fontdlgg.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: fontdlgg.h
3 // Purpose: wxGenericFontDialog
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 01/02/97
7 // RCS-ID: $Id$
8 // Copyright: (c)
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef __FONTDLGH_G__
13 #define __FONTDLGH_G__
14
15 #ifdef __GNUG__
16 #pragma interface "fontdlgg.h"
17 #endif
18
19 #include "wx/setup.h"
20 #include "wx/gdicmn.h"
21 #include "wx/font.h"
22 #include "wx/dialog.h"
23 #include "wx/cmndata.h"
24
25 /*
26 * FONT DIALOG
27 */
28
29 class WXDLLEXPORT wxChoice;
30 class WXDLLEXPORT wxText;
31 class WXDLLEXPORT wxCheckBox;
32 class WXDLLEXPORT wxFontPreviewer;
33
34 #define wxID_FONT_UNDERLINE 3000
35 #define wxID_FONT_STYLE 3001
36 #define wxID_FONT_WEIGHT 3002
37 #define wxID_FONT_FAMILY 3003
38 #define wxID_FONT_COLOUR 3004
39 #define wxID_FONT_SIZE 3005
40
41 class WXDLLEXPORT wxGenericFontDialog: public wxDialog
42 {
43 DECLARE_DYNAMIC_CLASS(wxGenericFontDialog)
44 protected:
45 wxFontData fontData;
46 wxFont dialogFont;
47 wxWindow *dialogParent;
48
49 wxChoice *familyChoice;
50 wxChoice *styleChoice;
51 wxChoice *weightChoice;
52 wxChoice *colourChoice;
53 wxCheckBox *underLineCheckBox;
54 wxChoice *pointSizeChoice;
55 wxFontPreviewer *m_previewer;
56 bool m_useEvents;
57
58 // static bool fontDialogCancelled;
59 public:
60
61 wxGenericFontDialog(void);
62 wxGenericFontDialog(wxWindow *parent, wxFontData *data = (wxFontData *) NULL);
63 ~wxGenericFontDialog(void);
64
65 bool Create(wxWindow *parent, wxFontData *data = (wxFontData *) NULL);
66
67 int ShowModal(void);
68
69 inline wxFontData& GetFontData(void) { return fontData; }
70
71 // Internal functions
72 void OnCloseWindow(wxCloseEvent& event);
73
74 virtual void CreateWidgets(void);
75 virtual void InitializeFont(void);
76
77 void OnChangeFont(wxCommandEvent& event);
78
79 DECLARE_EVENT_TABLE()
80 };
81
82 wxChar WXDLLEXPORT *wxFontFamilyIntToString(int family);
83 wxChar WXDLLEXPORT *wxFontWeightIntToString(int weight);
84 wxChar WXDLLEXPORT *wxFontStyleIntToString(int style);
85 int WXDLLEXPORT wxFontFamilyStringToInt(wxChar *family);
86 int WXDLLEXPORT wxFontWeightStringToInt(wxChar *weight);
87 int WXDLLEXPORT wxFontStyleStringToInt(wxChar *style);
88
89 #endif