]>
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 WXDLLEXPORT wxPen
: public wxGDIObject
26 wxPen(const wxColour
& col
, int width
= 1, int style
= wxSOLID
);
27 wxPen(const wxBitmap
& stipple
, int width
);
30 bool operator==(const wxPen
& pen
) const;
31 bool operator!=(const wxPen
& pen
) const { return !(*this == pen
); }
33 virtual bool Ok() const { return IsOk(); }
34 virtual bool IsOk() const { return (m_refData
!= NULL
); }
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(int style
);
42 void SetStipple(const wxBitmap
& stipple
);
43 void SetDashes(int nb_dashes
, const wxDash
*dash
);
44 void SetJoin(int join
);
47 wxColour
& GetColour() const;
52 int GetDashes(wxDash
** ptr
) const;
53 wxDash
* GetDash() const;
54 int GetDashCount() const;
55 wxBitmap
* GetStipple() const;
57 // internal: wxGDIObject methods
58 virtual bool RealizeResource();
59 virtual bool FreeResource(bool force
= false);
60 virtual WXHANDLE
GetResourceHandle() const;
61 virtual bool IsFree() const;
64 virtual wxObjectRefData
* CreateRefData() const;
65 virtual wxObjectRefData
* CloneRefData(const wxObjectRefData
* data
) const;
67 // same as FreeResource() + RealizeResource()
70 DECLARE_DYNAMIC_CLASS(wxPen
)