]>
Commit | Line | Data |
---|---|---|
32b8ec41 | 1 | ///////////////////////////////////////////////////////////////////////////// |
127eab18 | 2 | // Name: src/mgl/settings.cpp |
5acaf196 | 3 | // Author: Vaclav Slavik, Robert Roebling |
32b8ec41 | 4 | // Id: $Id$ |
c41c20a5 | 5 | // Copyright: (c) 2001-2002 SciTech Software, Inc. (www.scitechsoft.com) |
127eab18 | 6 | // Licence: wxWindows licence |
32b8ec41 VZ |
7 | ///////////////////////////////////////////////////////////////////////////// |
8 | ||
a246f95e VS |
9 | // For compilers that support precompilation, includes "wx.h". |
10 | #include "wx/wxprec.h" | |
11 | ||
12 | #ifdef __BORLANDC__ | |
13 | #pragma hdrstop | |
14 | #endif | |
15 | ||
32b8ec41 | 16 | #include "wx/settings.h" |
7cf41a5d WS |
17 | |
18 | #ifndef WX_PRECOMP | |
19 | #include "wx/colour.h" | |
48a1108e | 20 | #include "wx/font.h" |
dd05139a | 21 | #include "wx/gdicmn.h" |
7cf41a5d WS |
22 | #endif |
23 | ||
8fbdfa4f VS |
24 | #include "wx/module.h" |
25 | ||
26 | // ---------------------------------------------------------------------------- | |
27 | // global data | |
28 | // ---------------------------------------------------------------------------- | |
29 | ||
30 | static wxFont *gs_fontDefault = NULL; | |
31 | ||
32 | class wxSystemSettingsModule : public wxModule | |
33 | { | |
34 | public: | |
127eab18 | 35 | virtual bool OnInit() { return true; } |
8fbdfa4f VS |
36 | virtual void OnExit() |
37 | { | |
38 | delete gs_fontDefault; | |
39 | gs_fontDefault = NULL; | |
40 | } | |
41 | ||
42 | private: | |
43 | DECLARE_DYNAMIC_CLASS(wxSystemSettingsModule) | |
44 | }; | |
45 | ||
46 | IMPLEMENT_DYNAMIC_CLASS(wxSystemSettingsModule, wxModule) | |
47 | ||
48 | ||
32b8ec41 | 49 | |
0ab5e0e8 | 50 | wxColour wxSystemSettingsNative::GetColour(wxSystemColour WXUNUSED(index)) |
7bdc1879 | 51 | { |
0ab5e0e8 | 52 | // not implemented, the mean is in wxUniversal |
ef344ff8 | 53 | return wxColour(0,0,0); |
7bdc1879 VS |
54 | } |
55 | ||
0ab5e0e8 | 56 | wxFont wxSystemSettingsNative::GetFont(wxSystemFont index) |
7bdc1879 | 57 | { |
5acaf196 | 58 | switch (index) |
8fbdfa4f | 59 | { |
5acaf196 VS |
60 | case wxSYS_OEM_FIXED_FONT: |
61 | case wxSYS_ANSI_FIXED_FONT: | |
62 | case wxSYS_SYSTEM_FIXED_FONT: | |
63 | { | |
64 | return *wxNORMAL_FONT; | |
65 | } | |
66 | case wxSYS_ANSI_VAR_FONT: | |
67 | case wxSYS_SYSTEM_FONT: | |
68 | case wxSYS_DEVICE_DEFAULT_FONT: | |
69 | case wxSYS_DEFAULT_GUI_FONT: | |
70 | { | |
71 | if ( !gs_fontDefault ) | |
127eab18 | 72 | gs_fontDefault = new wxFont(10, wxSWISS, wxNORMAL, wxNORMAL, false, "Arial"); |
5acaf196 VS |
73 | return *gs_fontDefault; |
74 | } | |
78f93365 WS |
75 | default: |
76 | { | |
77 | } | |
8fbdfa4f | 78 | } |
127eab18 WS |
79 | |
80 | return wxNullFont; | |
7bdc1879 VS |
81 | } |
82 | ||
9b0b5ba7 | 83 | int wxSystemSettingsNative::GetMetric(wxSystemMetric index, wxWindow* WXUNUSED(win)) |
7bdc1879 | 84 | { |
5acaf196 | 85 | int val; |
127eab18 | 86 | |
5acaf196 VS |
87 | switch (index) |
88 | { | |
89 | case wxSYS_SCREEN_X: | |
90 | wxDisplaySize(&val, NULL); | |
91 | return val; | |
92 | case wxSYS_SCREEN_Y: | |
93 | wxDisplaySize(NULL, &val); | |
94 | return val; | |
95 | case wxSYS_VSCROLL_X: | |
96 | case wxSYS_HSCROLL_Y: | |
127eab18 | 97 | return 15; |
78f93365 WS |
98 | default: |
99 | { | |
100 | } | |
5acaf196 | 101 | } |
127eab18 WS |
102 | |
103 | return -1; // unsupported metric | |
7bdc1879 | 104 | } |
253293c1 | 105 | |
0ab5e0e8 | 106 | bool wxSystemSettingsNative::HasFeature(wxSystemFeature index) |
253293c1 VS |
107 | { |
108 | switch (index) | |
109 | { | |
127eab18 | 110 | case wxSYS_CAN_ICONIZE_FRAME: |
253293c1 | 111 | case wxSYS_CAN_DRAW_FRAME_DECORATIONS: |
b626fee2 | 112 | case wxSYS_TABLET_PRESENT: |
127eab18 | 113 | return false; |
b626fee2 | 114 | |
78f93365 | 115 | default: |
b626fee2 | 116 | wxFAIL_MSG( _T("unknown feature") ); |
253293c1 | 117 | } |
127eab18 WS |
118 | |
119 | return false; | |
253293c1 | 120 | } |