+wxInfoBarGeneric::BarPlacement wxInfoBarGeneric::GetBarPlacement() const
+{
+ wxSizer * const sizer = GetContainingSizer();
+ 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() == self )
+ return BarPlacement_Top;
+ else if ( siblings.GetLast()->GetData()->GetWindow() == self )
+ return BarPlacement_Bottom;
+ else
+ return BarPlacement_Unknown;
+}
+
+wxShowEffect wxInfoBarGeneric::GetShowEffect() const
+{
+ if ( m_showEffect != wxSHOW_EFFECT_MAX )
+ return m_showEffect;
+
+ switch ( GetBarPlacement() )
+ {
+ case BarPlacement_Top:
+ return wxSHOW_EFFECT_SLIDE_TO_BOTTOM;
+
+ case BarPlacement_Bottom:
+ return wxSHOW_EFFECT_SLIDE_TO_TOP;
+
+ default:
+ wxFAIL_MSG( "unknown info bar placement" );
+ // fall through
+
+ case BarPlacement_Unknown:
+ return wxSHOW_EFFECT_NONE;
+ }
+}
+
+wxShowEffect wxInfoBarGeneric::GetHideEffect() const
+{
+ if ( m_hideEffect != wxSHOW_EFFECT_MAX )
+ return m_hideEffect;
+
+ switch ( GetBarPlacement() )
+ {
+ case BarPlacement_Top:
+ return wxSHOW_EFFECT_SLIDE_TO_TOP;
+
+ case BarPlacement_Bottom:
+ return wxSHOW_EFFECT_SLIDE_TO_BOTTOM;
+
+ default:
+ wxFAIL_MSG( "unknown info bar placement" );
+ // fall through
+
+ case BarPlacement_Unknown:
+ return wxSHOW_EFFECT_NONE;
+ }
+}
+