effects.h 3.1 KB

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