]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: wx/msw/pen.h | |
3 | // Purpose: wxPen class | |
4 | // Author: Julian Smart | |
5 | // Modified by: Vadim Zeitlin: fixed operator=(), ==(), !=() | |
6 | // Created: 01/02/97 | |
7 | // Copyright: (c) Julian Smart | |
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/gdicmn.h" | |
16 | ||
17 | // ---------------------------------------------------------------------------- | |
18 | // Pen | |
19 | // ---------------------------------------------------------------------------- | |
20 | ||
21 | class WXDLLIMPEXP_CORE wxPen : public wxPenBase | |
22 | { | |
23 | public: | |
24 | wxPen() { } | |
25 | wxPen(const wxColour& col, int width = 1, wxPenStyle style = wxPENSTYLE_SOLID); | |
26 | #if FUTURE_WXWIN_COMPATIBILITY_3_0 | |
27 | wxDEPRECATED_FUTURE( wxPen(const wxColour& col, int width, int style) ); | |
28 | #endif | |
29 | ||
30 | wxPen(const wxBitmap& stipple, int width); | |
31 | virtual ~wxPen() { } | |
32 | ||
33 | bool operator==(const wxPen& pen) const; | |
34 | bool operator!=(const wxPen& pen) const { return !(*this == pen); } | |
35 | ||
36 | // Override in order to recreate the pen | |
37 | void SetColour(const wxColour& col); | |
38 | void SetColour(unsigned char r, unsigned char g, unsigned char b); | |
39 | ||
40 | void SetWidth(int width); | |
41 | void SetStyle(wxPenStyle style); | |
42 | void SetStipple(const wxBitmap& stipple); | |
43 | void SetDashes(int nb_dashes, const wxDash *dash); | |
44 | void SetJoin(wxPenJoin join); | |
45 | void SetCap(wxPenCap cap); | |
46 | ||
47 | wxColour GetColour() const; | |
48 | int GetWidth() const; | |
49 | wxPenStyle GetStyle() const; | |
50 | wxPenJoin GetJoin() const; | |
51 | wxPenCap GetCap() const; | |
52 | int GetDashes(wxDash** ptr) const; | |
53 | wxDash* GetDash() const; | |
54 | int GetDashCount() const; | |
55 | wxBitmap* GetStipple() const; | |
56 | ||
57 | #if FUTURE_WXWIN_COMPATIBILITY_3_0 | |
58 | wxDEPRECATED_FUTURE( void SetStyle(int style) ) | |
59 | { SetStyle((wxPenStyle)style); } | |
60 | #endif | |
61 | ||
62 | // internal: wxGDIObject methods | |
63 | virtual bool RealizeResource(); | |
64 | virtual bool FreeResource(bool force = false); | |
65 | virtual WXHANDLE GetResourceHandle() const; | |
66 | virtual bool IsFree() const; | |
67 | ||
68 | protected: | |
69 | virtual wxGDIRefData* CreateGDIRefData() const; | |
70 | virtual wxGDIRefData* CloneGDIRefData(const wxGDIRefData* data) const; | |
71 | ||
72 | // same as FreeResource() + RealizeResource() | |
73 | bool Recreate(); | |
74 | ||
75 | DECLARE_DYNAMIC_CLASS(wxPen) | |
76 | }; | |
77 | ||
78 | #endif // _WX_PEN_H_ |