]>
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=(), ==(), !=()
7 // Copyright: (c) Julian Smart
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
14 #include "wx/gdiobj.h"
15 #include "wx/gdicmn.h"
17 // ----------------------------------------------------------------------------
19 // ----------------------------------------------------------------------------
21 class WXDLLIMPEXP_CORE wxPen
: public wxPenBase
25 wxPen(const wxColour
& col
, int width
= 1, wxPenStyle style
= wxPENSTYLE_SOLID
);
26 #if FUTURE_WXWIN_COMPATIBILITY_3_0
27 wxDEPRECATED_FUTURE( wxPen(const wxColour
& col
, int width
, int style
) );
30 wxPen(const wxBitmap
& stipple
, int width
);
33 bool operator==(const wxPen
& pen
) const;
34 bool operator!=(const wxPen
& pen
) const { return !(*this == pen
); }
36 // Override in order to recreate the pen
37 void SetColour(const wxColour
& col
);
38 void SetColour(unsigned char r
, unsigned char g
, unsigned char b
);
40 void SetWidth(int width
);
41 void SetStyle(wxPenStyle style
);
42 void SetStipple(const wxBitmap
& stipple
);
43 void SetDashes(int nb_dashes
, const wxDash
*dash
);
44 void SetJoin(wxPenJoin join
);
45 void SetCap(wxPenCap cap
);
47 wxColour
GetColour() const;
49 wxPenStyle
GetStyle() const;
50 wxPenJoin
GetJoin() const;
51 wxPenCap
GetCap() const;
52 int GetDashes(wxDash
** ptr
) const;
53 wxDash
* GetDash() const;
54 int GetDashCount() const;
55 wxBitmap
* GetStipple() const;
57 #if FUTURE_WXWIN_COMPATIBILITY_3_0
58 wxDEPRECATED_FUTURE( void SetStyle(int style
) )
59 { SetStyle((wxPenStyle
)style
); }
62 // internal: wxGDIObject methods
63 virtual bool RealizeResource();
64 virtual bool FreeResource(bool force
= false);
65 virtual WXHANDLE
GetResourceHandle() const;
66 virtual bool IsFree() const;
69 virtual wxGDIRefData
* CreateGDIRefData() const;
70 virtual wxGDIRefData
* CloneGDIRefData(const wxGDIRefData
* data
) const;
72 // same as FreeResource() + RealizeResource()
75 DECLARE_DYNAMIC_CLASS(wxPen
)