m_join == data.m_join &&
m_cap == data.m_cap &&
m_colour == data.m_colour &&
- (m_style != wxSTIPPLE || m_stipple.IsSameAs(data.m_stipple)) &&
- (m_style != wxUSER_DASH ||
+ (m_style != wxPENSTYLE_STIPPLE || m_stipple.IsSameAs(data.m_stipple)) &&
+ (m_style != wxPENSTYLE_USER_DASH ||
(m_nbDash == data.m_nbDash &&
memcmp(m_dash, data.m_dash, m_nbDash*sizeof(wxDash)) == 0));
}
// Only NT can display dashed or dotted lines with width > 1
static const int os = wxGetOsVersion();
if ( os != wxOS_WINDOWS_NT &&
- (m_style == wxDOT ||
- m_style == wxLONG_DASH ||
- m_style == wxSHORT_DASH ||
- m_style == wxDOT_DASH ||
- m_style == wxUSER_DASH) &&
+ (m_style == wxPENSTYLE_DOT ||
+ m_style == wxPENSTYLE_LONG_DASH ||
+ m_style == wxPENSTYLE_SHORT_DASH ||
+ m_style == wxPENSTYLE_DOT_DASH ||
+ m_style == wxPENSTYLE_USER_DASH) &&
m_width > 1 )
{
m_width = 1;
// CreatePen()
if ( m_join == wxJOIN_ROUND &&
m_cap == wxCAP_ROUND &&
- m_style != wxUSER_DASH &&
- m_style != wxSTIPPLE &&
- (m_width <= 1 || m_style == wxSOLID) )
+ m_style != wxPENSTYLE_USER_DASH &&
+ m_style != wxPENSTYLE_STIPPLE &&
+ (m_width <= 1 || m_style == wxPENSTYLE_SOLID) )
#endif // !wxHAVE_EXT_CREATE_PEN
{
m_hPen = ::CreatePen(ConvertPenStyle(m_style), m_width, col);
m_refData = new wxPenRefData(col, width, style);
}
-wxPen::wxPen(const wxColour& colour, int width, wxBrushStyle style)
+#if FUTURE_WXWIN_COMPATIBILITY_3_0
+wxPen::wxPen(const wxColour& colour, int width, int style)
{
m_refData = new wxPenRefData(colour, width, (wxPenStyle)style);
}
+#endif
wxPen::wxPen(const wxBitmap& stipple, int width)
{
M_PENDATA->SetCap(cap);
}
-wxColour& wxPen::GetColour() const
+wxColour wxPen::GetColour() const
{
- return m_refData ? M_PENDATA->GetColour() : wxNullColour;
+ wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid pen") );
+
+ return M_PENDATA->GetColour();
}
int wxPen::GetWidth() const
{
- return m_refData ? M_PENDATA->GetWidth() : 0;
+ wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
+
+ return M_PENDATA->GetWidth();
}
wxPenStyle wxPen::GetStyle() const
{
- return m_refData ? M_PENDATA->GetStyle() : wxPENSTYLE_MAX;
+ wxCHECK_MSG( Ok(), wxPENSTYLE_INVALID, wxT("invalid pen") );
+
+ return M_PENDATA->GetStyle();
}
wxPenJoin wxPen::GetJoin() const
{
- return m_refData ? M_PENDATA->GetJoin() : wxJOIN_INVALID;
+ wxCHECK_MSG( Ok(), wxJOIN_INVALID, wxT("invalid pen") );
+
+ return M_PENDATA->GetJoin();
}
wxPenCap wxPen::GetCap() const
{
- return m_refData ? M_PENDATA->GetCap() : wxCAP_INVALID;
+ wxCHECK_MSG( Ok(), wxCAP_INVALID, wxT("invalid pen") );
+
+ return M_PENDATA->GetCap();
}
int wxPen::GetDashes(wxDash** ptr) const
{
- if ( !m_refData )
- {
- *ptr = NULL;
- return 0;
- }
+ wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
*ptr = M_PENDATA->GetDash();
return M_PENDATA->GetDashCount();
wxDash* wxPen::GetDash() const
{
+ wxCHECK_MSG( Ok(), NULL, wxT("invalid pen") );
+
return m_refData ? M_PENDATA->GetDash() : NULL;
}
int wxPen::GetDashCount() const
{
+ wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
+
return m_refData ? M_PENDATA->GetDashCount() : 0;
}
wxBitmap* wxPen::GetStipple() const
{
+ wxCHECK_MSG( Ok(), NULL, wxT("invalid pen") );
+
return m_refData ? M_PENDATA->GetStipple() : NULL;
}