]>
Commit | Line | Data |
---|---|---|
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 |
cdf1e714 | 7 | // Copyright: (c) David Webster |
65571936 | 8 | // Licence: wxWindows licence |
0e320a79 DW |
9 | ///////////////////////////////////////////////////////////////////////////// |
10 | ||
11 | #ifndef _WX_PEN_H_ | |
12 | #define _WX_PEN_H_ | |
13 | ||
0e320a79 | 14 | #include "wx/gdiobj.h" |
0e320a79 DW |
15 | #include "wx/bitmap.h" |
16 | ||
236a9de3 | 17 | typedef long wxPMDash; |
0e320a79 | 18 | |
1aca6611 | 19 | // ---------------------------------------------------------------------------- |
0e320a79 | 20 | // Pen |
1aca6611 SN |
21 | // ---------------------------------------------------------------------------- |
22 | ||
53a2db12 | 23 | class WXDLLIMPEXP_CORE wxPen : public wxPenBase |
0e320a79 | 24 | { |
0e320a79 | 25 | public: |
1aca6611 | 26 | wxPen() { } |
fd368161 | 27 | wxPen( const wxColour& rColour |
4f535231 | 28 | ,int nWidth = 1 |
82cddbd9 | 29 | ,wxPenStyle nStyle = wxPENSTYLE_SOLID |
fd368161 | 30 | ); |
ac3688c0 FM |
31 | #if FUTURE_WXWIN_COMPATIBILITY_3_0 |
32 | wxDEPRECATED_FUTURE( wxPen(const wxColour& col, int width, int style) ); | |
82cddbd9 FM |
33 | #endif |
34 | ||
fd368161 DW |
35 | wxPen( const wxBitmap& rStipple |
36 | ,int nWidth | |
37 | ); | |
1aca6611 | 38 | virtual ~wxPen() { } |
55ccdb93 | 39 | |
1aca6611 | 40 | bool operator == (const wxPen& rPen) const; |
0e70f525 | 41 | inline bool operator != (const wxPen& rPen) const |
55ccdb93 | 42 | { return !(*this == rPen); } |
fd368161 | 43 | |
fd368161 DW |
44 | // |
45 | // Override in order to recreate the pen | |
46 | // | |
47 | void SetColour(const wxColour& rColour); | |
1a1498c0 | 48 | void SetColour(unsigned char cRed, unsigned char cGreen, unsigned char cBlue); |
fd368161 DW |
49 | |
50 | void SetWidth(int nWidth); | |
82cddbd9 | 51 | void SetStyle(wxPenStyle nStyle); |
fd368161 DW |
52 | void SetStipple(const wxBitmap& rStipple); |
53 | void SetDashes( int nNbDashes | |
54 | ,const wxDash* pDash | |
55 | ); | |
82cddbd9 FM |
56 | void SetJoin(wxPenJoin nJoin); |
57 | void SetCap(wxPenCap nCap); | |
fd368161 DW |
58 | void SetPS(HPS hPS); |
59 | ||
231b9591 | 60 | wxColour GetColour(void) const; |
1aca6611 SN |
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; | |
fd368161 | 70 | |
bc735a68 VZ |
71 | #if FUTURE_WXWIN_COMPATIBILITY_3_0 |
72 | wxDEPRECATED_FUTURE( void SetStyle(int style) ) | |
73 | { SetStyle((wxPenStyle)style); } | |
74 | #endif | |
75 | ||
fd368161 DW |
76 | // |
77 | // Implementation | |
78 | // | |
79 | ||
80 | // | |
81 | // Useful helper: create the brush resource | |
82 | // | |
83 | bool RealizeResource(void); | |
46562151 | 84 | bool FreeResource(bool bForce = false); |
17b1d76b | 85 | virtual WXHANDLE GetResourceHandle(void) const; |
fd368161 | 86 | bool IsFree(void) const; |
fd368161 DW |
87 | |
88 | private: | |
89 | LINEBUNDLE m_vLineBundle; | |
90 | AREABUNDLE m_vAreaBundle; | |
4b3f61d1 SN |
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) | |
fd368161 | 100 | }; // end of CLASS wxPen |
0e320a79 | 101 | |
82cddbd9 | 102 | extern int wx2os2PenStyle(wxPenStyle nWxStyle); |
bd3e41f6 | 103 | |
0e320a79 DW |
104 | #endif |
105 | // _WX_PEN_H_ |