- public:
-
- wxPen(void);
- wxPen( const wxColour &colour, int width, int style );
- wxPen( const wxString &colourName, int width, int style );
- wxPen( const wxPen& pen );
- wxPen( const wxPen* pen );
- ~wxPen(void);
- wxPen& operator = ( const wxPen& pen );
- bool operator == ( const wxPen& pen );
- bool operator != ( const wxPen& pen );
-
- void SetColour( const wxColour &colour );
- void SetColour( const wxString &colourName );
- void SetColour( int red, int green, int blue );
- void SetCap( int capStyle );
- void SetJoin( int joinStyle );
- void SetStyle( int style );
- void SetWidth( int width );
- wxColour &GetColour(void) const;
- int GetCap(void) const;
- int GetJoin(void) const;
- int GetStyle(void) const;
- int GetWidth(void) const;
- bool Ok(void) const;
-
- // no data :-)
+ // Override in order to recreate the pen
+ void SetColour(const wxColour& col) ;
+ void SetColour(const wxString& col) ;
+ void SetColour(const unsigned char r, const unsigned char g, const unsigned char b) ;
+
+ void SetWidth(int width) ;
+ void SetStyle(int style) ;
+ void SetStipple(const wxBitmap& stipple) ;
+ void SetDashes(int nb_dashes, const wxDash *dash) ;
+ void SetJoin(int join) ;
+ void SetCap(int cap) ;
+
+ inline wxColour& GetColour() const { return (M_PENDATA ? M_PENDATA->m_colour : wxNullColour); };
+ inline int GetWidth() const { return (M_PENDATA ? M_PENDATA->m_width : 0); };
+ inline int GetStyle() const { return (M_PENDATA ? M_PENDATA->m_style : 0); };
+ inline int GetJoin() const { return (M_PENDATA ? M_PENDATA->m_join : 0); };
+ inline int GetCap() const { return (M_PENDATA ? M_PENDATA->m_cap : 0); };
+ inline int GetDashes(wxDash **ptr) const {
+ *ptr = (M_PENDATA ? M_PENDATA->m_dash : NULL); return (M_PENDATA ? M_PENDATA->m_nbDash : 0);
+ }
+
+ inline wxBitmap *GetStipple() const { return (M_PENDATA ? (& M_PENDATA->m_stipple) : NULL); };
+
+// Implementation
+
+ // Useful helper: create the brush resource
+ void RealizeResource();
+
+ // When setting properties, we must make sure we're not changing
+ // another object
+ void Unshare();