]>
Commit | Line | Data |
---|---|---|
83df96d6 JS |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: settings.cpp | |
3 | // Purpose: wxSettings | |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 17/09/98 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Julian Smart | |
65571936 | 9 | // Licence: wxWindows licence |
83df96d6 JS |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | // TODO: these settings should probably be configurable from some central or | |
13 | // per-user file, which can be edited using a Windows-control-panel clone. | |
14 | // Also they should be documented better. Some are very MS Windows-ish. | |
15 | ||
14f355c2 | 16 | #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) |
83df96d6 JS |
17 | #pragma implementation "settings.h" |
18 | #endif | |
19 | ||
20 | #include "wx/settings.h" | |
21 | #include "wx/gdicmn.h" | |
2b5f62a0 | 22 | #include "wx/x11/private.h" |
83df96d6 JS |
23 | |
24 | wxColour wxSystemSettingsNative::GetColour(wxSystemColour index) | |
25 | { | |
c2c0dabf RR |
26 | switch (index) |
27 | { | |
28 | case wxSYS_COLOUR_APPWORKSPACE: | |
29 | return wxColour( 0xc0c0c0 ); | |
30 | ||
31 | default: | |
32 | break; | |
33 | } | |
34 | ||
35 | // Overridden mostly by wxSystemSettings::GetColour in wxUniversal | |
b28d3abf | 36 | return *wxWHITE; |
83df96d6 JS |
37 | } |
38 | ||
39 | wxFont wxSystemSettingsNative::GetFont(wxSystemFont index) | |
40 | { | |
41 | switch (index) | |
42 | { | |
43 | case wxSYS_SYSTEM_FIXED_FONT: | |
44 | { | |
45 | return wxFont(12, wxMODERN, wxNORMAL, wxNORMAL, FALSE); | |
46 | break; | |
47 | } | |
48 | case wxSYS_DEVICE_DEFAULT_FONT: | |
49 | case wxSYS_SYSTEM_FONT: | |
50 | case wxSYS_DEFAULT_GUI_FONT: | |
51 | default: | |
52 | { | |
ad0e4b66 | 53 | return wxFont(12, wxSWISS, wxNORMAL, wxNORMAL, FALSE); |
83df96d6 JS |
54 | break; |
55 | } | |
56 | } | |
57 | ||
58 | return wxFont(); | |
59 | } | |
60 | ||
61 | // Get a system metric, e.g. scrollbar size | |
9b0b5ba7 | 62 | int wxSystemSettingsNative::GetMetric(wxSystemMetric index, wxWindow* WXUNUSED(win)) |
83df96d6 JS |
63 | { |
64 | switch ( index) | |
65 | { | |
1d451c5b RD |
66 | // TODO case wxSYS_MOUSE_BUTTONS: |
67 | // TODO case wxSYS_BORDER_X: | |
68 | // TODO case wxSYS_BORDER_Y: | |
69 | // TODO case wxSYS_CURSOR_X: | |
70 | // TODO case wxSYS_CURSOR_Y: | |
71 | // TODO case wxSYS_DCLICK_X: | |
72 | // TODO case wxSYS_DCLICK_Y: | |
73 | // TODO case wxSYS_DRAG_X: | |
74 | // TODO case wxSYS_DRAG_Y: | |
75 | // TODO case wxSYS_EDGE_X: | |
76 | // TODO case wxSYS_EDGE_Y: | |
77 | // TODO case wxSYS_HSCROLL_ARROW_X: | |
78 | // TODO case wxSYS_HSCROLL_ARROW_Y: | |
79 | // TODO case wxSYS_HTHUMB_X: | |
80 | // TODO case wxSYS_ICON_X: | |
81 | // TODO case wxSYS_ICON_Y: | |
82 | // TODO case wxSYS_ICONSPACING_X: | |
83 | // TODO case wxSYS_ICONSPACING_Y: | |
84 | // TODO case wxSYS_WINDOWMIN_X: | |
85 | // TODO case wxSYS_WINDOWMIN_Y: | |
86 | ||
83df96d6 | 87 | case wxSYS_SCREEN_X: |
2b5f62a0 VZ |
88 | return DisplayWidth( wxGlobalDisplay(), 0 ); |
89 | ||
83df96d6 | 90 | case wxSYS_SCREEN_Y: |
2b5f62a0 VZ |
91 | return DisplayHeight( wxGlobalDisplay(), 0 ); |
92 | ||
1d451c5b RD |
93 | // TODO case wxSYS_FRAMESIZE_X: |
94 | // TODO case wxSYS_FRAMESIZE_Y: | |
95 | // TODO case wxSYS_SMALLICON_X: | |
96 | // TODO case wxSYS_SMALLICON_Y: | |
97 | // TODO case wxSYS_HSCROLL_Y: | |
98 | // TODO case wxSYS_VSCROLL_X: | |
99 | // TODO case wxSYS_VSCROLL_ARROW_X: | |
100 | // TODO case wxSYS_VSCROLL_ARROW_Y: | |
101 | // TODO case wxSYS_VTHUMB_Y: | |
102 | // TODO case wxSYS_CAPTION_Y: | |
103 | // TODO case wxSYS_MENU_Y: | |
104 | // TODO case wxSYS_NETWORK_PRESENT: | |
105 | // TODO case wxSYS_PENWINDOWS_PRESENT: | |
106 | // TODO case wxSYS_SHOW_SOUNDS: | |
107 | // TODO case wxSYS_SWAP_BUTTONS: | |
108 | ||
83df96d6 | 109 | default: |
1d451c5b | 110 | return -1; // unsupported metric |
83df96d6 JS |
111 | } |
112 | } | |
113 | ||
114 | bool wxSystemSettingsNative::HasFeature(wxSystemFeature index) | |
115 | { | |
116 | switch (index) | |
117 | { | |
118 | case wxSYS_CAN_ICONIZE_FRAME: | |
119 | case wxSYS_CAN_DRAW_FRAME_DECORATIONS: | |
120 | return TRUE; | |
121 | ||
122 | default: | |
123 | return FALSE; | |
124 | } | |
125 | } |