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 license
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 #ifdef wxHAS_SS_NATIVE
53 // ----------------------------------------------------------------------------
55 // ----------------------------------------------------------------------------
57 wxColour
wxSystemSettings::GetColour(wxSystemColour index
)
59 // the elements of this enum must be kept in sync with wxSystemColour
60 static const wxColourScheme::StdColour s_mapSysToThemeCol
[] =
62 wxColourScheme::SCROLLBAR
/* wxSYS_COLOUR_SCROLLBAR */,
63 wxColourScheme::WINDOW
/* wxSYS_COLOUR_BACKGROUND */,
64 wxColourScheme::TITLEBAR_ACTIVE_TEXT
/* wxSYS_COLOUR_ACTIVECAPTION */,
65 wxColourScheme::TITLEBAR_TEXT
/* wxSYS_COLOUR_INACTIVECAPTION */,
66 wxColourScheme::MAX
/* wxSYS_COLOUR_MENU */,
67 wxColourScheme::MAX
/* wxSYS_COLOUR_WINDOW */,
68 wxColourScheme::MAX
/* wxSYS_COLOUR_WINDOWFRAME */,
69 wxColourScheme::CONTROL_TEXT
/* wxSYS_COLOUR_MENUTEXT */,
70 wxColourScheme::CONTROL_TEXT
/* wxSYS_COLOUR_WINDOWTEXT */,
71 wxColourScheme::CONTROL_TEXT
/* wxSYS_COLOUR_CAPTIONTEXT */,
72 wxColourScheme::MAX
/* wxSYS_COLOUR_ACTIVEBORDER */,
73 wxColourScheme::MAX
/* wxSYS_COLOUR_INACTIVEBORDER */,
74 wxColourScheme::MAX
/* wxSYS_COLOUR_APPWORKSPACE */,
75 wxColourScheme::HIGHLIGHT
/* wxSYS_COLOUR_HIGHLIGHT */,
76 wxColourScheme::HIGHLIGHT_TEXT
/* wxSYS_COLOUR_HIGHLIGHTTEXT */,
77 wxColourScheme::SCROLLBAR
/* wxSYS_COLOUR_BTNFACE */,
78 wxColourScheme::SHADOW_DARK
/* wxSYS_COLOUR_BTNSHADOW */,
79 wxColourScheme::CONTROL_TEXT_DISABLED
/* wxSYS_COLOUR_GRAYTEXT */,
80 wxColourScheme::CONTROL_TEXT
/* wxSYS_COLOUR_BTNTEXT */,
81 wxColourScheme::MAX
/* wxSYS_COLOUR_INACTIVECAPTIONTEXT */,
82 wxColourScheme::SHADOW_HIGHLIGHT
/* wxSYS_COLOUR_BTNHIGHLIGHT */,
83 wxColourScheme::SHADOW_IN
/* wxSYS_COLOUR_3DDKSHADOW */,
84 wxColourScheme::SHADOW_OUT
/* wxSYS_COLOUR_3DLIGHT */,
85 wxColourScheme::MAX
/* wxSYS_COLOUR_INFOTEXT */,
86 wxColourScheme::MAX
/* wxSYS_COLOUR_INFOBK */,
87 wxColourScheme::CONTROL
/* wxSYS_COLOUR_LISTBOX */,
90 wxCHECK_MSG( index
< (int)WXSIZEOF(s_mapSysToThemeCol
), wxNullColour
,
91 _T("invalid wxSystemColour") );
93 wxColourScheme::StdColour col
= s_mapSysToThemeCol
[index
];
94 if ( col
== wxColourScheme::MAX
)
96 // we don't have theme-equivalent for this colour
97 return wxSystemSettingsNative::GetColour(index
);
100 return wxTheme::Get()->GetColourScheme()->Get(col
);
103 #endif // wxHAS_SS_NATIVE