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