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