]> git.saurik.com Git - wxWidgets.git/blob - include/wx/generic/fontdlgg.h
* prgodlgg.h: Update() use wxString instead of 'char *'
[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
33 #define wxID_FONT_UNDERLINE 3000
34 #define wxID_FONT_STYLE 3001
35 #define wxID_FONT_WEIGHT 3002
36 #define wxID_FONT_FAMILY 3003
37 #define wxID_FONT_COLOUR 3004
38 #define wxID_FONT_SIZE 3005
39
40 class WXDLLEXPORT wxGenericFontDialog: public wxDialog
41 {
42 DECLARE_DYNAMIC_CLASS(wxGenericFontDialog)
43 protected:
44 wxFontData fontData;
45 wxFont dialogFont;
46 wxWindow *dialogParent;
47
48 // Area reserved for font display
49 wxRect fontRect;
50
51 wxChoice *familyChoice;
52 wxChoice *styleChoice;
53 wxChoice *weightChoice;
54 wxChoice *colourChoice;
55 wxCheckBox *underLineCheckBox;
56 wxChoice *pointSizeChoice;
57 bool m_useEvents;
58
59 // static bool fontDialogCancelled;
60 public:
61
62 wxGenericFontDialog(void);
63 wxGenericFontDialog(wxWindow *parent, wxFontData *data = (wxFontData *) NULL);
64 ~wxGenericFontDialog(void);
65
66 bool Create(wxWindow *parent, wxFontData *data = (wxFontData *) NULL);
67
68 int ShowModal(void);
69
70 inline wxFontData& GetFontData(void) { return fontData; }
71
72 // Internal functions
73 void OnPaint(wxPaintEvent& event);
74
75 void OnCloseWindow(wxCloseEvent& event);
76
77 virtual void CreateWidgets(void);
78 virtual void InitializeFont(void);
79
80 virtual void PaintFontBackground(wxDC& dc);
81 virtual void PaintFont(wxDC& dc);
82
83 void OnChangeFont(wxCommandEvent& event);
84
85 DECLARE_EVENT_TABLE()
86 };
87
88 wxChar WXDLLEXPORT *wxFontFamilyIntToString(int family);
89 wxChar WXDLLEXPORT *wxFontWeightIntToString(int weight);
90 wxChar WXDLLEXPORT *wxFontStyleIntToString(int style);
91 int WXDLLEXPORT wxFontFamilyStringToInt(wxChar *family);
92 int WXDLLEXPORT wxFontWeightStringToInt(wxChar *weight);
93 int WXDLLEXPORT wxFontStyleStringToInt(wxChar *style);
94
95 #endif