1
/////////////////////////////////////////////////////////////////////////////
3
// Purpose: wxPen class
4
// Author: Julian Smart
5
// Modified by: Vadim Zeitlin: fixed operator=(), ==(), !=()
7
// RCS-ID: $Id: pen.h 54273 2008-06-17 17:28:26Z VZ $
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
#if FUTURE_WXWIN_COMPATIBILITY_3_0
59
wxDEPRECATED_FUTURE( void SetStyle(int style) )
60
{ SetStyle((wxPenStyle)style); }
63
// internal: wxGDIObject methods
64
virtual bool RealizeResource();
65
virtual bool FreeResource(bool force = false);
66
virtual WXHANDLE GetResourceHandle() const;
67
virtual bool IsFree() const;
70
virtual wxGDIRefData* CreateGDIRefData() const;
71
virtual wxGDIRefData* CloneGDIRefData(const wxGDIRefData* data) const;
73
// same as FreeResource() + RealizeResource()
76
DECLARE_DYNAMIC_CLASS(wxPen)