]> git.saurik.com Git - wxWidgets.git/blame - src/univ/colschem.cpp
Misc mods for feedback from Marcin Wojdyr <wojdyr@if.pw.edu.pl>
[wxWidgets.git] / src / univ / colschem.cpp
CommitLineData
1e6feb95
VZ
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$
442b35b5 8// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com)
1e6feb95
VZ
9// Licence: wxWindows license
10///////////////////////////////////////////////////////////////////////////////
11
12// ===========================================================================
13// declarations
14// ===========================================================================
15
16// ---------------------------------------------------------------------------
17// headers
18// ---------------------------------------------------------------------------
19
20#ifdef __GNUG__
21 #pragma implementation "colschem.h"
22#endif
23
24// For compilers that support precompilation, includes "wx.h".
25#include "wx/wxprec.h"
26
27#ifdef __BORLANDC__
28 #pragma hdrstop
29#endif
30
31#ifndef WX_PRECOMP
32#endif // WX_PRECOMP
33
7516ed26
VZ
34#include "wx/settings.h"
35
1e6feb95 36#include "wx/univ/colschem.h"
c7261948 37#include "wx/univ/theme.h"
1e6feb95
VZ
38
39// ============================================================================
40// implementation
41// ============================================================================
42
7516ed26
VZ
43// ----------------------------------------------------------------------------
44// wxColourScheme
45// ----------------------------------------------------------------------------
46
1e6feb95
VZ
47wxColourScheme::~wxColourScheme()
48{
49}
7516ed26 50
7516ed26
VZ
51// ----------------------------------------------------------------------------
52// wxSystemSettings
53// ----------------------------------------------------------------------------
54
55wxColour wxSystemSettings::GetColour(wxSystemColour index)
56{
57 // the elements of this enum must be kept in sync with wxSystemColour
58 static const wxColourScheme::StdColour s_mapSysToThemeCol[] =
59 {
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 */,
1483041d 75 wxColourScheme::CONTROL /* wxSYS_COLOUR_BTNFACE */,
7516ed26
VZ
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 */,
1483041d 81 wxColourScheme::SHADOW_DARK /* wxSYS_COLOUR_3DDKSHADOW */,
7516ed26
VZ
82 wxColourScheme::SHADOW_OUT /* wxSYS_COLOUR_3DLIGHT */,
83 wxColourScheme::MAX /* wxSYS_COLOUR_INFOTEXT */,
84 wxColourScheme::MAX /* wxSYS_COLOUR_INFOBK */,
1483041d 85 wxColourScheme::WINDOW /* wxSYS_COLOUR_LISTBOX */,
7516ed26
VZ
86 };
87
c7261948 88 wxCHECK_MSG( index < (int)WXSIZEOF(s_mapSysToThemeCol), wxNullColour,
7516ed26
VZ
89 _T("invalid wxSystemColour") );
90
91 wxColourScheme::StdColour col = s_mapSysToThemeCol[index];
92 if ( col == wxColourScheme::MAX )
93 {
94 // we don't have theme-equivalent for this colour
95 return wxSystemSettingsNative::GetColour(index);
96 }
97
98 return wxTheme::Get()->GetColourScheme()->Get(col);
99}
100