]>
Commit | Line | Data |
---|---|---|
c801d85f | 1 | ///////////////////////////////////////////////////////////////////////////// |
bad606fa | 2 | // Name: wx/settings.h |
7516ed26 | 3 | // Purpose: wxSystemSettings class |
c801d85f KB |
4 | // Author: Julian Smart |
5 | // Modified by: | |
6 | // Created: 01/02/97 | |
7 | // RCS-ID: $Id$ | |
371a5b4e | 8 | // Copyright: (c) Julian Smart |
7516ed26 | 9 | // Licence: wxWindows licence |
c801d85f KB |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
34138703 JS |
12 | #ifndef _WX_SETTINGS_H_BASE_ |
13 | #define _WX_SETTINGS_H_BASE_ | |
c801d85f | 14 | |
bad606fa VZ |
15 | #include "wx/colour.h" |
16 | #include "wx/font.h" | |
17 | ||
18 | // possible values for wxSystemSettings::GetFont() parameter | |
19 | // | |
20 | // NB: wxMSW assumes that they have the same values as the parameters of | |
21 | // Windows GetStockObject() API, don't change the values! | |
22 | enum wxSystemFont | |
23 | { | |
24 | wxSYS_OEM_FIXED_FONT = 10, | |
25 | wxSYS_ANSI_FIXED_FONT, | |
26 | wxSYS_ANSI_VAR_FONT, | |
27 | wxSYS_SYSTEM_FONT, | |
28 | wxSYS_DEVICE_DEFAULT_FONT, | |
29 | wxSYS_DEFAULT_PALETTE, | |
30 | wxSYS_SYSTEM_FIXED_FONT, | |
3cb99894 VZ |
31 | wxSYS_DEFAULT_GUI_FONT, |
32 | wxSYS_ICONTITLE_FONT | |
33 | #ifndef __WXMSW__ | |
34 | = wxSYS_DEFAULT_GUI_FONT | |
35 | #endif | |
bad606fa VZ |
36 | }; |
37 | ||
38 | // possible values for wxSystemSettings::GetColour() parameter | |
39 | // | |
40 | // NB: wxMSW assumes that they have the same values as the parameters of | |
41 | // Windows GetSysColor() API, don't change the values! | |
42 | enum wxSystemColour | |
43 | { | |
44 | wxSYS_COLOUR_SCROLLBAR, | |
45 | wxSYS_COLOUR_BACKGROUND, | |
7d6d3bf3 | 46 | wxSYS_COLOUR_DESKTOP = wxSYS_COLOUR_BACKGROUND, |
bad606fa VZ |
47 | wxSYS_COLOUR_ACTIVECAPTION, |
48 | wxSYS_COLOUR_INACTIVECAPTION, | |
49 | wxSYS_COLOUR_MENU, | |
50 | wxSYS_COLOUR_WINDOW, | |
51 | wxSYS_COLOUR_WINDOWFRAME, | |
52 | wxSYS_COLOUR_MENUTEXT, | |
53 | wxSYS_COLOUR_WINDOWTEXT, | |
54 | wxSYS_COLOUR_CAPTIONTEXT, | |
55 | wxSYS_COLOUR_ACTIVEBORDER, | |
56 | wxSYS_COLOUR_INACTIVEBORDER, | |
57 | wxSYS_COLOUR_APPWORKSPACE, | |
58 | wxSYS_COLOUR_HIGHLIGHT, | |
59 | wxSYS_COLOUR_HIGHLIGHTTEXT, | |
60 | wxSYS_COLOUR_BTNFACE, | |
7d6d3bf3 | 61 | wxSYS_COLOUR_3DFACE = wxSYS_COLOUR_BTNFACE, |
bad606fa | 62 | wxSYS_COLOUR_BTNSHADOW, |
7d6d3bf3 | 63 | wxSYS_COLOUR_3DSHADOW = wxSYS_COLOUR_BTNSHADOW, |
bad606fa VZ |
64 | wxSYS_COLOUR_GRAYTEXT, |
65 | wxSYS_COLOUR_BTNTEXT, | |
66 | wxSYS_COLOUR_INACTIVECAPTIONTEXT, | |
67 | wxSYS_COLOUR_BTNHIGHLIGHT, | |
7d6d3bf3 VZ |
68 | wxSYS_COLOUR_BTNHILIGHT = wxSYS_COLOUR_BTNHIGHLIGHT, |
69 | wxSYS_COLOUR_3DHIGHLIGHT = wxSYS_COLOUR_BTNHIGHLIGHT, | |
70 | wxSYS_COLOUR_3DHILIGHT = wxSYS_COLOUR_BTNHIGHLIGHT, | |
bad606fa VZ |
71 | wxSYS_COLOUR_3DDKSHADOW, |
72 | wxSYS_COLOUR_3DLIGHT, | |
73 | wxSYS_COLOUR_INFOTEXT, | |
74 | wxSYS_COLOUR_INFOBK, | |
75 | wxSYS_COLOUR_LISTBOX, | |
7d6d3bf3 VZ |
76 | wxSYS_COLOUR_HOTLIGHT, |
77 | wxSYS_COLOUR_GRADIENTACTIVECAPTION, | |
78 | wxSYS_COLOUR_GRADIENTINACTIVECAPTION, | |
79 | wxSYS_COLOUR_MENUHILIGHT, | |
80 | wxSYS_COLOUR_MENUBAR, | |
bad606fa | 81 | |
7d6d3bf3 | 82 | wxSYS_COLOUR_MAX |
bad606fa VZ |
83 | }; |
84 | ||
85 | // possible values for wxSystemSettings::GetMetric() parameter | |
7516ed26 VZ |
86 | // |
87 | // NB: update the conversion table in msw/settings.cpp if you change the values | |
88 | // of the elements of this enum | |
bad606fa VZ |
89 | enum wxSystemMetric |
90 | { | |
91 | wxSYS_MOUSE_BUTTONS = 1, | |
92 | wxSYS_BORDER_X, | |
93 | wxSYS_BORDER_Y, | |
94 | wxSYS_CURSOR_X, | |
95 | wxSYS_CURSOR_Y, | |
96 | wxSYS_DCLICK_X, | |
97 | wxSYS_DCLICK_Y, | |
98 | wxSYS_DRAG_X, | |
99 | wxSYS_DRAG_Y, | |
100 | wxSYS_EDGE_X, | |
101 | wxSYS_EDGE_Y, | |
102 | wxSYS_HSCROLL_ARROW_X, | |
103 | wxSYS_HSCROLL_ARROW_Y, | |
104 | wxSYS_HTHUMB_X, | |
105 | wxSYS_ICON_X, | |
106 | wxSYS_ICON_Y, | |
107 | wxSYS_ICONSPACING_X, | |
108 | wxSYS_ICONSPACING_Y, | |
109 | wxSYS_WINDOWMIN_X, | |
110 | wxSYS_WINDOWMIN_Y, | |
111 | wxSYS_SCREEN_X, | |
112 | wxSYS_SCREEN_Y, | |
113 | wxSYS_FRAMESIZE_X, | |
114 | wxSYS_FRAMESIZE_Y, | |
115 | wxSYS_SMALLICON_X, | |
116 | wxSYS_SMALLICON_Y, | |
117 | wxSYS_HSCROLL_Y, | |
118 | wxSYS_VSCROLL_X, | |
119 | wxSYS_VSCROLL_ARROW_X, | |
120 | wxSYS_VSCROLL_ARROW_Y, | |
121 | wxSYS_VTHUMB_Y, | |
122 | wxSYS_CAPTION_Y, | |
123 | wxSYS_MENU_Y, | |
124 | wxSYS_NETWORK_PRESENT, | |
125 | wxSYS_PENWINDOWS_PRESENT, | |
126 | wxSYS_SHOW_SOUNDS, | |
127 | wxSYS_SWAP_BUTTONS | |
128 | }; | |
129 | ||
130 | // possible values for wxSystemSettings::HasFeature() parameter | |
131 | enum wxSystemFeature | |
132 | { | |
133 | wxSYS_CAN_DRAW_FRAME_DECORATIONS = 1, | |
134 | wxSYS_CAN_ICONIZE_FRAME | |
135 | }; | |
136 | ||
c15521c6 | 137 | // values for different screen designs |
41fecb44 | 138 | enum wxSystemScreenType |
c15521c6 RR |
139 | { |
140 | wxSYS_SCREEN_NONE = 0, // not yet defined | |
41fecb44 VS |
141 | |
142 | wxSYS_SCREEN_TINY, // < | |
c15521c6 | 143 | wxSYS_SCREEN_PDA, // >= 320x240 |
41fecb44 VS |
144 | wxSYS_SCREEN_SMALL, // >= 640x480 |
145 | wxSYS_SCREEN_DESKTOP // >= 800x600 | |
c15521c6 RR |
146 | }; |
147 | ||
bad606fa | 148 | // ---------------------------------------------------------------------------- |
7516ed26 | 149 | // wxSystemSettingsNative: defines the API for wxSystemSettings class |
bad606fa VZ |
150 | // ---------------------------------------------------------------------------- |
151 | ||
152 | // this is a namespace rather than a class: it has only non virtual static | |
153 | // functions | |
154 | // | |
155 | // also note that the methods are implemented in the platform-specific source | |
156 | // files (i.e. this is not a real base class as we can't override its virtual | |
157 | // functions because it doesn't have any) | |
4f89dbc4 | 158 | |
7516ed26 | 159 | class WXDLLEXPORT wxSystemSettingsNative |
bad606fa VZ |
160 | { |
161 | public: | |
162 | // get a standard system colour | |
163 | static wxColour GetColour(wxSystemColour index); | |
164 | ||
165 | // get a standard system font | |
166 | static wxFont GetFont(wxSystemFont index); | |
167 | ||
168 | // get a system-dependent metric | |
169 | static int GetMetric(wxSystemMetric index); | |
170 | ||
171 | // return true if the port has certain feature | |
172 | static bool HasFeature(wxSystemFeature index); | |
bad606fa VZ |
173 | }; |
174 | ||
175 | // ---------------------------------------------------------------------------- | |
176 | // include the declaration of the real platform-dependent class | |
177 | // ---------------------------------------------------------------------------- | |
253293c1 | 178 | |
64bea2bf | 179 | class WXDLLEXPORT wxSystemSettings : public wxSystemSettingsNative |
7516ed26 VZ |
180 | { |
181 | public: | |
182 | #ifdef __WXUNIVERSAL__ | |
183 | // in wxUniversal we want to use the theme standard colours instead of the | |
184 | // system ones, otherwuse wxSystemSettings is just the same as | |
185 | // wxSystemSettingsNative | |
186 | static wxColour GetColour(wxSystemColour index); | |
187 | #endif // __WXUNIVERSAL__ | |
925fe73a | 188 | |
c15521c6 RR |
189 | // Get system screen design (desktop, pda, ..) used for |
190 | // laying out various dialogs. | |
41fecb44 | 191 | static wxSystemScreenType GetScreenType(); |
64bea2bf | 192 | |
c15521c6 | 193 | // Override default. |
41fecb44 | 194 | static void SetScreenType( wxSystemScreenType screen ); |
64bea2bf | 195 | |
c15521c6 | 196 | // Value |
41fecb44 | 197 | static wxSystemScreenType ms_screen; |
c15521c6 | 198 | |
925fe73a VS |
199 | |
200 | // the backwards compatible versions of wxSystemSettingsNative functions, | |
201 | // don't use these methods in the new code! | |
202 | static wxColour GetSystemColour(int index) | |
203 | { return GetColour((wxSystemColour)index); } | |
204 | static wxFont GetSystemFont(int index) | |
205 | { return GetFont((wxSystemFont)index); } | |
206 | static int GetSystemMetric(int index) | |
207 | { return GetMetric((wxSystemMetric)index); } | |
7516ed26 VZ |
208 | }; |
209 | ||
c801d85f | 210 | #endif |
34138703 | 211 | // _WX_SETTINGS_H_BASE_ |
c801d85f | 212 |