]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/gdicmn.cpp
don't crash on weird line endings like \r\r\n
[wxWidgets.git] / src / common / gdicmn.cpp
index a81555a5cc105b8c7afb3a67fcb02eca8772a798..1146416f61b28e9d413a9eb9ec419b1ab11a1033 100644 (file)
@@ -17,6 +17,7 @@
 #endif
 
 #include "wx/gdicmn.h"
+#include "wx/gdiobj.h"
 
 #ifndef WX_PRECOMP
     #include "wx/log.h"
     #include "wx/settings.h"
     #include "wx/bitmap.h"
     #include "wx/colour.h"
+    #include "wx/font.h"
 #endif
 
-#include "wx/font.h"
+
+IMPLEMENT_DYNAMIC_CLASS(wxGDIObject, wxObject)
+
 
 WXDLLIMPEXP_DATA_CORE(wxBrushList*) wxTheBrushList;
 WXDLLIMPEXP_DATA_CORE(wxFontList*)  wxTheFontList;
@@ -179,7 +183,7 @@ wxRect& wxRect::Inflate(wxCoord dx, wxCoord dy)
     return *this;
 }
 
-bool wxRect::Inside(int cx, int cy) const
+bool wxRect::Contains(int cx, int cy) const
 {
     return ( (cx >= x) && (cy >= y)
           && ((cy - y) < height)
@@ -187,6 +191,11 @@ bool wxRect::Inside(int cx, int cy) const
           );
 }
 
+bool wxRect::Contains(const wxRect& rect) const
+{
+    return Contains(rect.GetTopLeft()) && Contains(rect.GetBottomRight());
+}
+
 wxRect& wxRect::Intersect(const wxRect& rect)
 {
     int x2 = GetRight(),