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