1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #include "wx/wxprec.h"
14 #include "wx/settings.h"
15 #include "wx/gdicmn.h"
18 #include "wx/mac/uma.h"
20 // ----------------------------------------------------------------------------
21 // wxSystemSettingsNative
22 // ----------------------------------------------------------------------------
24 // ----------------------------------------------------------------------------
26 // ----------------------------------------------------------------------------
28 wxColour
wxSystemSettingsNative::GetColour(wxSystemColour index
)
33 ThemeBrush colorBrushID
;
35 wxGetOsVersion( &major
, &minor
);
39 case wxSYS_COLOUR_SCROLLBAR
:
40 case wxSYS_COLOUR_BACKGROUND
:
41 case wxSYS_COLOUR_ACTIVECAPTION
:
42 case wxSYS_COLOUR_INACTIVECAPTION
:
43 case wxSYS_COLOUR_MENU
:
44 case wxSYS_COLOUR_WINDOW
:
45 case wxSYS_COLOUR_WINDOWFRAME
:
46 case wxSYS_COLOUR_ACTIVEBORDER
:
47 case wxSYS_COLOUR_INACTIVEBORDER
:
48 case wxSYS_COLOUR_BTNFACE
:
49 case wxSYS_COLOUR_MENUBAR
:
50 resultColor
= wxColor( 0xDD, 0xDD, 0xDD );
53 case wxSYS_COLOUR_LISTBOX
:
55 resultColor
= *wxWHITE
;
57 resultColor
= wxColor( 0xEE, 0xEE, 0xEE );
60 case wxSYS_COLOUR_BTNSHADOW
:
62 resultColor
= wxColor( 0xBE, 0xBE, 0xBE );
64 resultColor
= wxColor( 0x44, 0x44, 0x44 );
67 case wxSYS_COLOUR_BTNTEXT
:
68 case wxSYS_COLOUR_MENUTEXT
:
69 case wxSYS_COLOUR_WINDOWTEXT
:
70 case wxSYS_COLOUR_CAPTIONTEXT
:
71 case wxSYS_COLOUR_INFOTEXT
:
72 case wxSYS_COLOUR_INACTIVECAPTIONTEXT
:
73 resultColor
= *wxBLACK
;
76 case wxSYS_COLOUR_HIGHLIGHT
:
78 #if 0 && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3)
79 // NB: enable this case as desired
80 colorBrushID
= kThemeBrushAlternatePrimaryHighlightColor
;
82 colorBrushID
= kThemeBrushPrimaryHighlightColor
;
85 GetThemeBrushAsColor( colorBrushID
, 32, true, &macRGB
);
86 resultColor
= wxColor( macRGB
.red
>> 8, macRGB
.green
>> 8, macRGB
.blue
>> 8 );
89 case wxSYS_COLOUR_BTNHIGHLIGHT
:
90 case wxSYS_COLOUR_GRAYTEXT
:
91 resultColor
= wxColor( 0xCC, 0xCC, 0xCC );
94 case wxSYS_COLOUR_3DDKSHADOW
:
95 resultColor
= wxColor( 0x44, 0x44, 0x44 );
98 case wxSYS_COLOUR_3DLIGHT
:
99 resultColor
= wxColor( 0xCC, 0xCC, 0xCC );
102 case wxSYS_COLOUR_HIGHLIGHTTEXT
:
103 #if 0 && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3)
104 // NB: enable this case as desired
105 resultColor
= *wxWHITE
;
107 GetThemeBrushAsColor( kThemeBrushPrimaryHighlightColor
, 32, true, &macRGB
);
108 if ((macRGB
.red
+ macRGB
.green
+ macRGB
.blue
) == 0)
109 resultColor
= *wxWHITE
;
111 resultColor
= *wxBLACK
;
115 case wxSYS_COLOUR_INFOBK
:
116 case wxSYS_COLOUR_APPWORKSPACE
:
117 resultColor
= *wxWHITE
;
120 case wxSYS_COLOUR_HOTLIGHT
:
121 case wxSYS_COLOUR_GRADIENTACTIVECAPTION
:
122 case wxSYS_COLOUR_GRADIENTINACTIVECAPTION
:
123 case wxSYS_COLOUR_MENUHILIGHT
:
125 resultColor
= *wxBLACK
;
128 // case wxSYS_COLOUR_MAX:
130 resultColor
= *wxWHITE
;
131 // wxCHECK_MSG( index >= wxSYS_COLOUR_MAX, false, _T("unknown system colour index") );
138 // ----------------------------------------------------------------------------
140 // ----------------------------------------------------------------------------
142 wxFont
wxSystemSettingsNative::GetFont(wxSystemFont index
)
146 case wxSYS_ANSI_VAR_FONT
:
147 case wxSYS_SYSTEM_FONT
:
148 case wxSYS_DEVICE_DEFAULT_FONT
:
149 case wxSYS_DEFAULT_GUI_FONT
:
150 return *wxSMALL_FONT
;
157 return *wxNORMAL_FONT
;
160 // ----------------------------------------------------------------------------
161 // system metrics/features
162 // ----------------------------------------------------------------------------
164 // Get a system metric, e.g. scrollbar size
165 int wxSystemSettingsNative::GetMetric(wxSystemMetric index
, wxWindow
* WXUNUSED(win
))
171 case wxSYS_MOUSE_BUTTONS
:
172 // we emulate a two button mouse (ctrl + click = right button)
175 // TODO case wxSYS_BORDER_X:
176 // TODO case wxSYS_BORDER_Y:
177 // TODO case wxSYS_CURSOR_X:
178 // TODO case wxSYS_CURSOR_Y:
179 // TODO case wxSYS_DCLICK_X:
180 // TODO case wxSYS_DCLICK_Y:
181 // TODO case wxSYS_DRAG_X:
182 // TODO case wxSYS_DRAG_Y:
183 // TODO case wxSYS_EDGE_X:
184 // TODO case wxSYS_EDGE_Y:
186 case wxSYS_HSCROLL_ARROW_X
:
187 case wxSYS_HSCROLL_ARROW_Y
:
191 // TODO case wxSYS_ICON_X:
192 // TODO case wxSYS_ICON_Y:
193 // TODO case wxSYS_ICONSPACING_X:
194 // TODO case wxSYS_ICONSPACING_Y:
195 // TODO case wxSYS_WINDOWMIN_X:
196 // TODO case wxSYS_WINDOWMIN_Y:
199 wxDisplaySize( &value
, NULL
);
203 wxDisplaySize( NULL
, &value
);
206 // TODO case wxSYS_FRAMESIZE_X:
207 // TODO case wxSYS_FRAMESIZE_Y:
208 // TODO case wxSYS_SMALLICON_X:
209 // TODO case wxSYS_SMALLICON_Y:
211 case wxSYS_HSCROLL_Y
:
212 case wxSYS_VSCROLL_X
:
213 case wxSYS_VSCROLL_ARROW_X
:
214 case wxSYS_VSCROLL_ARROW_Y
:
218 case wxSYS_PENWINDOWS_PRESENT
:
221 case wxSYS_SWAP_BUTTONS
:
224 // TODO: case wxSYS_CAPTION_Y:
225 // TODO: case wxSYS_MENU_Y:
226 // TODO: case wxSYS_NETWORK_PRESENT:
227 // TODO: case wxSYS_SHOW_SOUNDS:
230 // unsupported metric
237 bool wxSystemSettingsNative::HasFeature(wxSystemFeature index
)
241 case wxSYS_CAN_ICONIZE_FRAME
:
242 case wxSYS_CAN_DRAW_FRAME_DECORATIONS
: