]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: wx/os2/pen.h | |
3 | // Purpose: wxPen class | |
4 | // Author: David Webster | |
5 | // Modified by: | |
6 | // Created: 10/10/99 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) David Webster | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_PEN_H_ | |
13 | #define _WX_PEN_H_ | |
14 | ||
15 | #include "wx/gdiobj.h" | |
16 | #include "wx/bitmap.h" | |
17 | ||
18 | typedef long wxPMDash; | |
19 | ||
20 | // ---------------------------------------------------------------------------- | |
21 | // Pen | |
22 | // ---------------------------------------------------------------------------- | |
23 | ||
24 | class WXDLLIMPEXP_CORE wxPen : public wxPenBase | |
25 | { | |
26 | public: | |
27 | wxPen() { } | |
28 | wxPen( const wxColour& rColour | |
29 | ,int nWidth = 1 | |
30 | ,wxPenStyle nStyle = wxPENSTYLE_SOLID | |
31 | ); | |
32 | #if FUTURE_WXWIN_COMPATIBILITY_3_0 | |
33 | wxDEPRECATED_FUTURE( wxPen(const wxColour& col, int width, int style) ); | |
34 | #endif | |
35 | ||
36 | wxPen( const wxBitmap& rStipple | |
37 | ,int nWidth | |
38 | ); | |
39 | virtual ~wxPen() { } | |
40 | ||
41 | bool operator == (const wxPen& rPen) const; | |
42 | inline bool operator != (const wxPen& rPen) const | |
43 | { return !(*this == rPen); } | |
44 | ||
45 | // | |
46 | // Override in order to recreate the pen | |
47 | // | |
48 | void SetColour(const wxColour& rColour); | |
49 | void SetColour(unsigned char cRed, unsigned char cGreen, unsigned char cBlue); | |
50 | ||
51 | void SetWidth(int nWidth); | |
52 | void SetStyle(wxPenStyle nStyle); | |
53 | void SetStipple(const wxBitmap& rStipple); | |
54 | void SetDashes( int nNbDashes | |
55 | ,const wxDash* pDash | |
56 | ); | |
57 | void SetJoin(wxPenJoin nJoin); | |
58 | void SetCap(wxPenCap nCap); | |
59 | void SetPS(HPS hPS); | |
60 | ||
61 | wxColour GetColour(void) const; | |
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; | |
71 | ||
72 | // | |
73 | // Implementation | |
74 | // | |
75 | ||
76 | // | |
77 | // Useful helper: create the brush resource | |
78 | // | |
79 | bool RealizeResource(void); | |
80 | bool FreeResource(bool bForce = false); | |
81 | virtual WXHANDLE GetResourceHandle(void) const; | |
82 | bool IsFree(void) const; | |
83 | ||
84 | private: | |
85 | LINEBUNDLE m_vLineBundle; | |
86 | AREABUNDLE m_vAreaBundle; | |
87 | ||
88 | protected: | |
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) | |
96 | }; // end of CLASS wxPen | |
97 | ||
98 | extern int wx2os2PenStyle(wxPenStyle nWxStyle); | |
99 | ||
100 | #endif | |
101 | // _WX_PEN_H_ |