]>
Commit | Line | Data |
---|---|---|
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 | wxRectangle fontRect; | |
50 | ||
51 | wxChoice *familyChoice; | |
52 | wxChoice *styleChoice; | |
53 | wxChoice *weightChoice; | |
54 | wxChoice *colourChoice; | |
55 | wxCheckBox *underLineCheckBox; | |
56 | wxChoice *pointSizeChoice; | |
57 | ||
58 | // static bool fontDialogCancelled; | |
59 | public: | |
60 | ||
61 | wxGenericFontDialog(void); | |
62 | wxGenericFontDialog(wxWindow *parent, wxFontData *data = NULL); | |
63 | ~wxGenericFontDialog(void); | |
64 | ||
65 | bool Create(wxWindow *parent, wxFontData *data = NULL); | |
66 | ||
67 | int ShowModal(void); | |
68 | ||
69 | inline wxFontData& GetFontData(void) { return fontData; } | |
70 | ||
71 | // Internal functions | |
72 | void OnPaint(wxPaintEvent& event); | |
73 | ||
74 | bool OnClose(void); | |
75 | ||
76 | virtual void CreateWidgets(void); | |
77 | virtual void InitializeFont(void); | |
78 | ||
79 | virtual void PaintFontBackground(wxDC& dc); | |
80 | virtual void PaintFont(wxDC& dc); | |
81 | ||
82 | void OnChangeFont(wxCommandEvent& event); | |
83 | ||
84 | DECLARE_EVENT_TABLE() | |
85 | }; | |
86 | ||
87 | char* WXDLLEXPORT wxFontFamilyIntToString(int family); | |
88 | char* WXDLLEXPORT wxFontWeightIntToString(int weight); | |
89 | char* WXDLLEXPORT wxFontStyleIntToString(int style); | |
90 | int WXDLLEXPORT wxFontFamilyStringToInt(char *family); | |
91 | int WXDLLEXPORT wxFontWeightStringToInt(char *weight); | |
92 | int WXDLLEXPORT wxFontStyleStringToInt(char *style); | |
93 | ||
94 | #endif |