pen.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/osx/pen.h
  3. // Purpose: wxPen class
  4. // Author: Stefan Csomor
  5. // Modified by:
  6. // Created: 1998-01-01
  7. // Copyright: (c) Stefan Csomor
  8. // Licence: wxWindows licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_PEN_H_
  11. #define _WX_PEN_H_
  12. #include "wx/gdiobj.h"
  13. #include "wx/colour.h"
  14. #include "wx/bitmap.h"
  15. // Pen
  16. class WXDLLIMPEXP_CORE wxPen : public wxPenBase
  17. {
  18. public:
  19. wxPen();
  20. wxPen(const wxColour& col, int width = 1, wxPenStyle style = wxPENSTYLE_SOLID);
  21. #if FUTURE_WXWIN_COMPATIBILITY_3_0
  22. wxDEPRECATED_FUTURE( wxPen(const wxColour& col, int width, int style) );
  23. #endif
  24. wxPen(const wxBitmap& stipple, int width);
  25. virtual ~wxPen();
  26. bool operator==(const wxPen& pen) const;
  27. bool operator!=(const wxPen& pen) const { return !(*this == pen); }
  28. // Override in order to recreate the pen
  29. void SetColour(const wxColour& col) ;
  30. void SetColour(unsigned char r, unsigned char g, unsigned char b) ;
  31. void SetWidth(int width) ;
  32. void SetStyle(wxPenStyle style) ;
  33. void SetStipple(const wxBitmap& stipple) ;
  34. void SetDashes(int nb_dashes, const wxDash *dash) ;
  35. void SetJoin(wxPenJoin join) ;
  36. void SetCap(wxPenCap cap) ;
  37. wxColour GetColour() const ;
  38. int GetWidth() const;
  39. wxPenStyle GetStyle() const;
  40. wxPenJoin GetJoin() const;
  41. wxPenCap GetCap() const;
  42. int GetDashes(wxDash **ptr) const;
  43. int GetDashCount() const;
  44. wxBitmap *GetStipple() const ;
  45. #if FUTURE_WXWIN_COMPATIBILITY_3_0
  46. wxDEPRECATED_FUTURE( void SetStyle(int style) )
  47. { SetStyle((wxPenStyle)style); }
  48. #endif
  49. // Implementation
  50. // Useful helper: create the brush resource
  51. bool RealizeResource();
  52. protected:
  53. virtual wxGDIRefData *CreateGDIRefData() const;
  54. virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
  55. private:
  56. void Unshare();
  57. DECLARE_DYNAMIC_CLASS(wxPen)
  58. };
  59. #endif
  60. // _WX_PEN_H_