1 /////////////////////////////////////////////////////////////////////////////
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "settings.h"
16 #include "wx/settings.h"
17 #include "wx/gdicmn.h"
20 #include "wx/mac/uma.h"
22 // ----------------------------------------------------------------------------
23 // wxSystemSettingsNative
24 // ----------------------------------------------------------------------------
26 // ----------------------------------------------------------------------------
28 // ----------------------------------------------------------------------------
30 wxColour
wxSystemSettingsNative::GetColour(wxSystemColour index
)
33 wxGetOsVersion( &major
, &minor
);
37 case wxSYS_COLOUR_SCROLLBAR
:
38 case wxSYS_COLOUR_BACKGROUND
:
39 case wxSYS_COLOUR_ACTIVECAPTION
:
40 case wxSYS_COLOUR_INACTIVECAPTION
:
41 case wxSYS_COLOUR_MENU
:
42 case wxSYS_COLOUR_WINDOW
:
43 case wxSYS_COLOUR_WINDOWFRAME
:
44 case wxSYS_COLOUR_ACTIVEBORDER
:
45 case wxSYS_COLOUR_INACTIVEBORDER
:
46 case wxSYS_COLOUR_BTNFACE
:
47 case wxSYS_COLOUR_MENUBAR
:
48 return wxColor( 0xDD , 0xDD , 0xDD ) ;
51 case wxSYS_COLOUR_LISTBOX
:
56 return wxColor( 0xEE , 0xEE , 0xEE ) ;
59 case wxSYS_COLOUR_BTNSHADOW
:
60 return wxColor( 0x44 , 0x44 , 0x44 ) ;
63 case wxSYS_COLOUR_BTNTEXT
:
64 case wxSYS_COLOUR_MENUTEXT
:
65 case wxSYS_COLOUR_WINDOWTEXT
:
66 case wxSYS_COLOUR_CAPTIONTEXT
:
67 case wxSYS_COLOUR_INFOTEXT
:
68 case wxSYS_COLOUR_INACTIVECAPTIONTEXT
:
71 case wxSYS_COLOUR_HIGHLIGHT
:
74 LMGetHiliteRGB(&hilite
) ;
75 return wxColor( hilite
.red
>> 8 , hilite
.green
>> 8 , hilite
.blue
>> 8 ) ;
78 case wxSYS_COLOUR_BTNHIGHLIGHT
:
79 case wxSYS_COLOUR_GRAYTEXT
:
80 return wxColor( 0xCC , 0xCC , 0xCC ) ;
83 case wxSYS_COLOUR_3DDKSHADOW
:
84 return wxColor( 0x44 , 0x44 , 0x44 ) ;
86 case wxSYS_COLOUR_3DLIGHT
:
87 return wxColor( 0xCC , 0xCC , 0xCC ) ;
89 case wxSYS_COLOUR_HIGHLIGHTTEXT
:
92 LMGetHiliteRGB(&hilite
) ;
93 if ( ( hilite
.red
+ hilite
.green
+ hilite
.blue
) == 0 )
99 case wxSYS_COLOUR_INFOBK
:
100 case wxSYS_COLOUR_APPWORKSPACE
:
104 case wxSYS_COLOUR_HOTLIGHT
:
105 case wxSYS_COLOUR_GRADIENTACTIVECAPTION
:
106 case wxSYS_COLOUR_GRADIENTINACTIVECAPTION
:
107 case wxSYS_COLOUR_MENUHILIGHT
:
111 case wxSYS_COLOUR_MAX
:
112 wxFAIL_MSG( _T("unknown system colour index") );
118 // ----------------------------------------------------------------------------
120 // ----------------------------------------------------------------------------
122 wxFont
wxSystemSettingsNative::GetFont(wxSystemFont index
)
126 case wxSYS_ANSI_VAR_FONT
:
127 case wxSYS_SYSTEM_FONT
:
128 case wxSYS_DEVICE_DEFAULT_FONT
:
129 case wxSYS_DEFAULT_GUI_FONT
:
131 return *wxSMALL_FONT
;
134 case wxSYS_OEM_FIXED_FONT
:
135 case wxSYS_ANSI_FIXED_FONT
:
136 case wxSYS_SYSTEM_FIXED_FONT
:
139 return *wxNORMAL_FONT
;
144 return *wxNORMAL_FONT
;
147 // ----------------------------------------------------------------------------
148 // system metrics/features
149 // ----------------------------------------------------------------------------
151 // Get a system metric, e.g. scrollbar size
152 int wxSystemSettingsNative::GetMetric(wxSystemMetric index
)
156 case wxSYS_MOUSE_BUTTONS
:
157 return 2; // we emulate a two button mouse (ctrl + click = right button )
188 case wxSYS_HSCROLL_ARROW_X
:
190 case wxSYS_HSCROLL_ARROW_Y
:
200 case wxSYS_ICONSPACING_X
:
203 case wxSYS_ICONSPACING_Y
:
206 case wxSYS_WINDOWMIN_X
:
209 case wxSYS_WINDOWMIN_Y
:
218 case wxSYS_FRAMESIZE_X
:
221 case wxSYS_FRAMESIZE_Y
:
224 case wxSYS_SMALLICON_X
:
227 case wxSYS_SMALLICON_Y
:
230 case wxSYS_HSCROLL_Y
:
232 case wxSYS_VSCROLL_X
:
234 case wxSYS_VSCROLL_ARROW_X
:
236 case wxSYS_VSCROLL_ARROW_Y
:
240 case wxSYS_CAPTION_Y
:
246 case wxSYS_NETWORK_PRESENT
:
249 case wxSYS_PENWINDOWS_PRESENT
:
251 case wxSYS_SHOW_SOUNDS
:
254 case wxSYS_SWAP_BUTTONS
:
262 bool wxSystemSettingsNative::HasFeature(wxSystemFeature index
)
266 case wxSYS_CAN_ICONIZE_FRAME
:
267 case wxSYS_CAN_DRAW_FRAME_DECORATIONS
: