1 /////////////////////////////////////////////////////////////////////////////
4 // Author: David Webster
8 // Copyright: (c) David Webster
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // For compilers that support precompilation, includes "wx.h".
13 #include "wx/wxprec.h"
20 #include "wx/gdicmn.h"
21 #include "wx/module.h"
24 #include "wx/settings.h"
25 #include "wx/window.h"
26 #include "wx/os2/private.h"
28 // the module which is used to clean up wxSystemSettings data (this is a
29 // singleton class so it can't be done in the dtor)
30 class wxSystemSettingsModule
: public wxModule
32 friend class wxSystemSettings
;
34 virtual bool OnInit();
35 virtual void OnExit();
38 DECLARE_DYNAMIC_CLASS(wxSystemSettingsModule
)
40 static wxArrayString sm_optionNames
;
41 static wxArrayString sm_optionValues
;
44 // ----------------------------------------------------------------------------
46 // ----------------------------------------------------------------------------
48 static wxFont
*gs_fontDefault
= NULL
;
50 // ============================================================================
52 // ============================================================================
54 // ----------------------------------------------------------------------------
55 // wxSystemSettingsModule
56 // ----------------------------------------------------------------------------
58 IMPLEMENT_DYNAMIC_CLASS(wxSystemSettingsModule
, wxModule
)
60 wxArrayString
wxSystemSettingsModule::sm_optionNames
;
61 wxArrayString
wxSystemSettingsModule::sm_optionValues
;
63 bool wxSystemSettingsModule::OnInit()
68 void wxSystemSettingsModule::OnExit()
70 sm_optionNames
.Clear();
71 sm_optionValues
.Clear();
72 delete gs_fontDefault
;
75 wxColour
wxSystemSettingsNative::GetColour(
84 // PM actually has values for these
86 case wxSYS_COLOUR_WINDOW
:
87 vRef
= (ULONG
)::WinQuerySysColor( HWND_DESKTOP
91 vCol
.Set( GetRValue(vRef
)
97 case wxSYS_COLOUR_WINDOWFRAME
:
98 vRef
= (ULONG
)::WinQuerySysColor( HWND_DESKTOP
102 vCol
.Set( GetRValue(vRef
)
108 case wxSYS_COLOUR_MENUTEXT
:
109 vRef
= (ULONG
)::WinQuerySysColor( HWND_DESKTOP
113 vCol
.Set( GetRValue(vRef
)
119 case wxSYS_COLOUR_BTNFACE
:
120 vRef
= (ULONG
)::WinQuerySysColor( HWND_DESKTOP
121 ,SYSCLR_BUTTONDEFAULT
124 vCol
.Set( GetRValue(vRef
)
130 case wxSYS_COLOUR_BTNSHADOW
:
131 vRef
= (ULONG
)::WinQuerySysColor( HWND_DESKTOP
135 vCol
.Set( GetRValue(vRef
)
141 case wxSYS_COLOUR_BTNHIGHLIGHT
:
142 vRef
= (ULONG
)::WinQuerySysColor( HWND_DESKTOP
146 vCol
.Set( GetRValue(vRef
)
153 // We'll have to just give values to these
155 case wxSYS_COLOUR_LISTBOX
:
156 case wxSYS_COLOUR_CAPTIONTEXT
:
160 case wxSYS_COLOUR_WINDOWTEXT
:
161 case wxSYS_COLOUR_INACTIVECAPTIONTEXT
:
162 case wxSYS_COLOUR_BTNTEXT
:
163 case wxSYS_COLOUR_INFOTEXT
:
168 // We should customize these to look like other ports
171 case wxSYS_COLOUR_ACTIVECAPTION
:
172 case wxSYS_COLOUR_ACTIVEBORDER
:
173 case wxSYS_COLOUR_HIGHLIGHT
:
177 case wxSYS_COLOUR_SCROLLBAR
:
178 case wxSYS_COLOUR_BACKGROUND
:
179 case wxSYS_COLOUR_INACTIVECAPTION
:
180 case wxSYS_COLOUR_MENU
:
181 case wxSYS_COLOUR_INACTIVEBORDER
:
182 case wxSYS_COLOUR_APPWORKSPACE
:
183 case wxSYS_COLOUR_HIGHLIGHTTEXT
:
184 case wxSYS_COLOUR_GRAYTEXT
:
185 case wxSYS_COLOUR_3DDKSHADOW
:
186 case wxSYS_COLOUR_3DLIGHT
:
187 case wxSYS_COLOUR_INFOBK
:
188 vCol
= (*wxLIGHT_GREY
);
192 vRef
= (ULONG
)::WinQuerySysColor( HWND_DESKTOP
196 vCol
.Set( GetRValue(vRef
)
203 } // end of wxSystemSettingsNative::GetColour
205 wxFont
wxSystemSettingsNative::GetFont(
212 case wxSYS_DEVICE_DEFAULT_FONT
:
216 case wxSYS_DEFAULT_PALETTE
:
220 case wxSYS_SYSTEM_FIXED_FONT
:
224 case wxSYS_SYSTEM_FONT
:
229 case wxSYS_DEFAULT_GUI_FONT
:
235 return *wxSWISS_FONT
;
240 // Get a system metric, e.g. scrollbar size
241 int wxSystemSettingsNative::GetMetric(
247 case wxSYS_MOUSE_BUTTONS
:
280 case wxSYS_HSCROLL_ARROW_X
:
283 case wxSYS_HSCROLL_ARROW_Y
:
295 case wxSYS_ICONSPACING_X
:
298 case wxSYS_ICONSPACING_Y
:
301 case wxSYS_WINDOWMIN_X
:
304 case wxSYS_WINDOWMIN_Y
:
313 case wxSYS_FRAMESIZE_X
:
316 case wxSYS_FRAMESIZE_Y
:
319 case wxSYS_SMALLICON_X
:
322 case wxSYS_SMALLICON_Y
:
325 case wxSYS_HSCROLL_Y
:
328 case wxSYS_VSCROLL_X
:
331 case wxSYS_VSCROLL_ARROW_X
:
334 case wxSYS_VSCROLL_ARROW_Y
:
340 case wxSYS_CAPTION_Y
:
346 case wxSYS_NETWORK_PRESENT
:
349 case wxSYS_PENWINDOWS_PRESENT
:
352 case wxSYS_SHOW_SOUNDS
:
355 case wxSYS_SWAP_BUTTONS
:
364 bool wxSystemSettingsNative::HasFeature(
365 wxSystemFeature index
370 case wxSYS_CAN_ICONIZE_FRAME
:
373 case wxSYS_CAN_DRAW_FRAME_DECORATIONS
: