pen.h 2.3 KB

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