]> git.saurik.com Git - wxWidgets.git/blob - src/univ/colschem.cpp
don't declare strptime() ourselves if the system already does it, we might have a...
[wxWidgets.git] / src / univ / colschem.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: univ/colschem.cpp
3 // Purpose: (trivial) wxColourScheme implementation
4 // Author: Vadim Zeitlin
5 // Modified by:
6 // Created: 20.08.00
7 // RCS-ID: $Id$
8 // Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com)
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
11
12 // ===========================================================================
13 // declarations
14 // ===========================================================================
15
16 // ---------------------------------------------------------------------------
17 // headers
18 // ---------------------------------------------------------------------------
19
20 // For compilers that support precompilation, includes "wx.h".
21 #include "wx/wxprec.h"
22
23 #ifdef __BORLANDC__
24 #pragma hdrstop
25 #endif
26
27 #ifndef WX_PRECOMP
28 #endif // WX_PRECOMP
29
30 #include "wx/settings.h"
31
32 #include "wx/univ/colschem.h"
33 #include "wx/univ/theme.h"
34
35 // ============================================================================
36 // implementation
37 // ============================================================================
38
39 // ----------------------------------------------------------------------------
40 // wxColourScheme
41 // ----------------------------------------------------------------------------
42
43 wxColourScheme::~wxColourScheme()
44 {
45 }
46
47 // ----------------------------------------------------------------------------
48 // wxSystemSettings
49 // ----------------------------------------------------------------------------
50
51 wxColour wxSystemSettings::GetColour(wxSystemColour index)
52 {
53 // the elements of this enum must be kept in sync with wxSystemColour
54 static const wxColourScheme::StdColour s_mapSysToThemeCol[] =
55 {
56 wxColourScheme::SCROLLBAR /* wxSYS_COLOUR_SCROLLBAR */,
57 wxColourScheme::WINDOW /* wxSYS_COLOUR_BACKGROUND */,
58 wxColourScheme::TITLEBAR_ACTIVE_TEXT /* wxSYS_COLOUR_ACTIVECAPTION */,
59 wxColourScheme::TITLEBAR_TEXT /* wxSYS_COLOUR_INACTIVECAPTION */,
60 wxColourScheme::MAX /* wxSYS_COLOUR_MENU */,
61 wxColourScheme::MAX /* wxSYS_COLOUR_WINDOW */,
62 wxColourScheme::MAX /* wxSYS_COLOUR_WINDOWFRAME */,
63 wxColourScheme::CONTROL_TEXT /* wxSYS_COLOUR_MENUTEXT */,
64 wxColourScheme::CONTROL_TEXT /* wxSYS_COLOUR_WINDOWTEXT */,
65 wxColourScheme::CONTROL_TEXT /* wxSYS_COLOUR_CAPTIONTEXT */,
66 wxColourScheme::MAX /* wxSYS_COLOUR_ACTIVEBORDER */,
67 wxColourScheme::MAX /* wxSYS_COLOUR_INACTIVEBORDER */,
68 wxColourScheme::MAX /* wxSYS_COLOUR_APPWORKSPACE */,
69 wxColourScheme::HIGHLIGHT /* wxSYS_COLOUR_HIGHLIGHT */,
70 wxColourScheme::HIGHLIGHT_TEXT /* wxSYS_COLOUR_HIGHLIGHTTEXT */,
71 wxColourScheme::CONTROL /* wxSYS_COLOUR_BTNFACE */,
72 wxColourScheme::SHADOW_DARK /* wxSYS_COLOUR_BTNSHADOW */,
73 wxColourScheme::CONTROL_TEXT_DISABLED /* wxSYS_COLOUR_GRAYTEXT */,
74 wxColourScheme::CONTROL_TEXT /* wxSYS_COLOUR_BTNTEXT */,
75 wxColourScheme::MAX /* wxSYS_COLOUR_INACTIVECAPTIONTEXT */,
76 wxColourScheme::SHADOW_HIGHLIGHT /* wxSYS_COLOUR_BTNHIGHLIGHT */,
77 wxColourScheme::SHADOW_DARK /* wxSYS_COLOUR_3DDKSHADOW */,
78 wxColourScheme::SHADOW_OUT /* wxSYS_COLOUR_3DLIGHT */,
79 wxColourScheme::MAX /* wxSYS_COLOUR_INFOTEXT */,
80 wxColourScheme::MAX /* wxSYS_COLOUR_INFOBK */,
81 wxColourScheme::WINDOW /* wxSYS_COLOUR_LISTBOX */,
82 };
83
84 wxCHECK_MSG( index < (int)WXSIZEOF(s_mapSysToThemeCol), wxNullColour,
85 _T("invalid wxSystemColour") );
86
87 wxColourScheme::StdColour col = s_mapSysToThemeCol[index];
88 if ( col == wxColourScheme::MAX )
89 {
90 // we don't have theme-equivalent for this colour
91 return wxSystemSettingsNative::GetColour(index);
92 }
93
94 return wxTheme::Get()->GetColourScheme()->Get(col);
95 }
96