// Author: David Webster
// Modified by:
// Created: 10/10/99
-// RCS-ID: $Id$
// Copyright: (c) David Webster
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
wxColour m_vColour;
WXHPEN m_hPen;// in OS/2 GPI this will be the PS the pen is associated with
- DECLARE_NO_ASSIGN_CLASS(wxPenRefData)
+ wxDECLARE_NO_ASSIGN_CLASS(wxPenRefData);
};
#define M_PENDATA ((wxPenRefData *)m_refData)
RealizeResource();
} // end of wxPen::wxPen
+bool wxPen::operator==(const wxPen& pen) const
+{
+ const wxPenRefData *
+ penData = static_cast<const wxPenRefData *>(pen.m_refData);
+
+ // an invalid pen is only equal to another invalid pen
+ return m_refData ? penData && *M_PENDATA == *penData : !penData;
+}
+
int wx2os2PenStyle(
wxPenStyle nWxStyle
);
{
vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError);
- wxLogError(_T("Unable to set current color table to RGB mode. Error: %s\n"), sError.c_str());
+ wxLogError(wxT("Unable to set current color table to RGB mode. Error: %s\n"), sError.c_str());
return false;
}
if (M_PENDATA->m_nStyle == wxPENSTYLE_TRANSPARENT)
{
vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError);
- wxLogError(_T("Can't set Gpi attributes for a LINEBUNDLE. Error: %s\n"), sError.c_str());
+ wxLogError(wxT("Can't set Gpi attributes for a LINEBUNDLE. Error: %s\n"), sError.c_str());
return false;
}
{
vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError);
- wxLogError(_T("Can't set Gpi attributes for an AREABUNDLE. Error: %s\n"), sError.c_str());
+ wxLogError(wxT("Can't set Gpi attributes for an AREABUNDLE. Error: %s\n"), sError.c_str());
}
return (bool)bOk;
wxGDIRefData* wxPen::CloneGDIRefData(const wxGDIRefData* data) const
{
- return new wxPenRefData(*wx_static_cast(const wxPenRefData*, data));
+ return new wxPenRefData(*static_cast<const wxPenRefData*>(data));
}
void wxPen::SetColour( const wxColour& rColour )
RealizeResource();
} // end of wxPen::SetCap
-wxColour& wxPen::GetColour() const
+wxColour wxPen::GetColour() const
{
- wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid pen") );
return M_PENDATA->m_vColour;
}
int wxPen::GetWidth() const
{
- wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") );
return M_PENDATA->m_nWidth;
}
wxPenStyle wxPen::GetStyle() const
{
- wxCHECK_MSG( Ok(), wxPENSTYLE_INVALID, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), wxPENSTYLE_INVALID, wxT("invalid pen") );
return M_PENDATA->m_nStyle;
}
wxPenJoin wxPen::GetJoin() const
{
- wxCHECK_MSG( Ok(), wxJOIN_INVALID, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), wxJOIN_INVALID, wxT("invalid pen") );
return M_PENDATA->m_nJoin;
}
wxPenCap wxPen::GetCap() const
{
- wxCHECK_MSG( Ok(), wxCAP_INVALID, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), wxCAP_INVALID, wxT("invalid pen") );
return M_PENDATA->m_nCap;
}
int wxPen::GetPS() const
{
- wxCHECK_MSG( Ok(), 0, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), 0, wxT("invalid pen") );
return M_PENDATA->m_hPen;
}
int wxPen::GetDashes(wxDash** ptr) const
{
- wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") );
*ptr = M_PENDATA->m_dash;
return M_PENDATA->m_nbDash;
wxDash* wxPen::GetDash() const
{
- wxCHECK_MSG( Ok(), NULL, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid pen") );
return M_PENDATA->m_dash;
}
int wxPen::GetDashCount() const
{
- wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") );
return M_PENDATA->m_nbDash;
}
wxBitmap* wxPen::GetStipple() const
{
- wxCHECK_MSG( Ok(), NULL, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid pen") );
return &(M_PENDATA->m_vStipple);
}