added wxColourScheme

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8141 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-08-19 20:26:01 +00:00
parent 8f2ea39e1d
commit ddee3ee64d
4 changed files with 110 additions and 5 deletions

View File

@@ -0,0 +1,53 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/univ/colschem.h
// Purpose: wxColourScheme class provides the colours to use for drawing
// Author: Vadim Zeitlin
// Modified by:
// Created: 19.08.00
// RCS-ID: $Id$
// Copyright: (c) 2000 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_UNIV_COLSCHEM_H_
#define _WX_UNIV_COLSCHEM_H_
#ifdef __GNUG__
#pragma interface "colschem.h"
#endif
#include "wx/colour.h"
// ----------------------------------------------------------------------------
// wxColourScheme
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxColourScheme
{
public:
// the standard colours
enum StdColour
{
// these colours are used for drawing the shadows of 3D objects, use
// only FACE in the renderers which don't use 3D shading
DARK_SHADOW,
FACE,
HIGHLIGHT,
LIGHT,
SHADOW,
// the default colours for the controls
CONTROL_TEXT,
HIGHLIGHT,
HIGHLIGHT_TEXT,
MAX
};
virtual wxColour Get(StdColour col) = 0;
};
// some people just can't spell it correctly :-)
typedef wxColourScheme wxColorScheme;
#endif // _WX_UNIV_COLSCHEM_H_

View File

@@ -24,7 +24,7 @@
class WXDLLEXPORT wxRenderer;
class WXDLLEXPORT wxInputHandler;
class WXDLLEXPORT wxColourScheme { };
class WXDLLEXPORT wxColourScheme;
class WXDLLEXPORT wxTheme
{

View File

@@ -130,11 +130,13 @@ private:
};
// ----------------------------------------------------------------------------
// wxGTKColourScheme
// wxGTKColourScheme: uses the standard GTK colours
// ----------------------------------------------------------------------------
class wxGTKColourScheme : public wxColourScheme
{
public:
virtual wxColour Get(StdColour col);
};
// ----------------------------------------------------------------------------
@@ -179,7 +181,7 @@ WX_IMPLEMENT_THEME(wxGTKTheme, gtk, wxTRANSLATE("GTK+ theme"));
wxGTKTheme::wxGTKTheme()
{
m_renderer = new wxGTKRenderer;
m_scheme = NULL;
m_scheme = new wxGTKColourScheme;
}
wxGTKTheme::~wxGTKTheme()
@@ -216,6 +218,30 @@ wxInputHandler *wxGTKTheme::GetInputHandler(const wxString& control)
return handler;
}
// ============================================================================
// wxGTKColourScheme
// ============================================================================
wxColour wxGTKColourScheme::Get(wxGTKColourScheme::StdColour col)
{
switch ( col )
{
case DARK_SHADOW: return wxColour(0x7f7f7f);
case FACE: return wxColour(0xc0c0c0);
case HIGHLIGHT: return wxColour(0xe0e0e0);
case LIGHT: return wxColour(0xffffff);
case SHADOW: return wxColour(0xc0c0c0);
case CONTROL_TEXT: return wxColour(0x000000);
case HIGHLIGHT: return wxColour(0x0000ff);
case HIGHLIGHT_TEXT:return wxColour(0x00ffff);
case MAX:
default:
wxFAIL_MSG(_T("invalid standard colour"));
return wxColour(0x000000);
}
}
// ============================================================================
// wxGTKRenderer
// ============================================================================

View File

@@ -124,11 +124,13 @@ private:
};
// ----------------------------------------------------------------------------
// wxWin32ColourScheme
// wxWin32ColourScheme: uses (default) Win32 colours
// ----------------------------------------------------------------------------
class wxWin32ColourScheme : public wxColourScheme
{
public:
virtual wxColour Get(StdColour col);
};
// ----------------------------------------------------------------------------
@@ -173,7 +175,7 @@ WX_IMPLEMENT_THEME(wxWin32Theme, win32, wxTRANSLATE("Win32 theme"));
wxWin32Theme::wxWin32Theme()
{
m_renderer = new wxWin32Renderer;
m_scheme = NULL;
m_scheme = new wxWin32ColourScheme;
}
wxWin32Theme::~wxWin32Theme()
@@ -210,6 +212,30 @@ wxInputHandler *wxWin32Theme::GetInputHandler(const wxString& control)
return handler;
}
// ============================================================================
// wxWin32ColourScheme
// ============================================================================
wxColour wxWin32ColourScheme::Get(wxWin32ColourScheme::StdColour col)
{
switch ( col )
{
case DARK_SHADOW: return wxColour(0x7f7f7f);
case FACE: return wxColour(0xc0c0c0);
case HIGHLIGHT: return wxColour(0xe0e0e0);
case LIGHT: return wxColour(0xffffff);
case SHADOW: return wxColour(0xc0c0c0);
case CONTROL_TEXT: return wxColour(0x000000);
case HIGHLIGHT: return wxColour(0x0000ff);
case HIGHLIGHT_TEXT:return wxColour(0x00ffff);
case MAX:
default:
wxFAIL_MSG(_T("invalid standard colour"));
return wxColour(0x000000);
}
}
// ============================================================================
// wxWin32Renderer
// ============================================================================