]>
Commit | Line | Data |
---|---|---|
2bda0e17 | 1 | ///////////////////////////////////////////////////////////////////////////// |
46562151 | 2 | // Name: wx/msw/pen.h |
2bda0e17 KB |
3 | // Purpose: wxPen class |
4 | // Author: Julian Smart | |
5c57bf07 | 5 | // Modified by: Vadim Zeitlin: fixed operator=(), ==(), !=() |
2bda0e17 KB |
6 | // Created: 01/02/97 |
7 | // RCS-ID: $Id$ | |
bbcdf8bc | 8 | // Copyright: (c) Julian Smart |
078cf5cb | 9 | // Licence: wxWindows licence |
2bda0e17 KB |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
bbcdf8bc JS |
12 | #ifndef _WX_PEN_H_ |
13 | #define _WX_PEN_H_ | |
2bda0e17 | 14 | |
2bda0e17 | 15 | #include "wx/gdiobj.h" |
ce3b4b90 | 16 | #include "wx/gdicmn.h" |
2bda0e17 | 17 | |
5c57bf07 | 18 | // ---------------------------------------------------------------------------- |
2bda0e17 | 19 | // Pen |
5c57bf07 VZ |
20 | // ---------------------------------------------------------------------------- |
21 | ||
53a2db12 | 22 | class WXDLLIMPEXP_CORE wxPen : public wxPenBase |
2bda0e17 | 23 | { |
2bda0e17 | 24 | public: |
8c583381 | 25 | wxPen() { } |
82cddbd9 | 26 | wxPen(const wxColour& col, int width = 1, wxPenStyle style = wxPENSTYLE_SOLID); |
ac3688c0 FM |
27 | #if FUTURE_WXWIN_COMPATIBILITY_3_0 |
28 | wxDEPRECATED_FUTURE( wxPen(const wxColour& col, int width, int style) ); | |
82cddbd9 FM |
29 | #endif |
30 | ||
5c57bf07 | 31 | wxPen(const wxBitmap& stipple, int width); |
8c583381 | 32 | virtual ~wxPen() { } |
5c57bf07 | 33 | |
ce3b4b90 | 34 | bool operator==(const wxPen& pen) const; |
5c57bf07 VZ |
35 | bool operator!=(const wxPen& pen) const { return !(*this == pen); } |
36 | ||
5c57bf07 VZ |
37 | // Override in order to recreate the pen |
38 | void SetColour(const wxColour& col); | |
1a1498c0 | 39 | void SetColour(unsigned char r, unsigned char g, unsigned char b); |
5c57bf07 VZ |
40 | |
41 | void SetWidth(int width); | |
82cddbd9 | 42 | void SetStyle(wxPenStyle style); |
5c57bf07 VZ |
43 | void SetStipple(const wxBitmap& stipple); |
44 | void SetDashes(int nb_dashes, const wxDash *dash); | |
82cddbd9 FM |
45 | void SetJoin(wxPenJoin join); |
46 | void SetCap(wxPenCap cap); | |
5c57bf07 | 47 | |
231b9591 | 48 | wxColour GetColour() const; |
ce3b4b90 | 49 | int GetWidth() const; |
82cddbd9 FM |
50 | wxPenStyle GetStyle() const; |
51 | wxPenJoin GetJoin() const; | |
52 | wxPenCap GetCap() const; | |
ce3b4b90 PC |
53 | int GetDashes(wxDash** ptr) const; |
54 | wxDash* GetDash() const; | |
55 | int GetDashCount() const; | |
56 | wxBitmap* GetStipple() const; | |
5c57bf07 | 57 | |
8c583381 VZ |
58 | // internal: wxGDIObject methods |
59 | virtual bool RealizeResource(); | |
60 | virtual bool FreeResource(bool force = false); | |
61 | virtual WXHANDLE GetResourceHandle() const; | |
62 | virtual bool IsFree() const; | |
5c57bf07 | 63 | |
7c310bc8 | 64 | protected: |
8f884a0d VZ |
65 | virtual wxGDIRefData* CreateGDIRefData() const; |
66 | virtual wxGDIRefData* CloneGDIRefData(const wxGDIRefData* data) const; | |
7c310bc8 | 67 | |
8c583381 VZ |
68 | // same as FreeResource() + RealizeResource() |
69 | bool Recreate(); | |
70 | ||
5c57bf07 | 71 | DECLARE_DYNAMIC_CLASS(wxPen) |
2bda0e17 KB |
72 | }; |
73 | ||
5c57bf07 | 74 | #endif // _WX_PEN_H_ |