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