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