pen.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/x11/pen.h
  3. // Purpose: wxPen class
  4. // Author: Julian Smart
  5. // Modified by:
  6. // Created: 17/09/98
  7. // Copyright: (c) Julian Smart
  8. // Licence: wxWindows licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_PEN_H_
  11. #define _WX_PEN_H_
  12. #include "wx/gdicmn.h"
  13. #include "wx/gdiobj.h"
  14. //-----------------------------------------------------------------------------
  15. // classes
  16. //-----------------------------------------------------------------------------
  17. class WXDLLIMPEXP_FWD_CORE wxPen;
  18. class WXDLLIMPEXP_FWD_CORE wxColour;
  19. class WXDLLIMPEXP_FWD_CORE wxBitmap;
  20. typedef char wxX11Dash;
  21. //-----------------------------------------------------------------------------
  22. // wxPen
  23. //-----------------------------------------------------------------------------
  24. class WXDLLIMPEXP_CORE wxPen: public wxPenBase
  25. {
  26. public:
  27. wxPen() { }
  28. wxPen( const wxColour &colour, int width = 1, wxPenStyle style = wxPENSTYLE_SOLID );
  29. #if FUTURE_WXWIN_COMPATIBILITY_3_0
  30. wxDEPRECATED_FUTURE( wxPen(const wxColour& col, int width, int style) );
  31. #endif
  32. wxPen( const wxBitmap &stipple, int width );
  33. virtual ~wxPen();
  34. bool operator == ( const wxPen& pen ) const;
  35. bool operator != (const wxPen& pen) const { return !(*this == pen); }
  36. void SetColour( const wxColour &colour );
  37. void SetColour( unsigned char red, unsigned char green, unsigned char blue );
  38. void SetCap( wxPenCap capStyle );
  39. void SetJoin( wxPenJoin joinStyle );
  40. void SetStyle( wxPenStyle style );
  41. void SetWidth( int width );
  42. void SetDashes( int number_of_dashes, const wxDash *dash );
  43. void SetStipple( const wxBitmap& stipple );
  44. wxColour GetColour() const;
  45. wxPenCap GetCap() const;
  46. wxPenJoin GetJoin() const;
  47. wxPenStyle GetStyle() const;
  48. int GetWidth() const;
  49. int GetDashes(wxDash **ptr) const;
  50. int GetDashCount() const;
  51. wxDash* GetDash() const;
  52. wxBitmap* GetStipple() const;
  53. #if FUTURE_WXWIN_COMPATIBILITY_3_0
  54. wxDEPRECATED_FUTURE( void SetStyle(int style) )
  55. { SetStyle((wxPenStyle)style); }
  56. #endif
  57. protected:
  58. virtual wxGDIRefData *CreateGDIRefData() const;
  59. virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
  60. DECLARE_DYNAMIC_CLASS(wxPen)
  61. };
  62. #endif // _WX_PEN_H_