]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/pen.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxPen class
4 // Author: Julian Smart
5 // Modified by: Vadim Zeitlin: fixed operator=(), ==(), !=()
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #include "wx/gdiobj.h"
16 #include "wx/gdicmn.h"
18 // ----------------------------------------------------------------------------
20 // ----------------------------------------------------------------------------
22 class WXDLLIMPEXP_CORE wxPen
: public wxPenBase
26 wxPen(const wxColour
& col
, int width
= 1, wxPenStyle style
= wxPENSTYLE_SOLID
);
27 #if FUTURE_WXWIN_COMPATIBILITY_3_0
28 wxDEPRECATED_FUTURE( wxPen(const wxColour
& col
, int width
, int style
) );
31 wxPen(const wxBitmap
& stipple
, int width
);
34 bool operator==(const wxPen
& pen
) const;
35 bool operator!=(const wxPen
& pen
) const { return !(*this == pen
); }
37 // Override in order to recreate the pen
38 void SetColour(const wxColour
& col
);
39 void SetColour(unsigned char r
, unsigned char g
, unsigned char b
);
41 void SetWidth(int width
);
42 void SetStyle(wxPenStyle style
);
43 void SetStipple(const wxBitmap
& stipple
);
44 void SetDashes(int nb_dashes
, const wxDash
*dash
);
45 void SetJoin(wxPenJoin join
);
46 void SetCap(wxPenCap cap
);
48 wxColour
GetColour() const;
50 wxPenStyle
GetStyle() const;
51 wxPenJoin
GetJoin() const;
52 wxPenCap
GetCap() const;
53 int GetDashes(wxDash
** ptr
) const;
54 wxDash
* GetDash() const;
55 int GetDashCount() const;
56 wxBitmap
* GetStipple() const;
58 // internal: wxGDIObject methods
59 virtual bool RealizeResource();
60 virtual bool FreeResource(bool force
= false);
61 virtual WXHANDLE
GetResourceHandle() const;
62 virtual bool IsFree() const;
65 virtual wxGDIRefData
* CreateGDIRefData() const;
66 virtual wxGDIRefData
* CloneGDIRefData(const wxGDIRefData
* data
) const;
68 // same as FreeResource() + RealizeResource()
71 DECLARE_DYNAMIC_CLASS(wxPen
)