]>
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 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Julian Smart | |
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/gdicmn.h" | |
17 | ||
18 | // ---------------------------------------------------------------------------- | |
19 | // Pen | |
20 | // ---------------------------------------------------------------------------- | |
21 | ||
22 | class WXDLLEXPORT wxPen : public wxGDIObject | |
23 | { | |
24 | public: | |
25 | wxPen() { } | |
26 | wxPen(const wxColour& col, int width = 1, int style = wxSOLID); | |
27 | wxPen(const wxBitmap& stipple, int width); | |
28 | virtual ~wxPen() { } | |
29 | ||
30 | bool operator==(const wxPen& pen) const; | |
31 | bool operator!=(const wxPen& pen) const { return !(*this == pen); } | |
32 | ||
33 | // Override in order to recreate the pen | |
34 | void SetColour(const wxColour& col); | |
35 | void SetColour(unsigned char r, unsigned char g, unsigned char b); | |
36 | ||
37 | void SetWidth(int width); | |
38 | void SetStyle(int style); | |
39 | void SetStipple(const wxBitmap& stipple); | |
40 | void SetDashes(int nb_dashes, const wxDash *dash); | |
41 | void SetJoin(int join); | |
42 | void SetCap(int cap); | |
43 | ||
44 | wxColour& GetColour() const; | |
45 | int GetWidth() const; | |
46 | int GetStyle() const; | |
47 | int GetJoin() const; | |
48 | int GetCap() const; | |
49 | int GetDashes(wxDash** ptr) const; | |
50 | wxDash* GetDash() const; | |
51 | int GetDashCount() const; | |
52 | wxBitmap* GetStipple() const; | |
53 | ||
54 | // internal: wxGDIObject methods | |
55 | virtual bool RealizeResource(); | |
56 | virtual bool FreeResource(bool force = false); | |
57 | virtual WXHANDLE GetResourceHandle() const; | |
58 | virtual bool IsFree() const; | |
59 | ||
60 | protected: | |
61 | virtual wxGDIRefData* CreateGDIRefData() const; | |
62 | virtual wxGDIRefData* CloneGDIRefData(const wxGDIRefData* data) const; | |
63 | ||
64 | // same as FreeResource() + RealizeResource() | |
65 | bool Recreate(); | |
66 | ||
67 | DECLARE_DYNAMIC_CLASS(wxPen) | |
68 | }; | |
69 | ||
70 | #endif // _WX_PEN_H_ |