]>
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" |
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: | |
127eab18 | 31 | virtual bool OnInit() { return true; } |
8fbdfa4f VS |
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 ) | |
127eab18 | 68 | gs_fontDefault = new wxFont(10, wxSWISS, wxNORMAL, wxNORMAL, false, "Arial"); |
5acaf196 VS |
69 | return *gs_fontDefault; |
70 | } | |
8fbdfa4f | 71 | } |
127eab18 WS |
72 | |
73 | return wxNullFont; | |
7bdc1879 VS |
74 | } |
75 | ||
9b0b5ba7 | 76 | int wxSystemSettingsNative::GetMetric(wxSystemMetric index, wxWindow* WXUNUSED(win)) |
7bdc1879 | 77 | { |
5acaf196 | 78 | int val; |
127eab18 | 79 | |
5acaf196 VS |
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: | |
127eab18 | 90 | return 15; |
5acaf196 | 91 | } |
127eab18 WS |
92 | |
93 | return -1; // unsupported metric | |
7bdc1879 | 94 | } |
253293c1 | 95 | |
0ab5e0e8 | 96 | bool wxSystemSettingsNative::HasFeature(wxSystemFeature index) |
253293c1 VS |
97 | { |
98 | switch (index) | |
99 | { | |
127eab18 WS |
100 | case wxSYS_CAN_ICONIZE_FRAME: |
101 | return false; | |
253293c1 | 102 | case wxSYS_CAN_DRAW_FRAME_DECORATIONS: |
127eab18 | 103 | return false; |
253293c1 | 104 | } |
127eab18 WS |
105 | |
106 | return false; | |
253293c1 | 107 | } |