]> git.saurik.com Git - wxWidgets.git/blame_incremental - include/wx/effects.h
using Run of base class
[wxWidgets.git] / include / wx / effects.h
... / ...
CommitLineData
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/effects.h
3// Purpose: wxEffects class
4// Draws 3D effects.
5// Author: Julian Smart et al
6// Modified by:
7// Created: 25/4/2000
8// Copyright: (c) Julian Smart
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_EFFECTS_H_
13#define _WX_EFFECTS_H_
14
15// this class is deprecated and will be removed in the next wx version
16//
17// please use wxRenderer::DrawBorder() instead of DrawSunkenEdge(); there is no
18// replacement for TileBitmap() but it doesn't seem to be very useful anyhow
19#if WXWIN_COMPATIBILITY_2_8
20
21/*
22 * wxEffects: various 3D effects
23 */
24
25#include "wx/object.h"
26#include "wx/colour.h"
27#include "wx/gdicmn.h"
28#include "wx/dc.h"
29
30class WXDLLIMPEXP_CORE wxEffectsImpl: public wxObject
31{
32public:
33 // Assume system colours
34 wxEffectsImpl() ;
35 // Going from lightest to darkest
36 wxEffectsImpl(const wxColour& highlightColour, const wxColour& lightShadow,
37 const wxColour& faceColour, const wxColour& mediumShadow,
38 const wxColour& darkShadow) ;
39
40 // Accessors
41 wxColour GetHighlightColour() const { return m_highlightColour; }
42 wxColour GetLightShadow() const { return m_lightShadow; }
43 wxColour GetFaceColour() const { return m_faceColour; }
44 wxColour GetMediumShadow() const { return m_mediumShadow; }
45 wxColour GetDarkShadow() const { return m_darkShadow; }
46
47 void SetHighlightColour(const wxColour& c) { m_highlightColour = c; }
48 void SetLightShadow(const wxColour& c) { m_lightShadow = c; }
49 void SetFaceColour(const wxColour& c) { m_faceColour = c; }
50 void SetMediumShadow(const wxColour& c) { m_mediumShadow = c; }
51 void SetDarkShadow(const wxColour& c) { m_darkShadow = c; }
52
53 void Set(const wxColour& highlightColour, const wxColour& lightShadow,
54 const wxColour& faceColour, const wxColour& mediumShadow,
55 const wxColour& darkShadow)
56 {
57 SetHighlightColour(highlightColour);
58 SetLightShadow(lightShadow);
59 SetFaceColour(faceColour);
60 SetMediumShadow(mediumShadow);
61 SetDarkShadow(darkShadow);
62 }
63
64 // Draw a sunken edge
65 void DrawSunkenEdge(wxDC& dc, const wxRect& rect, int borderSize = 1);
66
67 // Tile a bitmap
68 bool TileBitmap(const wxRect& rect, wxDC& dc, const wxBitmap& bitmap);
69
70protected:
71 wxColour m_highlightColour; // Usually white
72 wxColour m_lightShadow; // Usually light grey
73 wxColour m_faceColour; // Usually grey
74 wxColour m_mediumShadow; // Usually dark grey
75 wxColour m_darkShadow; // Usually black
76
77 DECLARE_CLASS(wxEffectsImpl)
78};
79
80// current versions of g++ don't generate deprecation warnings for classes
81// declared deprecated, so define wxEffects as a typedef instead: this does
82// generate warnings with both g++ and VC (which also has no troubles with
83// directly deprecating the classes...)
84//
85// note that this g++ bug (16370) is supposed to be fixed in g++ 4.3.0
86typedef wxEffectsImpl wxDEPRECATED(wxEffects);
87
88#endif // WXWIN_COMPATIBILITY_2_8
89
90#endif // _WX_EFFECTS_H_