1999-07-29 01:11:30 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2003-07-21 15:39:34 -04:00
|
|
|
// Name: wx/os2/pen.h
|
1999-07-29 01:11:30 -04:00
|
|
|
// Purpose: wxPen class
|
1999-10-12 18:49:24 -04:00
|
|
|
// Author: David Webster
|
1999-07-29 01:11:30 -04:00
|
|
|
// Modified by:
|
1999-10-12 18:49:24 -04:00
|
|
|
// Created: 10/10/99
|
1999-07-29 01:11:30 -04:00
|
|
|
// RCS-ID: $Id$
|
1999-10-12 18:49:24 -04:00
|
|
|
// Copyright: (c) David Webster
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1999-07-29 01:11:30 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_PEN_H_
|
|
|
|
#define _WX_PEN_H_
|
|
|
|
|
|
|
|
#include "wx/gdiobj.h"
|
|
|
|
#include "wx/bitmap.h"
|
|
|
|
|
2000-03-13 09:34:35 -05:00
|
|
|
typedef long wxPMDash;
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2008-03-23 13:41:16 -04:00
|
|
|
// ----------------------------------------------------------------------------
|
1999-07-29 01:11:30 -04:00
|
|
|
// Pen
|
2008-03-23 13:41:16 -04:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxPen : public wxPenBase
|
1999-07-29 01:11:30 -04:00
|
|
|
{
|
|
|
|
public:
|
2008-03-23 13:41:16 -04:00
|
|
|
wxPen() { }
|
2000-11-27 15:01:19 -05:00
|
|
|
wxPen( const wxColour& rColour
|
2003-07-21 15:39:34 -04:00
|
|
|
,int nWidth = 1
|
2008-03-16 17:11:12 -04:00
|
|
|
,wxPenStyle nStyle = wxPENSTYLE_SOLID
|
2000-11-27 15:01:19 -05:00
|
|
|
);
|
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
|
|
|
|
|
2000-11-27 15:01:19 -05:00
|
|
|
wxPen( const wxBitmap& rStipple
|
|
|
|
,int nWidth
|
|
|
|
);
|
2008-03-23 13:41:16 -04:00
|
|
|
virtual ~wxPen() { }
|
2006-10-30 14:26:48 -05:00
|
|
|
|
2008-03-23 13:41:16 -04:00
|
|
|
bool operator == (const wxPen& rPen) const;
|
2004-05-09 13:30:57 -04:00
|
|
|
inline bool operator != (const wxPen& rPen) const
|
2006-10-30 14:26:48 -05:00
|
|
|
{ return !(*this == rPen); }
|
2000-11-27 15:01:19 -05:00
|
|
|
|
|
|
|
//
|
|
|
|
// Override in order to recreate the pen
|
|
|
|
//
|
|
|
|
void SetColour(const wxColour& rColour);
|
2005-10-04 14:14:41 -04:00
|
|
|
void SetColour(unsigned char cRed, unsigned char cGreen, unsigned char cBlue);
|
2000-11-27 15:01:19 -05:00
|
|
|
|
|
|
|
void SetWidth(int nWidth);
|
2008-03-16 17:11:12 -04:00
|
|
|
void SetStyle(wxPenStyle nStyle);
|
2000-11-27 15:01:19 -05:00
|
|
|
void SetStipple(const wxBitmap& rStipple);
|
|
|
|
void SetDashes( int nNbDashes
|
|
|
|
,const wxDash* pDash
|
|
|
|
);
|
2008-03-16 17:11:12 -04:00
|
|
|
void SetJoin(wxPenJoin nJoin);
|
|
|
|
void SetCap(wxPenCap nCap);
|
2000-11-27 15:01:19 -05:00
|
|
|
void SetPS(HPS hPS);
|
|
|
|
|
2008-03-28 12:47:58 -04:00
|
|
|
wxColour GetColour(void) const;
|
2008-03-23 13:41:16 -04:00
|
|
|
int GetWidth(void) const;
|
|
|
|
wxPenStyle GetStyle(void) const;
|
|
|
|
wxPenJoin GetJoin(void) const;
|
|
|
|
wxPenCap GetCap(void) const;
|
|
|
|
int GetPS(void) const;
|
|
|
|
int GetDashes(wxDash **ptr) const;
|
|
|
|
wxDash* GetDash() const;
|
|
|
|
int GetDashCount() const;
|
|
|
|
wxBitmap* GetStipple(void) const;
|
2000-11-27 15:01:19 -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
|
|
|
|
|
2000-11-27 15:01:19 -05:00
|
|
|
//
|
|
|
|
// Implementation
|
|
|
|
//
|
|
|
|
|
|
|
|
//
|
|
|
|
// Useful helper: create the brush resource
|
|
|
|
//
|
|
|
|
bool RealizeResource(void);
|
2005-10-04 12:13:42 -04:00
|
|
|
bool FreeResource(bool bForce = false);
|
2006-10-23 07:58:28 -04:00
|
|
|
virtual WXHANDLE GetResourceHandle(void) const;
|
2000-11-27 15:01:19 -05:00
|
|
|
bool IsFree(void) const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
LINEBUNDLE m_vLineBundle;
|
|
|
|
AREABUNDLE m_vAreaBundle;
|
2008-01-12 10:05:15 -05:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual wxGDIRefData* CreateGDIRefData() const;
|
|
|
|
virtual wxGDIRefData* CloneGDIRefData(const wxGDIRefData* data) const;
|
|
|
|
|
|
|
|
// same as FreeResource() + RealizeResource()
|
|
|
|
bool Recreate();
|
|
|
|
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxPen)
|
2000-11-27 15:01:19 -05:00
|
|
|
}; // end of CLASS wxPen
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2008-03-16 17:11:12 -04:00
|
|
|
extern int wx2os2PenStyle(wxPenStyle nWxStyle);
|
2000-11-27 16:26:12 -05:00
|
|
|
|
1999-07-29 01:11:30 -04:00
|
|
|
#endif
|
|
|
|
// _WX_PEN_H_
|