]> git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/pen.h
6f311678e5399d2e933a17a4d4aaee9eac07f6a9
[wxWidgets.git] / include / wx / msw / pen.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/pen.h
3 // Purpose: wxPen class
4 // Author: Julian Smart
5 // Modified by: Vadim Zeitlin: fixed operator=(), ==(), !=()
6 // Created: 01/02/97
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
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/gdicmn.h"
17
18 // ----------------------------------------------------------------------------
19 // Pen
20 // ----------------------------------------------------------------------------
21
22 class WXDLLEXPORT wxPen : public wxPenBase
23 {
24 public:
25 wxPen() { }
26 wxPen(const wxColour& col, int width = 1, wxPenStyle style = wxPENSTYLE_SOLID);
27 #if WXWIN_COMPATIBILITY_2_8
28 wxDEPRECATED( wxPen(const wxColour& col, int width, wxBrushStyle style) );
29 #endif
30
31 wxPen(const wxBitmap& stipple, int width);
32 virtual ~wxPen() { }
33
34 bool operator==(const wxPen& pen) const;
35 bool operator!=(const wxPen& pen) const { return !(*this == pen); }
36
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);
40
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);
47
48 wxColour& GetColour() const;
49 int GetWidth() 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;
57
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;
63
64 protected:
65 virtual wxGDIRefData* CreateGDIRefData() const;
66 virtual wxGDIRefData* CloneGDIRefData(const wxGDIRefData* data) const;
67
68 // same as FreeResource() + RealizeResource()
69 bool Recreate();
70
71 DECLARE_DYNAMIC_CLASS(wxPen)
72 };
73
74 #endif // _WX_PEN_H_