]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/infobar.cpp
Fix discrepancy between different ways of measuring text extents under Mac.
[wxWidgets.git] / src / generic / infobar.cpp
index 2cc7b5e164230ac41367b12e0e936c3a7c756196..5f6c948bb01c5a410746e124fd0cdf59cfc5586e 100644 (file)
@@ -28,6 +28,7 @@
 #ifndef WX_PRECOMP
     #include "wx/bmpbuttn.h"
     #include "wx/button.h"
+    #include "wx/dcmemory.h"
     #include "wx/settings.h"
     #include "wx/statbmp.h"
     #include "wx/stattext.h"
@@ -170,10 +171,13 @@ wxInfoBarGeneric::BarPlacement wxInfoBarGeneric::GetBarPlacement() const
     if ( !sizer )
         return BarPlacement_Unknown;
 
+    // FIXME-VC6: can't compare "const wxInfoBarGeneric *" and "wxWindow *",
+    //            so need this workaround
+    wxWindow * const self = const_cast<wxInfoBarGeneric *>(this);
     const wxSizerItemList& siblings = sizer->GetChildren();
-    if ( siblings.GetFirst()->GetData()->GetWindow() == this )
+    if ( siblings.GetFirst()->GetData()->GetWindow() == self )
         return BarPlacement_Top;
-    else if ( siblings.GetLast()->GetData()->GetWindow() == this )
+    else if ( siblings.GetLast()->GetData()->GetWindow() == self )
         return BarPlacement_Bottom;
     else
         return BarPlacement_Unknown;