]> git.saurik.com Git - wxWidgets.git/blame - src/mac/carbon/settings.cpp
MacOS 9 seems to clear the background itself, too.
[wxWidgets.git] / src / mac / carbon / settings.cpp
CommitLineData
e9576ca5
SC
1/////////////////////////////////////////////////////////////////////////////
2// Name: settings.cpp
3// Purpose: wxSettings
4// Author: AUTHOR
5// Modified by:
6// Created: ??/??/98
7// RCS-ID: $Id$
8// Copyright: (c) AUTHOR
00500f40 9// Licence: wxWindows licence
e9576ca5
SC
10/////////////////////////////////////////////////////////////////////////////
11
12#ifdef __GNUG__
13#pragma implementation "settings.h"
14#endif
15
16#include "wx/settings.h"
03e11df5 17#include "wx/gdicmn.h"
00500f40 18#include "wx/utils.h"
e9576ca5
SC
19
20wxColour wxSystemSettings::GetSystemColour(int index)
21{
00500f40
RR
22 int major,minor;
23 wxGetOsVersion( &major, &minor );
24
25 switch( index )
26 {
27 case wxSYS_COLOUR_SCROLLBAR :
28 case wxSYS_COLOUR_BACKGROUND:
29 case wxSYS_COLOUR_ACTIVECAPTION:
30 case wxSYS_COLOUR_INACTIVECAPTION:
31 case wxSYS_COLOUR_MENU:
32 case wxSYS_COLOUR_WINDOW:
33 case wxSYS_COLOUR_WINDOWFRAME:
34 case wxSYS_COLOUR_ACTIVEBORDER:
35 case wxSYS_COLOUR_INACTIVEBORDER:
36 case wxSYS_COLOUR_BTNFACE:
37 return wxColor( 0xDD , 0xDD , 0xDD ) ;
38 break ;
519cb848 39
00500f40
RR
40 case wxSYS_COLOUR_LISTBOX :
41 {
42 if (major >= 10)
43 return *wxWHITE ;
44 else
45 return wxColor( 0xEE , 0xEE , 0xEE ) ;
46 break ;
47 }
48 case wxSYS_COLOUR_BTNSHADOW:
49 return wxColor( 0x44 , 0x44 , 0x44 ) ;
50 break ;
519cb848 51
00500f40
RR
52 case wxSYS_COLOUR_BTNTEXT:
53 case wxSYS_COLOUR_MENUTEXT:
54 case wxSYS_COLOUR_WINDOWTEXT:
55 case wxSYS_COLOUR_CAPTIONTEXT:
56 case wxSYS_COLOUR_INFOTEXT:
57 case wxSYS_COLOUR_INACTIVECAPTIONTEXT:
58 return *wxBLACK;
59 break ;
60 case wxSYS_COLOUR_HIGHLIGHT:
61 {
62 RGBColor hilite ;
63 LMGetHiliteRGB(&hilite) ;
64 return wxColor( hilite.red >> 8 , hilite.green >> 8 , hilite.blue >> 8 ) ;
65 }
66 break ;
67 case wxSYS_COLOUR_BTNHIGHLIGHT:
68 case wxSYS_COLOUR_GRAYTEXT:
69 return wxColor( 0xCC , 0xCC , 0xCC ) ;
70 break ;
71
72 case wxSYS_COLOUR_3DDKSHADOW:
73 return wxColor( 0x44 , 0x44 , 0x44 ) ;
74 break ;
75 case wxSYS_COLOUR_3DLIGHT:
76 return wxColor( 0xCC , 0xCC , 0xCC ) ;
77 break ;
78 case wxSYS_COLOUR_HIGHLIGHTTEXT :
79 {
80 RGBColor hilite ;
81 LMGetHiliteRGB(&hilite) ;
82 if ( ( hilite.red + hilite.green + hilite.blue ) == 0 )
83 return *wxWHITE ;
84 else
85 return *wxBLACK ;
86 }
87 break ;
88 case wxSYS_COLOUR_INFOBK :
89 case wxSYS_COLOUR_APPWORKSPACE:
90 return *wxWHITE ;
91 break ;
92 }
93 return *wxWHITE;
e9576ca5
SC
94}
95
96wxFont wxSystemSettings::GetSystemFont(int index)
97{
e9576ca5
SC
98 switch (index)
99 {
519cb848
SC
100 case wxSYS_ANSI_VAR_FONT :
101 case wxSYS_SYSTEM_FONT :
102 case wxSYS_DEVICE_DEFAULT_FONT :
103 case wxSYS_DEFAULT_GUI_FONT :
00500f40
RR
104 {
105 return *wxSMALL_FONT ;
106 } ;
107 break ;
519cb848
SC
108 case wxSYS_OEM_FIXED_FONT :
109 case wxSYS_ANSI_FIXED_FONT :
110 case wxSYS_SYSTEM_FIXED_FONT :
111 default :
00500f40
RR
112 {
113 return *wxNORMAL_FONT ;
114 } ;
115 break ;
116
e9576ca5 117 }
519cb848 118 return *wxNORMAL_FONT;
e9576ca5
SC
119}
120
121// Get a system metric, e.g. scrollbar size
122int wxSystemSettings::GetSystemMetric(int index)
123{
00500f40
RR
124 switch ( index)
125 {
e9576ca5 126 case wxSYS_MOUSE_BUTTONS:
00500f40 127 return 2; // we emulate a two button mouse (ctrl + click = right button )
e9576ca5
SC
128 case wxSYS_BORDER_X:
129 // TODO
00500f40 130 return 0;
e9576ca5
SC
131 case wxSYS_BORDER_Y:
132 // TODO
00500f40 133 return 0;
e9576ca5
SC
134 case wxSYS_CURSOR_X:
135 // TODO
00500f40 136 return 0;
e9576ca5
SC
137 case wxSYS_CURSOR_Y:
138 // TODO
00500f40 139 return 0;
e9576ca5
SC
140 case wxSYS_DCLICK_X:
141 // TODO
00500f40 142 return 0;
e9576ca5
SC
143 case wxSYS_DCLICK_Y:
144 // TODO
00500f40 145 return 0;
e9576ca5
SC
146 case wxSYS_DRAG_X:
147 // TODO
00500f40 148 return 0;
e9576ca5
SC
149 case wxSYS_DRAG_Y:
150 // TODO
00500f40 151 return 0;
e9576ca5
SC
152 case wxSYS_EDGE_X:
153 // TODO
00500f40 154 return 0;
e9576ca5
SC
155 case wxSYS_EDGE_Y:
156 // TODO
00500f40 157 return 0;
e9576ca5 158 case wxSYS_HSCROLL_ARROW_X:
00500f40 159 return 16;
e9576ca5 160 case wxSYS_HSCROLL_ARROW_Y:
00500f40 161 return 16;
e9576ca5 162 case wxSYS_HTHUMB_X:
00500f40 163 return 16;
e9576ca5
SC
164 case wxSYS_ICON_X:
165 // TODO
00500f40 166 return 0;
e9576ca5
SC
167 case wxSYS_ICON_Y:
168 // TODO
00500f40 169 return 0;
e9576ca5
SC
170 case wxSYS_ICONSPACING_X:
171 // TODO
00500f40 172 return 0;
e9576ca5
SC
173 case wxSYS_ICONSPACING_Y:
174 // TODO
00500f40 175 return 0;
e9576ca5
SC
176 case wxSYS_WINDOWMIN_X:
177 // TODO
00500f40 178 return 0;
e9576ca5
SC
179 case wxSYS_WINDOWMIN_Y:
180 // TODO
00500f40 181 return 0;
e9576ca5
SC
182 case wxSYS_SCREEN_X:
183 // TODO
00500f40 184 return 0;
e9576ca5
SC
185 case wxSYS_SCREEN_Y:
186 // TODO
00500f40 187 return 0;
e9576ca5
SC
188 case wxSYS_FRAMESIZE_X:
189 // TODO
00500f40 190 return 0;
e9576ca5
SC
191 case wxSYS_FRAMESIZE_Y:
192 // TODO
00500f40 193 return 0;
e9576ca5
SC
194 case wxSYS_SMALLICON_X:
195 // TODO
00500f40 196 return 0;
e9576ca5
SC
197 case wxSYS_SMALLICON_Y:
198 // TODO
00500f40 199 return 0;
e9576ca5 200 case wxSYS_HSCROLL_Y:
00500f40 201 return 16;
e9576ca5 202 case wxSYS_VSCROLL_X:
00500f40 203 return 16;
e9576ca5 204 case wxSYS_VSCROLL_ARROW_X:
00500f40 205 return 16;
e9576ca5 206 case wxSYS_VSCROLL_ARROW_Y:
00500f40 207 return 16;
e9576ca5 208 case wxSYS_VTHUMB_Y:
00500f40 209 return 16;
e9576ca5
SC
210 case wxSYS_CAPTION_Y:
211 // TODO
00500f40 212 return 0;
e9576ca5
SC
213 case wxSYS_MENU_Y:
214 // TODO
00500f40 215 return 0;
e9576ca5
SC
216 case wxSYS_NETWORK_PRESENT:
217 // TODO
00500f40 218 return 0;
e9576ca5 219 case wxSYS_PENWINDOWS_PRESENT:
00500f40 220 return 0;
e9576ca5
SC
221 case wxSYS_SHOW_SOUNDS:
222 // TODO
00500f40 223 return 0;
e9576ca5 224 case wxSYS_SWAP_BUTTONS:
00500f40
RR
225 return 0;
226 default:
227 return 0;
228 }
229 return 0;
e9576ca5
SC
230}
231
253293c1
VS
232bool wxSystemSettings::GetCapability(int index)
233{
234 switch (index)
235 {
236 case wxSYS_CAN_ICONIZE_FRAME:
237 case wxSYS_CAN_DRAW_FRAME_DECORATIONS:
238 return TRUE; break;
239 default:
240 return FALSE;
241 }
242}