1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: univ/colschem.cpp
3 // Purpose: (trivial) wxColourScheme implementation
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com)
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 // ===========================================================================
14 // ===========================================================================
16 // ---------------------------------------------------------------------------
18 // ---------------------------------------------------------------------------
21 #pragma implementation "colschem.h"
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
34 #include "wx/settings.h"
36 #include "wx/univ/colschem.h"
37 #include "wx/univ/theme.h"
39 // ============================================================================
41 // ============================================================================
43 // ----------------------------------------------------------------------------
45 // ----------------------------------------------------------------------------
47 wxColourScheme::~wxColourScheme()
51 // ----------------------------------------------------------------------------
53 // ----------------------------------------------------------------------------
55 wxColour
wxSystemSettings::GetColour(wxSystemColour index
)
57 // the elements of this enum must be kept in sync with wxSystemColour
58 static const wxColourScheme::StdColour s_mapSysToThemeCol
[] =
60 wxColourScheme::SCROLLBAR
/* wxSYS_COLOUR_SCROLLBAR */,
61 wxColourScheme::WINDOW
/* wxSYS_COLOUR_BACKGROUND */,
62 wxColourScheme::TITLEBAR_ACTIVE_TEXT
/* wxSYS_COLOUR_ACTIVECAPTION */,
63 wxColourScheme::TITLEBAR_TEXT
/* wxSYS_COLOUR_INACTIVECAPTION */,
64 wxColourScheme::MAX
/* wxSYS_COLOUR_MENU */,
65 wxColourScheme::MAX
/* wxSYS_COLOUR_WINDOW */,
66 wxColourScheme::MAX
/* wxSYS_COLOUR_WINDOWFRAME */,
67 wxColourScheme::CONTROL_TEXT
/* wxSYS_COLOUR_MENUTEXT */,
68 wxColourScheme::CONTROL_TEXT
/* wxSYS_COLOUR_WINDOWTEXT */,
69 wxColourScheme::CONTROL_TEXT
/* wxSYS_COLOUR_CAPTIONTEXT */,
70 wxColourScheme::MAX
/* wxSYS_COLOUR_ACTIVEBORDER */,
71 wxColourScheme::MAX
/* wxSYS_COLOUR_INACTIVEBORDER */,
72 wxColourScheme::MAX
/* wxSYS_COLOUR_APPWORKSPACE */,
73 wxColourScheme::HIGHLIGHT
/* wxSYS_COLOUR_HIGHLIGHT */,
74 wxColourScheme::HIGHLIGHT_TEXT
/* wxSYS_COLOUR_HIGHLIGHTTEXT */,
75 wxColourScheme::CONTROL
/* wxSYS_COLOUR_BTNFACE */,
76 wxColourScheme::SHADOW_DARK
/* wxSYS_COLOUR_BTNSHADOW */,
77 wxColourScheme::CONTROL_TEXT_DISABLED
/* wxSYS_COLOUR_GRAYTEXT */,
78 wxColourScheme::CONTROL_TEXT
/* wxSYS_COLOUR_BTNTEXT */,
79 wxColourScheme::MAX
/* wxSYS_COLOUR_INACTIVECAPTIONTEXT */,
80 wxColourScheme::SHADOW_HIGHLIGHT
/* wxSYS_COLOUR_BTNHIGHLIGHT */,
81 wxColourScheme::SHADOW_DARK
/* wxSYS_COLOUR_3DDKSHADOW */,
82 wxColourScheme::SHADOW_OUT
/* wxSYS_COLOUR_3DLIGHT */,
83 wxColourScheme::MAX
/* wxSYS_COLOUR_INFOTEXT */,
84 wxColourScheme::MAX
/* wxSYS_COLOUR_INFOBK */,
85 wxColourScheme::WINDOW
/* wxSYS_COLOUR_LISTBOX */,
88 wxCHECK_MSG( index
< (int)WXSIZEOF(s_mapSysToThemeCol
), wxNullColour
,
89 _T("invalid wxSystemColour") );
91 wxColourScheme::StdColour col
= s_mapSysToThemeCol
[index
];
92 if ( col
== wxColourScheme::MAX
)
94 // we don't have theme-equivalent for this colour
95 return wxSystemSettingsNative::GetColour(index
);
98 return wxTheme::Get()->GetColourScheme()->Get(col
);