]> git.saurik.com Git - wxWidgets.git/blame - include/wx/os2/pen.h
add WXWIN_COMPATIBILITY_2_6 block around wxUsleep deprecation; put wxPlatform declara...
[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 71
bc735a68
VZ
72#if FUTURE_WXWIN_COMPATIBILITY_3_0
73 wxDEPRECATED_FUTURE( void SetStyle(int style) )
74 { SetStyle((wxPenStyle)style); }
75#endif
76
fd368161
DW
77 //
78 // Implementation
79 //
80
81 //
82 // Useful helper: create the brush resource
83 //
84 bool RealizeResource(void);
46562151 85 bool FreeResource(bool bForce = false);
17b1d76b 86 virtual WXHANDLE GetResourceHandle(void) const;
fd368161 87 bool IsFree(void) const;
fd368161
DW
88
89private:
90 LINEBUNDLE m_vLineBundle;
91 AREABUNDLE m_vAreaBundle;
4b3f61d1
SN
92
93protected:
94 virtual wxGDIRefData* CreateGDIRefData() const;
95 virtual wxGDIRefData* CloneGDIRefData(const wxGDIRefData* data) const;
96
97 // same as FreeResource() + RealizeResource()
98 bool Recreate();
99
100 DECLARE_DYNAMIC_CLASS(wxPen)
fd368161 101}; // end of CLASS wxPen
0e320a79 102
82cddbd9 103extern int wx2os2PenStyle(wxPenStyle nWxStyle);
bd3e41f6 104
0e320a79
DW
105#endif
106 // _WX_PEN_H_