diff --git a/docs/changes.txt b/docs/changes.txt index 9b7329e2e7..bd4bc0f8db 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -441,6 +441,10 @@ All (GUI): - Support float, double and file name values in wxGenericValidator (troelsk). +OSX: + +- Implement wxRegion::Equal() (Dr.Acula). + GTK: - Generate events for two auxiliary mouse buttons in wxGTK (Marcin Wojdyr). diff --git a/src/osx/carbon/region.cpp b/src/osx/carbon/region.cpp index ffd0f106d9..448ae707a9 100644 --- a/src/osx/carbon/region.cpp +++ b/src/osx/carbon/region.cpp @@ -242,11 +242,21 @@ bool wxRegion::DoCombine(const wxRegion& region, wxRegionOp op) //# Information on region //----------------------------------------------------------------------------- -bool wxRegion::DoIsEqual(const wxRegion& WXUNUSED(region)) const +bool wxRegion::DoIsEqual(const wxRegion& region) const { - wxFAIL_MSG( wxT("not implemented") ); + // There doesn't seem to be any native function for checking the equality + // of HIShapes so we compute their differences to determine if they are + // equal. + wxRegion r(this); + r.Subtract(region); - return false; + if ( !r.IsEmpty() ) + return false; + + wxRegion r2(region); + r2.Subtract(*this); + + return r2.IsEmpty(); } // Outer bounds of region