]>
Commit | Line | Data |
---|---|---|
32b8ec41 | 1 | ///////////////////////////////////////////////////////////////////////////// |
7bdc1879 | 2 | // Name: settings.h |
5acaf196 | 3 | // Author: Vaclav Slavik, Robert Roebling |
32b8ec41 | 4 | // Id: $Id$ |
c41c20a5 | 5 | // Copyright: (c) 2001-2002 SciTech Software, Inc. (www.scitechsoft.com) |
65571936 | 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" |
7bdc1879 VS |
17 | #include "wx/colour.h" |
18 | #include "wx/font.h" | |
0ab5e0e8 | 19 | #include "wx/gdicmn.h" |
8fbdfa4f VS |
20 | #include "wx/module.h" |
21 | ||
22 | // ---------------------------------------------------------------------------- | |
23 | // global data | |
24 | // ---------------------------------------------------------------------------- | |
25 | ||
26 | static wxFont *gs_fontDefault = NULL; | |
27 | ||
28 | class wxSystemSettingsModule : public wxModule | |
29 | { | |
30 | public: | |
31 | virtual bool OnInit() { return TRUE; } | |
32 | virtual void OnExit() | |
33 | { | |
34 | delete gs_fontDefault; | |
35 | gs_fontDefault = NULL; | |
36 | } | |
37 | ||
38 | private: | |
39 | DECLARE_DYNAMIC_CLASS(wxSystemSettingsModule) | |
40 | }; | |
41 | ||
42 | IMPLEMENT_DYNAMIC_CLASS(wxSystemSettingsModule, wxModule) | |
43 | ||
44 | ||
32b8ec41 | 45 | |
0ab5e0e8 | 46 | wxColour wxSystemSettingsNative::GetColour(wxSystemColour WXUNUSED(index)) |
7bdc1879 | 47 | { |
0ab5e0e8 | 48 | // not implemented, the mean is in wxUniversal |
ef344ff8 | 49 | return wxColour(0,0,0); |
7bdc1879 VS |
50 | } |
51 | ||
0ab5e0e8 | 52 | wxFont wxSystemSettingsNative::GetFont(wxSystemFont index) |
7bdc1879 | 53 | { |
5acaf196 | 54 | switch (index) |
8fbdfa4f | 55 | { |
5acaf196 VS |
56 | case wxSYS_OEM_FIXED_FONT: |
57 | case wxSYS_ANSI_FIXED_FONT: | |
58 | case wxSYS_SYSTEM_FIXED_FONT: | |
59 | { | |
60 | return *wxNORMAL_FONT; | |
61 | } | |
62 | case wxSYS_ANSI_VAR_FONT: | |
63 | case wxSYS_SYSTEM_FONT: | |
64 | case wxSYS_DEVICE_DEFAULT_FONT: | |
65 | case wxSYS_DEFAULT_GUI_FONT: | |
66 | { | |
67 | if ( !gs_fontDefault ) | |
68 | gs_fontDefault = new wxFont(10, wxSWISS, wxNORMAL, wxNORMAL, FALSE, "Arial"); | |
69 | return *gs_fontDefault; | |
70 | } | |
71 | default: | |
72 | return wxNullFont; | |
8fbdfa4f | 73 | } |
7bdc1879 VS |
74 | } |
75 | ||
9b0b5ba7 | 76 | int wxSystemSettingsNative::GetMetric(wxSystemMetric index, wxWindow* WXUNUSED(win)) |
7bdc1879 | 77 | { |
5acaf196 VS |
78 | int val; |
79 | ||
80 | switch (index) | |
81 | { | |
82 | case wxSYS_SCREEN_X: | |
83 | wxDisplaySize(&val, NULL); | |
84 | return val; | |
85 | case wxSYS_SCREEN_Y: | |
86 | wxDisplaySize(NULL, &val); | |
87 | return val; | |
88 | case wxSYS_VSCROLL_X: | |
89 | case wxSYS_HSCROLL_Y: | |
90 | return 15; | |
91 | break; | |
92 | default: | |
1d451c5b | 93 | return -1; // unsupported metric |
5acaf196 | 94 | } |
7bdc1879 | 95 | } |
253293c1 | 96 | |
0ab5e0e8 | 97 | bool wxSystemSettingsNative::HasFeature(wxSystemFeature index) |
253293c1 VS |
98 | { |
99 | switch (index) | |
100 | { | |
101 | case wxSYS_CAN_ICONIZE_FRAME: | |
102 | return FALSE; break; | |
103 | case wxSYS_CAN_DRAW_FRAME_DECORATIONS: | |
104 | return FALSE; break; | |
105 | default: | |
106 | return FALSE; | |
107 | } | |
108 | } |