]> git.saurik.com Git - wxWidgets.git/blame - include/wx/os2/pen.h
added wxXmlNode::InsertChildAfter and use it for (much) faster XML parsing (based...
[wxWidgets.git] / include / wx / os2 / pen.h
CommitLineData
0e320a79 1/////////////////////////////////////////////////////////////////////////////
4f535231 2// Name: wx/os2/pen.h
0e320a79 3// Purpose: wxPen class
cdf1e714 4// Author: David Webster
0e320a79 5// Modified by:
cdf1e714 6// Created: 10/10/99
0e320a79 7// RCS-ID: $Id$
cdf1e714 8// Copyright: (c) David Webster
65571936 9// Licence: wxWindows licence
0e320a79
DW
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_PEN_H_
13#define _WX_PEN_H_
14
0e320a79 15#include "wx/gdiobj.h"
0e320a79
DW
16#include "wx/bitmap.h"
17
236a9de3 18typedef long wxPMDash;
0e320a79 19
1aca6611 20// ----------------------------------------------------------------------------
0e320a79 21// Pen
1aca6611
SN
22// ----------------------------------------------------------------------------
23
53a2db12 24class WXDLLIMPEXP_CORE wxPen : public wxPenBase
0e320a79 25{
0e320a79 26public:
1aca6611 27 wxPen() { }
fd368161 28 wxPen( const wxColour& rColour
4f535231 29 ,int nWidth = 1
82cddbd9 30 ,wxPenStyle nStyle = wxPENSTYLE_SOLID
fd368161 31 );
ac3688c0
FM
32#if FUTURE_WXWIN_COMPATIBILITY_3_0
33 wxDEPRECATED_FUTURE( wxPen(const wxColour& col, int width, int style) );
82cddbd9
FM
34#endif
35
fd368161
DW
36 wxPen( const wxBitmap& rStipple
37 ,int nWidth
38 );
1aca6611 39 virtual ~wxPen() { }
55ccdb93 40
1aca6611 41 bool operator == (const wxPen& rPen) const;
0e70f525 42 inline bool operator != (const wxPen& rPen) const
55ccdb93 43 { return !(*this == rPen); }
fd368161 44
fd368161
DW
45 //
46 // Override in order to recreate the pen
47 //
48 void SetColour(const wxColour& rColour);
1a1498c0 49 void SetColour(unsigned char cRed, unsigned char cGreen, unsigned char cBlue);
fd368161
DW
50
51 void SetWidth(int nWidth);
82cddbd9 52 void SetStyle(wxPenStyle nStyle);
fd368161
DW
53 void SetStipple(const wxBitmap& rStipple);
54 void SetDashes( int nNbDashes
55 ,const wxDash* pDash
56 );
82cddbd9
FM
57 void SetJoin(wxPenJoin nJoin);
58 void SetCap(wxPenCap nCap);
fd368161
DW
59 void SetPS(HPS hPS);
60
231b9591 61 wxColour GetColour(void) const;
1aca6611
SN
62 int GetWidth(void) const;
63 wxPenStyle GetStyle(void) const;
64 wxPenJoin GetJoin(void) const;
65 wxPenCap GetCap(void) const;
66 int GetPS(void) const;
67 int GetDashes(wxDash **ptr) const;
68 wxDash* GetDash() const;
69 int GetDashCount() const;
70 wxBitmap* GetStipple(void) const;
fd368161
DW
71
72 //
73 // Implementation
74 //
75
76 //
77 // Useful helper: create the brush resource
78 //
79 bool RealizeResource(void);
46562151 80 bool FreeResource(bool bForce = false);
17b1d76b 81 virtual WXHANDLE GetResourceHandle(void) const;
fd368161 82 bool IsFree(void) const;
fd368161
DW
83
84private:
85 LINEBUNDLE m_vLineBundle;
86 AREABUNDLE m_vAreaBundle;
4b3f61d1
SN
87
88protected:
89 virtual wxGDIRefData* CreateGDIRefData() const;
90 virtual wxGDIRefData* CloneGDIRefData(const wxGDIRefData* data) const;
91
92 // same as FreeResource() + RealizeResource()
93 bool Recreate();
94
95 DECLARE_DYNAMIC_CLASS(wxPen)
fd368161 96}; // end of CLASS wxPen
0e320a79 97
82cddbd9 98extern int wx2os2PenStyle(wxPenStyle nWxStyle);
bd3e41f6 99
0e320a79
DW
100#endif
101 // _WX_PEN_H_