X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3996b21a7f11ae6c1985b5ee55223ddec537f689..062dfc9a96dc9e796c53544f41ff92dc47f26e82:/src/generic/infobar.cpp diff --git a/src/generic/infobar.cpp b/src/generic/infobar.cpp index 2cc7b5e164..76001a4a17 100644 --- a/src/generic/infobar.cpp +++ b/src/generic/infobar.cpp @@ -3,7 +3,7 @@ // Purpose: generic wxInfoBar implementation // Author: Vadim Zeitlin // Created: 2009-07-28 -// RCS-ID: $Id: wxhead.cpp,v 1.10 2009-06-29 10:23:04 zeitlin Exp $ +// RCS-ID: $Id$ // Copyright: (c) 2009 Vadim Zeitlin // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// @@ -25,20 +25,21 @@ #if wxUSE_INFOBAR +#include "wx/infobar.h" + #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" + #include "wx/sizer.h" #endif // WX_PRECOMP -#include "wx/infobar.h" - #include "wx/artprov.h" #include "wx/renderer.h" #include "wx/scopeguard.h" -#include "wx/sizer.h" BEGIN_EVENT_TABLE(wxInfoBarGeneric, wxInfoBarBase) EVT_BUTTON(wxID_ANY, wxInfoBarGeneric::OnButton) @@ -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(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; @@ -225,7 +229,7 @@ wxShowEffect wxInfoBarGeneric::GetHideEffect() const void wxInfoBarGeneric::UpdateParent() { - wxWindow * const parent = wxGetTopLevelParent(GetParent()); + wxWindow * const parent = GetParent(); parent->Layout(); }