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