2000-07-28 13:53:25 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2006-05-08 06:05:40 -04:00
|
|
|
// Name: wx/effects.h
|
2000-07-28 13:53:25 -04:00
|
|
|
// Purpose: wxEffects class
|
|
|
|
// Draws 3D effects.
|
|
|
|
// Author: Julian Smart et al
|
|
|
|
// Modified by:
|
|
|
|
// Created: 25/4/2000
|
|
|
|
// Copyright: (c) Julian Smart
|
2004-09-13 14:03:44 -04:00
|
|
|
// Licence: wxWindows licence
|
2000-07-28 13:53:25 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_EFFECTS_H_
|
|
|
|
#define _WX_EFFECTS_H_
|
|
|
|
|
2007-10-20 17:58:47 -04:00
|
|
|
// this class is deprecated and will be removed in the next wx version
|
|
|
|
//
|
|
|
|
// please use wxRenderer::DrawBorder() instead of DrawSunkenEdge(); there is no
|
|
|
|
// replacement for TileBitmap() but it doesn't seem to be very useful anyhow
|
2008-06-26 07:16:40 -04:00
|
|
|
#if WXWIN_COMPATIBILITY_2_8
|
2007-10-20 17:58:47 -04:00
|
|
|
|
2000-07-28 13:53:25 -04:00
|
|
|
/*
|
|
|
|
* wxEffects: various 3D effects
|
|
|
|
*/
|
|
|
|
|
2006-05-08 06:05:40 -04:00
|
|
|
#include "wx/object.h"
|
|
|
|
#include "wx/colour.h"
|
2006-05-08 06:27:17 -04:00
|
|
|
#include "wx/gdicmn.h"
|
2006-05-08 07:31:03 -04:00
|
|
|
#include "wx/dc.h"
|
2006-05-08 06:05:40 -04:00
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxEffectsImpl: public wxObject
|
2000-07-28 13:53:25 -04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
// Assume system colours
|
2007-10-20 17:58:47 -04:00
|
|
|
wxEffectsImpl() ;
|
2000-07-28 13:53:25 -04:00
|
|
|
// Going from lightest to darkest
|
2007-10-20 17:58:47 -04:00
|
|
|
wxEffectsImpl(const wxColour& highlightColour, const wxColour& lightShadow,
|
|
|
|
const wxColour& faceColour, const wxColour& mediumShadow,
|
|
|
|
const wxColour& darkShadow) ;
|
2002-09-05 15:37:25 -04:00
|
|
|
|
|
|
|
// Accessors
|
|
|
|
wxColour GetHighlightColour() const { return m_highlightColour; }
|
|
|
|
wxColour GetLightShadow() const { return m_lightShadow; }
|
|
|
|
wxColour GetFaceColour() const { return m_faceColour; }
|
|
|
|
wxColour GetMediumShadow() const { return m_mediumShadow; }
|
|
|
|
wxColour GetDarkShadow() const { return m_darkShadow; }
|
|
|
|
|
|
|
|
void SetHighlightColour(const wxColour& c) { m_highlightColour = c; }
|
|
|
|
void SetLightShadow(const wxColour& c) { m_lightShadow = c; }
|
|
|
|
void SetFaceColour(const wxColour& c) { m_faceColour = c; }
|
|
|
|
void SetMediumShadow(const wxColour& c) { m_mediumShadow = c; }
|
|
|
|
void SetDarkShadow(const wxColour& c) { m_darkShadow = c; }
|
|
|
|
|
|
|
|
void Set(const wxColour& highlightColour, const wxColour& lightShadow,
|
|
|
|
const wxColour& faceColour, const wxColour& mediumShadow,
|
|
|
|
const wxColour& darkShadow)
|
|
|
|
{
|
|
|
|
SetHighlightColour(highlightColour);
|
|
|
|
SetLightShadow(lightShadow);
|
|
|
|
SetFaceColour(faceColour);
|
|
|
|
SetMediumShadow(mediumShadow);
|
|
|
|
SetDarkShadow(darkShadow);
|
|
|
|
}
|
2000-07-28 13:53:25 -04:00
|
|
|
|
|
|
|
// Draw a sunken edge
|
|
|
|
void DrawSunkenEdge(wxDC& dc, const wxRect& rect, int borderSize = 1);
|
|
|
|
|
|
|
|
// Tile a bitmap
|
2005-09-24 17:43:15 -04:00
|
|
|
bool TileBitmap(const wxRect& rect, wxDC& dc, const wxBitmap& bitmap);
|
2002-09-05 15:37:25 -04:00
|
|
|
|
2000-07-28 13:53:25 -04:00
|
|
|
protected:
|
|
|
|
wxColour m_highlightColour; // Usually white
|
|
|
|
wxColour m_lightShadow; // Usually light grey
|
|
|
|
wxColour m_faceColour; // Usually grey
|
|
|
|
wxColour m_mediumShadow; // Usually dark grey
|
|
|
|
wxColour m_darkShadow; // Usually black
|
2007-10-20 17:58:47 -04:00
|
|
|
|
2015-04-23 07:49:01 -04:00
|
|
|
wxDECLARE_CLASS(wxEffectsImpl);
|
2000-07-28 13:53:25 -04:00
|
|
|
};
|
|
|
|
|
2007-10-20 17:58:47 -04:00
|
|
|
// current versions of g++ don't generate deprecation warnings for classes
|
|
|
|
// declared deprecated, so define wxEffects as a typedef instead: this does
|
|
|
|
// generate warnings with both g++ and VC (which also has no troubles with
|
|
|
|
// directly deprecating the classes...)
|
|
|
|
//
|
|
|
|
// note that this g++ bug (16370) is supposed to be fixed in g++ 4.3.0
|
|
|
|
typedef wxEffectsImpl wxDEPRECATED(wxEffects);
|
|
|
|
|
|
|
|
#endif // WXWIN_COMPATIBILITY_2_8
|
|
|
|
|
|
|
|
#endif // _WX_EFFECTS_H_
|