]>
Commit | Line | Data |
---|---|---|
3f4fc796 | 1 | ///////////////////////////////////////////////////////////////////////////// |
0799bc86 | 2 | // Name: wx/effects.h |
3f4fc796 JS |
3 | // Purpose: wxEffects class |
4 | // Draws 3D effects. | |
5 | // Author: Julian Smart et al | |
6 | // Modified by: | |
7 | // Created: 25/4/2000 | |
3f4fc796 | 8 | // Copyright: (c) Julian Smart |
1a18887b | 9 | // Licence: wxWindows licence |
3f4fc796 JS |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
3f4fc796 JS |
12 | #ifndef _WX_EFFECTS_H_ |
13 | #define _WX_EFFECTS_H_ | |
14 | ||
fe1efe6a VZ |
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 | |
831b64f3 | 19 | #if WXWIN_COMPATIBILITY_2_8 |
fe1efe6a | 20 | |
3f4fc796 JS |
21 | /* |
22 | * wxEffects: various 3D effects | |
23 | */ | |
24 | ||
0799bc86 WS |
25 | #include "wx/object.h" |
26 | #include "wx/colour.h" | |
dd4e6da0 | 27 | #include "wx/gdicmn.h" |
ed8219a5 | 28 | #include "wx/dc.h" |
0799bc86 | 29 | |
53a2db12 | 30 | class WXDLLIMPEXP_CORE wxEffectsImpl: public wxObject |
3f4fc796 | 31 | { |
3f4fc796 JS |
32 | public: |
33 | // Assume system colours | |
fe1efe6a | 34 | wxEffectsImpl() ; |
3f4fc796 | 35 | // Going from lightest to darkest |
fe1efe6a VZ |
36 | wxEffectsImpl(const wxColour& highlightColour, const wxColour& lightShadow, |
37 | const wxColour& faceColour, const wxColour& mediumShadow, | |
38 | const wxColour& darkShadow) ; | |
db54b046 RD |
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 | } | |
3f4fc796 JS |
63 | |
64 | // Draw a sunken edge | |
65 | void DrawSunkenEdge(wxDC& dc, const wxRect& rect, int borderSize = 1); | |
66 | ||
67 | // Tile a bitmap | |
fbfb8bcc | 68 | bool TileBitmap(const wxRect& rect, wxDC& dc, const wxBitmap& bitmap); |
db54b046 | 69 | |
3f4fc796 JS |
70 | protected: |
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 | |
fe1efe6a VZ |
76 | |
77 | DECLARE_CLASS(wxEffectsImpl) | |
3f4fc796 JS |
78 | }; |
79 | ||
fe1efe6a VZ |
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 | |
86 | typedef wxEffectsImpl wxDEPRECATED(wxEffects); | |
87 | ||
88 | #endif // WXWIN_COMPATIBILITY_2_8 | |
89 | ||
90 | #endif // _WX_EFFECTS_H_ |