]>
Commit | Line | Data |
---|---|---|
23324ae1 FM |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: settings.h | |
e54c96f1 | 3 | // Purpose: interface of wxSystemSettings |
23324ae1 | 4 | // Author: wxWidgets team |
526954c5 | 5 | // Licence: wxWindows licence |
23324ae1 FM |
6 | ///////////////////////////////////////////////////////////////////////////// |
7 | ||
4876436a FM |
8 | |
9 | /** | |
10 | Possible values for wxSystemSettings::GetFont() parameter. | |
d6e329cf | 11 | |
a4d291f0 FM |
12 | These values map 1:1 the native values supported by the Windows' @c GetStockObject |
13 | function. Note that other ports (other than wxMSW) will try to provide meaningful | |
14 | fonts but they usually map the same font to various @c wxSYS_*_FONT values. | |
4876436a FM |
15 | */ |
16 | enum wxSystemFont | |
17 | { | |
a4d291f0 FM |
18 | /// Original equipment manufacturer dependent fixed-pitch font. |
19 | wxSYS_OEM_FIXED_FONT = 10, | |
d6e329cf | 20 | |
a4d291f0 FM |
21 | /// Windows fixed-pitch (monospaced) font. |
22 | wxSYS_ANSI_FIXED_FONT, | |
d6e329cf | 23 | |
a4d291f0 FM |
24 | /// Windows variable-pitch (proportional) font. |
25 | wxSYS_ANSI_VAR_FONT, | |
26 | ||
d6e329cf | 27 | /// System font. By default, the system uses the system font to draw menus, |
a4d291f0 FM |
28 | /// dialog box controls, and text. |
29 | wxSYS_SYSTEM_FONT, | |
d6e329cf | 30 | |
a4d291f0 FM |
31 | /// Device-dependent font (Windows NT and later only). |
32 | wxSYS_DEVICE_DEFAULT_FONT, | |
4876436a FM |
33 | |
34 | /** | |
35 | Default font for user interface objects such as menus and dialog boxes. | |
36 | Note that with modern GUIs nothing guarantees that the same font is used | |
37 | for all GUI elements, so some controls might use a different font by default. | |
38 | */ | |
39 | wxSYS_DEFAULT_GUI_FONT | |
40 | }; | |
41 | ||
42 | ||
43 | /** | |
44 | Possible values for wxSystemSettings::GetColour() parameter. | |
d6e329cf | 45 | |
a4d291f0 FM |
46 | These values map 1:1 the native values supported by the Windows' @c GetSysColor |
47 | function. Note that other ports (other than wxMSW) will try to provide meaningful | |
48 | colours but they usually map the same colour to various @c wxSYS_COLOUR_* values. | |
4876436a FM |
49 | */ |
50 | enum wxSystemColour | |
51 | { | |
52 | wxSYS_COLOUR_SCROLLBAR, //!< The scrollbar grey area. | |
a4d291f0 FM |
53 | wxSYS_COLOUR_DESKTOP, //!< The desktop colour. |
54 | wxSYS_COLOUR_ACTIVECAPTION, //!< Active window caption colour. | |
55 | wxSYS_COLOUR_INACTIVECAPTION, //!< Inactive window caption colour. | |
56 | wxSYS_COLOUR_MENU, //!< Menu background colour. | |
57 | wxSYS_COLOUR_WINDOW, //!< Window background colour. | |
58 | wxSYS_COLOUR_WINDOWFRAME, //!< Window frame colour. | |
59 | wxSYS_COLOUR_MENUTEXT, //!< Colour of the text used in the menus. | |
60 | wxSYS_COLOUR_WINDOWTEXT, //!< Colour of the text used in generic windows. | |
61 | wxSYS_COLOUR_CAPTIONTEXT, //!< Colour of the text used in captions, size boxes and scrollbar arrow boxes. | |
62 | wxSYS_COLOUR_ACTIVEBORDER, //!< Active window border colour. | |
63 | wxSYS_COLOUR_INACTIVEBORDER, //!< Inactive window border colour. | |
64 | wxSYS_COLOUR_APPWORKSPACE, //!< Background colour for MDI applications. | |
65 | wxSYS_COLOUR_HIGHLIGHT, //!< Colour of item(s) selected in a control. | |
66 | wxSYS_COLOUR_HIGHLIGHTTEXT, //!< Colour of the text of item(s) selected in a control. | |
67 | wxSYS_COLOUR_BTNFACE, //!< Face shading colour on push buttons. | |
68 | wxSYS_COLOUR_BTNSHADOW, //!< Edge shading colour on push buttons. | |
69 | wxSYS_COLOUR_GRAYTEXT, //!< Colour of greyed (disabled) text. | |
70 | wxSYS_COLOUR_BTNTEXT, //!< Colour of the text on push buttons. | |
71 | wxSYS_COLOUR_INACTIVECAPTIONTEXT, //!< Colour of the text in active captions. | |
72 | wxSYS_COLOUR_BTNHIGHLIGHT, //!< Highlight colour for buttons. | |
73 | wxSYS_COLOUR_3DDKSHADOW, //!< Dark shadow colour for three-dimensional display elements. | |
4876436a FM |
74 | wxSYS_COLOUR_3DLIGHT, //!< Light colour for three-dimensional display elements. |
75 | wxSYS_COLOUR_INFOTEXT, //!< Text colour for tooltip controls. | |
76 | wxSYS_COLOUR_INFOBK, //!< Background colour for tooltip controls. | |
d13b34d3 | 77 | wxSYS_COLOUR_LISTBOX, //!< Background colour for list-like controls. |
a4d291f0 | 78 | wxSYS_COLOUR_HOTLIGHT, //!< Colour for a hyperlink or hot-tracked item. |
d6e329cf | 79 | |
a4d291f0 | 80 | /** |
d6e329cf | 81 | Right side colour in the color gradient of an active window's title bar. |
a4d291f0 FM |
82 | @c wxSYS_COLOUR_ACTIVECAPTION specifies the left side color. |
83 | */ | |
4876436a | 84 | wxSYS_COLOUR_GRADIENTACTIVECAPTION, |
d6e329cf | 85 | |
a4d291f0 | 86 | /** |
d6e329cf | 87 | Right side colour in the color gradient of an inactive window's title bar. |
a4d291f0 FM |
88 | @c wxSYS_COLOUR_INACTIVECAPTION specifies the left side color. |
89 | */ | |
4876436a | 90 | wxSYS_COLOUR_GRADIENTINACTIVECAPTION, |
d6e329cf | 91 | |
a4d291f0 | 92 | /** |
d6e329cf | 93 | The colour used to highlight menu items when the menu appears as a flat menu. |
a4d291f0 FM |
94 | The highlighted menu item is outlined with @c wxSYS_COLOUR_HIGHLIGHT. |
95 | */ | |
4876436a | 96 | wxSYS_COLOUR_MENUHILIGHT, |
d6e329cf | 97 | |
a4d291f0 | 98 | /** |
d6e329cf | 99 | The background colour for the menu bar when menus appear as flat menus. |
a4d291f0 FM |
100 | However, @c wxSYS_COLOUR_MENU continues to specify the background color of the menu popup. |
101 | */ | |
4876436a | 102 | wxSYS_COLOUR_MENUBAR, |
d6e329cf | 103 | |
9f2968ad VZ |
104 | /** |
105 | Text colour for list-like controls. | |
d6e329cf | 106 | |
9f2968ad VZ |
107 | @since 2.9.0 |
108 | */ | |
109 | wxSYS_COLOUR_LISTBOXTEXT, | |
4876436a | 110 | |
887b919b JS |
111 | /** |
112 | Text colour for the unfocused selection of list-like controls. | |
113 | ||
114 | @since 2.9.1 | |
115 | */ | |
116 | wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT, | |
117 | ||
d6e329cf FM |
118 | wxSYS_COLOUR_MAX |
119 | ||
120 | ||
121 | ||
a4d291f0 | 122 | // synonyms: |
d6e329cf | 123 | |
a4d291f0 FM |
124 | wxSYS_COLOUR_BACKGROUND = wxSYS_COLOUR_DESKTOP, |
125 | //!< Synonym for @c wxSYS_COLOUR_DESKTOP. | |
126 | wxSYS_COLOUR_3DFACE = wxSYS_COLOUR_BTNFACE, | |
127 | //!< Synonym for @c wxSYS_COLOUR_BTNFACE. | |
128 | wxSYS_COLOUR_3DSHADOW = wxSYS_COLOUR_BTNSHADOW, | |
129 | //!< Synonym for @c wxSYS_COLOUR_BTNSHADOW. | |
130 | wxSYS_COLOUR_BTNHILIGHT = wxSYS_COLOUR_BTNHIGHLIGHT, | |
131 | //!< Synonym for @c wxSYS_COLOUR_BTNHIGHLIGHT. | |
132 | wxSYS_COLOUR_3DHIGHLIGHT = wxSYS_COLOUR_BTNHIGHLIGHT, | |
133 | //!< Synonym for @c wxSYS_COLOUR_BTNHIGHLIGHT. | |
134 | wxSYS_COLOUR_3DHILIGHT = wxSYS_COLOUR_BTNHIGHLIGHT, | |
135 | //!< Synonym for @c wxSYS_COLOUR_BTNHIGHLIGHT. | |
d6e329cf | 136 | |
a4d291f0 | 137 | /** |
d13b34d3 | 138 | Synonym for @c wxSYS_COLOUR_BTNFACE. |
d6e329cf | 139 | |
a4d291f0 FM |
140 | On wxMSW this colour should be used as the background colour of |
141 | wxFrames which are used as containers of controls; this is in fact the | |
d6e329cf FM |
142 | same colour used for the borders of controls like e.g. wxNotebook or |
143 | for the background of e.g. wxPanel. | |
144 | ||
a4d291f0 FM |
145 | @since 2.9.0 |
146 | */ | |
d6e329cf | 147 | wxSYS_COLOUR_FRAMEBK = wxSYS_COLOUR_BTNFACE |
4876436a FM |
148 | }; |
149 | ||
150 | /** | |
151 | Possible values for wxSystemSettings::GetMetric() index parameter. | |
152 | */ | |
153 | enum wxSystemMetric | |
154 | { | |
155 | wxSYS_MOUSE_BUTTONS, //!< Number of buttons on mouse, or zero if no mouse was installed. | |
156 | wxSYS_BORDER_X, //!< Width of single border. | |
157 | wxSYS_BORDER_Y, //!< Height of single border. | |
158 | wxSYS_CURSOR_X, //!< Width of cursor. | |
159 | wxSYS_CURSOR_Y, //!< Height of cursor. | |
160 | wxSYS_DCLICK_X, //!< Width in pixels of rectangle within which two successive mouse clicks must fall to generate a double-click. | |
161 | wxSYS_DCLICK_Y, //!< Height in pixels of rectangle within which two successive mouse clicks must fall to generate a double-click. | |
4876436a FM |
162 | wxSYS_DRAG_X, //!< Width in pixels of a rectangle centered on a drag point to allow for limited movement of the mouse pointer before a drag operation begins. |
163 | wxSYS_DRAG_Y, //!< Height in pixels of a rectangle centered on a drag point to allow for limited movement of the mouse pointer before a drag operation begins. | |
164 | wxSYS_EDGE_X, //!< Width of a 3D border, in pixels. | |
165 | wxSYS_EDGE_Y, //!< Height of a 3D border, in pixels. | |
166 | wxSYS_HSCROLL_ARROW_X, //!< Width of arrow bitmap on horizontal scrollbar. | |
167 | wxSYS_HSCROLL_ARROW_Y, //!< Height of arrow bitmap on horizontal scrollbar. | |
168 | wxSYS_HTHUMB_X, //!< Width of horizontal scrollbar thumb. | |
169 | wxSYS_ICON_X, //!< The default width of an icon. | |
170 | wxSYS_ICON_Y, //!< The default height of an icon. | |
171 | wxSYS_ICONSPACING_X, //!< Width of a grid cell for items in large icon view, in pixels. Each item fits into a rectangle of this size when arranged. | |
172 | wxSYS_ICONSPACING_Y, //!< Height of a grid cell for items in large icon view, in pixels. Each item fits into a rectangle of this size when arranged. | |
173 | wxSYS_WINDOWMIN_X, //!< Minimum width of a window. | |
174 | wxSYS_WINDOWMIN_Y, //!< Minimum height of a window. | |
175 | wxSYS_SCREEN_X, //!< Width of the screen in pixels. | |
176 | wxSYS_SCREEN_Y, //!< Height of the screen in pixels. | |
177 | wxSYS_FRAMESIZE_X, //!< Width of the window frame for a wxTHICK_FRAME window. | |
178 | wxSYS_FRAMESIZE_Y, //!< Height of the window frame for a wxTHICK_FRAME window. | |
179 | wxSYS_SMALLICON_X, //!< Recommended width of a small icon (in window captions, and small icon view). | |
180 | wxSYS_SMALLICON_Y, //!< Recommended height of a small icon (in window captions, and small icon view). | |
181 | wxSYS_HSCROLL_Y, //!< Height of horizontal scrollbar in pixels. | |
182 | wxSYS_VSCROLL_X, //!< Width of vertical scrollbar in pixels. | |
183 | wxSYS_VSCROLL_ARROW_X, //!< Width of arrow bitmap on a vertical scrollbar. | |
184 | wxSYS_VSCROLL_ARROW_Y, //!< Height of arrow bitmap on a vertical scrollbar. | |
185 | wxSYS_VTHUMB_Y, //!< Height of vertical scrollbar thumb. | |
186 | wxSYS_CAPTION_Y, //!< Height of normal caption area. | |
187 | wxSYS_MENU_Y, //!< Height of single-line menu bar. | |
188 | wxSYS_NETWORK_PRESENT, //!< 1 if there is a network present, 0 otherwise. | |
189 | wxSYS_PENWINDOWS_PRESENT, //!< 1 if PenWindows is installed, 0 otherwise. | |
190 | wxSYS_SHOW_SOUNDS, //!< Non-zero if the user requires an application to present information | |
191 | //!< visually in situations where it would otherwise present the information | |
192 | //!< only in audible form; zero otherwise. | |
193 | wxSYS_SWAP_BUTTONS, //!< Non-zero if the meanings of the left and right mouse buttons are swapped; zero otherwise. | |
30dc2e86 | 194 | wxSYS_DCLICK_MSEC //!< Maximal time, in milliseconds, which may pass between subsequent clicks for a double click to be generated. |
4876436a FM |
195 | }; |
196 | ||
197 | /** | |
198 | Possible values for wxSystemSettings::HasFeature() parameter. | |
199 | */ | |
200 | enum wxSystemFeature | |
201 | { | |
202 | wxSYS_CAN_DRAW_FRAME_DECORATIONS = 1, | |
203 | wxSYS_CAN_ICONIZE_FRAME, | |
204 | wxSYS_TABLET_PRESENT | |
205 | }; | |
206 | ||
207 | /** | |
d6e329cf | 208 | Values for different screen designs. See wxSystemSettings::GetScreenType(). |
4876436a FM |
209 | */ |
210 | enum wxSystemScreenType | |
211 | { | |
212 | wxSYS_SCREEN_NONE = 0, //!< Undefined screen type. | |
213 | ||
214 | wxSYS_SCREEN_TINY, //!< Tiny screen, less than 320x240 | |
215 | wxSYS_SCREEN_PDA, //!< PDA screen, 320x240 or more but less than 640x480 | |
216 | wxSYS_SCREEN_SMALL, //!< Small screen, 640x480 or more but less than 800x600 | |
217 | wxSYS_SCREEN_DESKTOP //!< Desktop screen, 800x600 or more | |
218 | }; | |
219 | ||
220 | ||
23324ae1 FM |
221 | /** |
222 | @class wxSystemSettings | |
7c913512 | 223 | |
4876436a | 224 | wxSystemSettings allows the application to ask for details about the system. |
e3527f7b FM |
225 | |
226 | This can include settings such as standard colours, fonts, and user interface | |
227 | element sizes. | |
7c913512 | 228 | |
23324ae1 | 229 | @library{wxcore} |
3c99e2fd | 230 | @category{cfg} |
7c913512 | 231 | |
d6e329cf | 232 | @see wxFont, wxColour, wxSystemOptions |
23324ae1 FM |
233 | */ |
234 | class wxSystemSettings : public wxObject | |
235 | { | |
236 | public: | |
237 | /** | |
4876436a FM |
238 | Default constructor. |
239 | ||
240 | You don't need to create an instance of wxSystemSettings | |
23324ae1 FM |
241 | since all of its functions are static. |
242 | */ | |
243 | wxSystemSettings(); | |
244 | ||
245 | /** | |
246 | Returns a system colour. | |
e3527f7b FM |
247 | |
248 | @param index | |
249 | Can be one of the ::wxSystemColour enum values. | |
250 | ||
251 | @return | |
252 | The returned colour is always valid. | |
23324ae1 FM |
253 | */ |
254 | static wxColour GetColour(wxSystemColour index); | |
255 | ||
256 | /** | |
257 | Returns a system font. | |
e3527f7b FM |
258 | |
259 | @param index | |
260 | Can be one of the ::wxSystemFont enum values. | |
261 | ||
262 | @return | |
263 | The returned font is always valid. | |
23324ae1 FM |
264 | */ |
265 | static wxFont GetFont(wxSystemFont index); | |
266 | ||
267 | /** | |
268 | Returns the value of a system metric, or -1 if the metric is not supported on | |
269 | the current system. | |
4876436a | 270 | |
4cc4bfaf | 271 | The value of @a win determines if the metric returned is a global value or |
23324ae1 FM |
272 | a wxWindow based value, in which case it might determine the widget, the |
273 | display the window is on, or something similar. The window given should be as | |
d13b34d3 | 274 | close to the metric as possible (e.g. a wxTopLevelWindow in case of the |
4876436a | 275 | wxSYS_CAPTION_Y metric). |
3c4f71cc | 276 | |
4876436a | 277 | @a index can be one of the ::wxSystemMetric enum values. |
3c4f71cc | 278 | |
4cc4bfaf FM |
279 | @a win is a pointer to the window for which the metric is requested. |
280 | Specifying the @a win parameter is encouraged, because some metrics on some | |
4876436a FM |
281 | ports are not supported without one,or they might be capable of reporting |
282 | better values if given one. If a window does not make sense for a metric, | |
23324ae1 | 283 | one should still be given, as for example it might determine which displays |
4876436a | 284 | cursor width is requested with wxSYS_CURSOR_X. |
23324ae1 | 285 | */ |
4cc4bfaf | 286 | static int GetMetric(wxSystemMetric index, wxWindow* win = NULL); |
23324ae1 FM |
287 | |
288 | /** | |
4876436a FM |
289 | Returns the screen type. |
290 | The return value is one of the ::wxSystemScreenType enum values. | |
23324ae1 FM |
291 | */ |
292 | static wxSystemScreenType GetScreenType(); | |
d6e329cf FM |
293 | |
294 | /** | |
295 | Returns @true if the port has certain feature. | |
296 | See the ::wxSystemFeature enum values. | |
297 | */ | |
298 | static bool HasFeature(wxSystemFeature index); | |
23324ae1 | 299 | }; |
e54c96f1 | 300 |