// Author: Vadim Zeitlin
// Modified by:
// Created: Fri Oct 24 10:46:34 MET 1997
-// RCS-ID: $Id$
// Copyright: (c) 1997-2002 wxWidgets team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
private:
// Cannot use
-// DECLARE_NO_COPY_CLASS(wxRegionRefData)
+// wxDECLARE_NO_COPY_CLASS(wxRegionRefData);
// because copy constructor is explicitly declared above;
// but no copy assignment operator is defined, so declare
// it private to prevent the compiler from defining it:
wxRegion::wxRegion()
{
- m_refData = (wxRegionRefData *)NULL;
+ m_refData = NULL;
}
wxRegion::wxRegion(WXHRGN hRegion)
M_REGION = ::CreateRectRgn(rect.x, rect.y, rect.x + rect.width, rect.y + rect.height);
}
-wxRegion::wxRegion(size_t n, const wxPoint *points, int fillStyle)
+wxRegion::wxRegion(size_t n, const wxPoint *points, wxPolygonFillMode fillStyle)
{
#if defined(__WXMICROWIN__) || defined(__WXWINCE__)
wxUnusedVar(n);
// m_refData unrefed in ~wxObject
}
-wxObjectRefData *wxRegion::CreateRefData() const
+wxGDIRefData *wxRegion::CreateGDIRefData() const
{
return new wxRegionRefData;
}
-wxObjectRefData *wxRegion::CloneRefData(const wxObjectRefData *data) const
+wxGDIRefData *wxRegion::CloneGDIRefData(const wxGDIRefData *data) const
{
return new wxRegionRefData(*(wxRegionRefData *)data);
}
bool wxRegion::DoOffset(wxCoord x, wxCoord y)
{
- wxCHECK_MSG( M_REGION, false, _T("invalid wxRegion") );
+ const HRGN hrgn = GetHrgn();
+ wxCHECK_MSG( hrgn, false, wxT("invalid wxRegion") );
if ( !x && !y )
{
AllocExclusive();
- if ( ::OffsetRgn(GetHrgn(), x, y) == ERROR )
+ if ( ::OffsetRgn(hrgn, x, y) == ERROR )
{
- wxLogLastError(_T("OffsetRgn"));
+ wxLogLastError(wxT("OffsetRgn"));
return false;
}
break;
default:
- wxFAIL_MSG( _T("unknown region operation") );
+ wxFAIL_MSG( wxT("unknown region operation") );
// fall through
case wxRGN_AND:
break;
default:
- wxFAIL_MSG( _T("unknown region operation") );
+ wxFAIL_MSG( wxT("unknown region operation") );
// fall through
case wxRGN_COPY:
if ( ::CombineRgn(M_REGION, M_REGION, M_REGION_OF(rgn), mode) == ERROR )
{
- wxLogLastError(_T("CombineRgn"));
+ wxLogLastError(wxT("CombineRgn"));
return false;
}
m_current = 0;
m_region = region;
- if (m_rects)
- {
- delete[] m_rects;
-
- m_rects = NULL;
- }
+ wxDELETEA(m_rects);
if (m_region.Empty())
m_numRects = 0;
wxCoord wxRegionIterator::GetX() const
{
- wxCHECK_MSG( m_current < m_numRects, 0, _T("invalid wxRegionIterator") );
+ wxCHECK_MSG( m_current < m_numRects, 0, wxT("invalid wxRegionIterator") );
return m_rects[m_current].x;
}
wxCoord wxRegionIterator::GetY() const
{
- wxCHECK_MSG( m_current < m_numRects, 0, _T("invalid wxRegionIterator") );
+ wxCHECK_MSG( m_current < m_numRects, 0, wxT("invalid wxRegionIterator") );
return m_rects[m_current].y;
}
wxCoord wxRegionIterator::GetW() const
{
- wxCHECK_MSG( m_current < m_numRects, 0, _T("invalid wxRegionIterator") );
+ wxCHECK_MSG( m_current < m_numRects, 0, wxT("invalid wxRegionIterator") );
return m_rects[m_current].width;
}
wxCoord wxRegionIterator::GetH() const
{
- wxCHECK_MSG( m_current < m_numRects, 0, _T("invalid wxRegionIterator") );
+ wxCHECK_MSG( m_current < m_numRects, 0, wxT("invalid wxRegionIterator") );
return m_rects[m_current].height;
}