1998-05-20 14:12:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2005-10-04 16:13:42 +00:00
|
|
|
// Name: wx/msw/pen.h
|
1998-05-20 14:12:05 +00:00
|
|
|
// Purpose: wxPen class
|
|
|
|
// Author: Julian Smart
|
2004-02-08 14:20:50 +00:00
|
|
|
// Modified by: Vadim Zeitlin: fixed operator=(), ==(), !=()
|
1998-05-20 14:12:05 +00:00
|
|
|
// Created: 01/02/97
|
1998-08-07 23:52:45 +00:00
|
|
|
// Copyright: (c) Julian Smart
|
2004-08-31 12:38:46 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 14:12:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-07 23:52:45 +00:00
|
|
|
#ifndef _WX_PEN_H_
|
|
|
|
#define _WX_PEN_H_
|
1998-05-20 14:12:05 +00:00
|
|
|
|
|
|
|
#include "wx/gdiobj.h"
|
2007-03-10 23:04:18 +00:00
|
|
|
#include "wx/gdicmn.h"
|
1998-05-20 14:12:05 +00:00
|
|
|
|
2004-02-08 14:20:50 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
1998-05-20 14:12:05 +00:00
|
|
|
// Pen
|
2004-02-08 14:20:50 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2008-03-26 15:06:00 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxPen : public wxPenBase
|
1998-05-20 14:12:05 +00:00
|
|
|
{
|
|
|
|
public:
|
2007-03-13 22:01:27 +00:00
|
|
|
wxPen() { }
|
2008-03-16 21:11:12 +00:00
|
|
|
wxPen(const wxColour& col, int width = 1, wxPenStyle style = wxPENSTYLE_SOLID);
|
2014-01-04 20:07:33 +00:00
|
|
|
#if WXWIN_COMPATIBILITY_3_0
|
|
|
|
wxDEPRECATED( wxPen(const wxColour& col, int width, int style) );
|
2008-03-16 21:11:12 +00:00
|
|
|
#endif
|
|
|
|
|
2004-02-08 14:20:50 +00:00
|
|
|
wxPen(const wxBitmap& stipple, int width);
|
2007-03-13 22:01:27 +00:00
|
|
|
virtual ~wxPen() { }
|
2004-02-08 14:20:50 +00:00
|
|
|
|
2007-03-10 23:04:18 +00:00
|
|
|
bool operator==(const wxPen& pen) const;
|
2004-02-08 14:20:50 +00:00
|
|
|
bool operator!=(const wxPen& pen) const { return !(*this == pen); }
|
|
|
|
|
|
|
|
// Override in order to recreate the pen
|
|
|
|
void SetColour(const wxColour& col);
|
2005-10-04 18:14:41 +00:00
|
|
|
void SetColour(unsigned char r, unsigned char g, unsigned char b);
|
2004-02-08 14:20:50 +00:00
|
|
|
|
|
|
|
void SetWidth(int width);
|
2008-03-16 21:11:12 +00:00
|
|
|
void SetStyle(wxPenStyle style);
|
2004-02-08 14:20:50 +00:00
|
|
|
void SetStipple(const wxBitmap& stipple);
|
|
|
|
void SetDashes(int nb_dashes, const wxDash *dash);
|
2008-03-16 21:11:12 +00:00
|
|
|
void SetJoin(wxPenJoin join);
|
|
|
|
void SetCap(wxPenCap cap);
|
2004-02-08 14:20:50 +00:00
|
|
|
|
2008-03-28 16:47:58 +00:00
|
|
|
wxColour GetColour() const;
|
2007-03-10 23:04:18 +00:00
|
|
|
int GetWidth() const;
|
2008-03-16 21:11:12 +00:00
|
|
|
wxPenStyle GetStyle() const;
|
|
|
|
wxPenJoin GetJoin() const;
|
|
|
|
wxPenCap GetCap() const;
|
2007-03-10 23:04:18 +00:00
|
|
|
int GetDashes(wxDash** ptr) const;
|
|
|
|
wxDash* GetDash() const;
|
|
|
|
int GetDashCount() const;
|
|
|
|
wxBitmap* GetStipple() const;
|
2004-02-08 14:20:50 +00:00
|
|
|
|
2014-01-04 20:07:33 +00:00
|
|
|
#if WXWIN_COMPATIBILITY_3_0
|
|
|
|
wxDEPRECATED( void SetStyle(int style) )
|
2008-06-17 17:28:26 +00:00
|
|
|
{ SetStyle((wxPenStyle)style); }
|
|
|
|
#endif
|
|
|
|
|
2007-03-13 22:01:27 +00:00
|
|
|
// internal: wxGDIObject methods
|
|
|
|
virtual bool RealizeResource();
|
|
|
|
virtual bool FreeResource(bool force = false);
|
|
|
|
virtual WXHANDLE GetResourceHandle() const;
|
|
|
|
virtual bool IsFree() const;
|
2004-02-08 14:20:50 +00:00
|
|
|
|
2007-03-10 23:00:52 +00:00
|
|
|
protected:
|
2007-12-15 17:54:20 +00:00
|
|
|
virtual wxGDIRefData* CreateGDIRefData() const;
|
|
|
|
virtual wxGDIRefData* CloneGDIRefData(const wxGDIRefData* data) const;
|
2007-03-10 23:00:52 +00:00
|
|
|
|
2007-03-13 22:01:27 +00:00
|
|
|
// same as FreeResource() + RealizeResource()
|
|
|
|
bool Recreate();
|
|
|
|
|
2004-02-08 14:20:50 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxPen)
|
1998-05-20 14:12:05 +00:00
|
|
|
};
|
|
|
|
|
2004-02-08 14:20:50 +00:00
|
|
|
#endif // _WX_PEN_H_
|