1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
12 #pragma implementation "settings.h"
15 #include "wx/settings.h"
22 #define wxSYS_COLOUR_SCROLLBAR 0
23 #define wxSYS_COLOUR_BACKGROUND 1
24 #define wxSYS_COLOUR_ACTIVECAPTION 2
25 #define wxSYS_COLOUR_INACTIVECAPTION 3
26 #define wxSYS_COLOUR_MENU 4
27 #define wxSYS_COLOUR_WINDOW 5
28 #define wxSYS_COLOUR_WINDOWFRAME 6
29 #define wxSYS_COLOUR_MENUTEXT 7
30 #define wxSYS_COLOUR_WINDOWTEXT 8
31 #define wxSYS_COLOUR_CAPTIONTEXT 9
32 #define wxSYS_COLOUR_ACTIVEBORDER 10
33 #define wxSYS_COLOUR_INACTIVEBORDER 11
34 #define wxSYS_COLOUR_APPWORKSPACE 12
35 #define wxSYS_COLOUR_HIGHLIGHT 13
36 #define wxSYS_COLOUR_HIGHLIGHTTEXT 14
37 #define wxSYS_COLOUR_BTNFACE 15
38 #define wxSYS_COLOUR_BTNSHADOW 16
39 #define wxSYS_COLOUR_GRAYTEXT 17
40 #define wxSYS_COLOUR_BTNTEXT 18
41 #define wxSYS_COLOUR_INACTIVECAPTIONTEXT 19
42 #define wxSYS_COLOUR_BTNHIGHLIGHT 20
44 #define wxSYS_COLOUR_3DDKSHADOW 21
45 #define wxSYS_COLOUR_3DLIGHT 22
46 #define wxSYS_COLOUR_INFOTEXT 23
47 #define wxSYS_COLOUR_INFOBK 24
49 #define wxSYS_COLOUR_DESKTOP wxSYS_COLOUR_BACKGROUND
50 #define wxSYS_COLOUR_3DFACE wxSYS_COLOUR_BTNFACE
51 #define wxSYS_COLOUR_3DSHADOW wxSYS_COLOUR_BTNSHADOW
52 #define wxSYS_COLOUR_3DHIGHLIGHT wxSYS_COLOUR_BTNHIGHLIGHT
53 #define wxSYS_COLOUR_3DHILIGHT wxSYS_COLOUR_BTNHIGHLIGHT
54 #define wxSYS_COLOUR_BTNHILIGHT wxSYS_COLOUR_BTNHIGHLIGHT
57 #define SHIFT (8*(sizeof(short int)-sizeof(char)))
59 //wxColour *g_systemWinColour = (wxColour *) NULL;
60 wxColour
*g_systemBtnFaceColour
= (wxColour
*) NULL
;
61 wxColour
*g_systemBtnShadowColour
= (wxColour
*) NULL
;
62 wxColour
*g_systemBtnHighlightColour
= (wxColour
*) NULL
;
63 wxColour
*g_systemHighlightColour
= (wxColour
*) NULL
;
65 wxFont
*g_systemFont
= (wxFont
*) NULL
;
67 void wxSystemSettings::Done()
69 // delete g_systemWinColour;
70 delete g_systemBtnFaceColour
;
71 delete g_systemBtnShadowColour
;
72 delete g_systemBtnHighlightColour
;
73 delete g_systemHighlightColour
;
77 wxColour
wxSystemSettings::GetSystemColour( int index
)
81 case wxSYS_COLOUR_SCROLLBAR
:
82 case wxSYS_COLOUR_BACKGROUND
:
83 case wxSYS_COLOUR_ACTIVECAPTION
:
84 case wxSYS_COLOUR_INACTIVECAPTION
:
85 case wxSYS_COLOUR_MENU
:
86 case wxSYS_COLOUR_WINDOWFRAME
:
87 case wxSYS_COLOUR_ACTIVEBORDER
:
88 case wxSYS_COLOUR_INACTIVEBORDER
:
89 case wxSYS_COLOUR_BTNFACE
:
91 if (!g_systemBtnFaceColour
)
93 g_systemBtnFaceColour
=
94 new wxColour( 0xd6d6 >> SHIFT
,
98 return *g_systemBtnFaceColour
;
100 case wxSYS_COLOUR_WINDOW
:
104 case wxSYS_COLOUR_GRAYTEXT
:
105 case wxSYS_COLOUR_BTNSHADOW
:
107 if (!g_systemBtnShadowColour
)
109 g_systemBtnShadowColour
=
110 new wxColour( 0x7530 >> SHIFT
,
114 return *g_systemBtnShadowColour
;
116 case wxSYS_COLOUR_BTNHIGHLIGHT
:
118 if (!g_systemBtnHighlightColour
)
120 g_systemBtnHighlightColour
=
121 new wxColour( 0xea60 >> SHIFT
,
125 return *g_systemBtnHighlightColour
;
127 case wxSYS_COLOUR_HIGHLIGHT
:
129 if (!g_systemHighlightColour
)
131 g_systemHighlightColour
=
132 new wxColour( 0 >> SHIFT
,
136 return *g_systemHighlightColour
;
138 case wxSYS_COLOUR_MENUTEXT
:
139 case wxSYS_COLOUR_WINDOWTEXT
:
140 case wxSYS_COLOUR_CAPTIONTEXT
:
141 case wxSYS_COLOUR_INACTIVECAPTIONTEXT
:
142 case wxSYS_COLOUR_BTNTEXT
:
143 case wxSYS_COLOUR_INFOTEXT
:
147 case wxSYS_COLOUR_HIGHLIGHTTEXT
:
151 case wxSYS_COLOUR_INFOBK
:
152 case wxSYS_COLOUR_APPWORKSPACE
:
154 return *wxWHITE
; // ?
160 wxFont
wxSystemSettings::GetSystemFont( int index
)
164 case wxSYS_OEM_FIXED_FONT
:
165 case wxSYS_ANSI_FIXED_FONT
:
166 case wxSYS_SYSTEM_FIXED_FONT
:
168 return *wxNORMAL_FONT
;
170 case wxSYS_ANSI_VAR_FONT
:
171 case wxSYS_SYSTEM_FONT
:
172 case wxSYS_DEVICE_DEFAULT_FONT
:
173 case wxSYS_DEFAULT_GUI_FONT
:
176 g_systemFont
= new wxFont( 12, wxSWISS
, wxNORMAL
, wxNORMAL
);
177 return *g_systemFont
;
184 int wxSystemSettings::GetSystemMetric( int index
)
188 case wxSYS_SCREEN_X
: return gdk_screen_width();
189 case wxSYS_SCREEN_Y
: return gdk_screen_height();
190 case wxSYS_HSCROLL_Y
: return 15;
191 case wxSYS_VSCROLL_X
: return 15;
194 wxCHECK_MSG( index
, 0, wxT("wxSystemSettings::GetSystemMetric not fully implemented") );