From 9e87870780586104029acf7b5dd28e26260bdb0f Mon Sep 17 00:00:00 2001 From: Stefan Neis Date: Sun, 26 Feb 2006 16:53:11 +0000 Subject: [PATCH] Added handling of dashes (patch #1438894). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37742 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/os2/pen.h | 13 +++++++++---- src/os2/pen.cpp | 23 ++++------------------- 2 files changed, 13 insertions(+), 23 deletions(-) diff --git a/include/wx/os2/pen.h b/include/wx/os2/pen.h index 0d12294799..900838c450 100644 --- a/include/wx/os2/pen.h +++ b/include/wx/os2/pen.h @@ -33,6 +33,8 @@ protected: int m_nJoin; int m_nCap; wxBitmap m_vStipple; + int m_nbDash; + wxDash * m_dash; wxColour m_vColour; WXHPEN m_hPen;// in OS/2 GPI this will be the PS the pen is associated with }; @@ -83,10 +85,13 @@ public: inline int GetJoin(void) const { return (M_PENDATA ? M_PENDATA->m_nJoin : 0); }; inline int GetCap(void) const { return (M_PENDATA ? M_PENDATA->m_nCap : 0); }; inline int GetPS(void) const { return (M_PENDATA ? M_PENDATA->m_hPen : 0); }; - - int GetDashes(wxDash **ptr) const; - int GetDashCount() const; - wxDash* GetDash() const; + inline int GetDashes(wxDash **ptr) const + { + *ptr = (M_PENDATA ? (wxDash*)M_PENDATA->m_dash : (wxDash*) NULL); + return (M_PENDATA ? M_PENDATA->m_nbDash : 0); + } + inline wxDash* GetDash() const { return (M_PENDATA ? (wxDash*)M_PENDATA->m_dash : (wxDash*)NULL); }; + inline int GetDashCount() const { return (M_PENDATA ? M_PENDATA->m_nbDash : 0); }; inline wxBitmap* GetStipple(void) const { return (M_PENDATA ? (& M_PENDATA->m_vStipple) : (wxBitmap*) NULL); }; diff --git a/src/os2/pen.cpp b/src/os2/pen.cpp index dc99fed02d..712a7293ed 100644 --- a/src/os2/pen.cpp +++ b/src/os2/pen.cpp @@ -32,6 +32,8 @@ wxPenRefData::wxPenRefData() m_nWidth = 1; m_nJoin = wxJOIN_ROUND ; m_nCap = wxCAP_ROUND ; + m_nbDash = 0 ; + m_dash = (wxDash*)NULL; m_hPen = 0L; } // end of wxPenRefData::wxPenRefData @@ -43,6 +45,8 @@ wxPenRefData::wxPenRefData( m_nWidth = rData.m_nWidth; m_nJoin = rData.m_nJoin; m_nCap = rData.m_nCap; + m_nbDash = rData.m_nbDash; + m_dash = rData.m_dash; m_vColour = rData.m_vColour; m_hPen = 0L; } // end of wxPenRefData::wxPenRefData @@ -404,25 +408,6 @@ void wxPen::SetDashes( int WXUNUSED(nNbDashes), // } // end of wxPen::SetDashes -int wxPen::GetDashes( wxDash **ptr ) const -{ - // TODO - *ptr = (wxDash*) NULL; - return 0; -} - -int wxPen::GetDashCount() const -{ - // TODO - return 0; -} - -wxDash* wxPen::GetDash() const -{ - // TODO - return NULL; -} - void wxPen::SetJoin( int nJoin ) -- 2.45.2