changed ShowWithEffects() to use directional wxSHOW_EFFECT_XXX flags instead of additional wxDirection argument that doesn't always make sense; this also means the direction is never implicit
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53499 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -732,8 +732,7 @@ bool wxWindowMSW::Show(bool show)
|
||||
bool
|
||||
wxWindowMSW::MSWShowWithEffect(bool show,
|
||||
wxShowEffect effect,
|
||||
unsigned timeout,
|
||||
wxDirection dir)
|
||||
unsigned timeout)
|
||||
{
|
||||
if ( !wxWindowBase::Show(show) )
|
||||
return false;
|
||||
@@ -762,16 +761,39 @@ wxWindowMSW::MSWShowWithEffect(bool show,
|
||||
timeout = 200; // this is the default animation timeout, per MSDN
|
||||
|
||||
DWORD dwFlags = show ? 0 : AW_HIDE;
|
||||
bool needsDir = false;
|
||||
|
||||
switch ( effect )
|
||||
{
|
||||
case wxSHOW_EFFECT_ROLL:
|
||||
needsDir = true;
|
||||
case wxSHOW_EFFECT_ROLL_TO_LEFT:
|
||||
dwFlags |= AW_HOR_NEGATIVE;
|
||||
break;
|
||||
|
||||
case wxSHOW_EFFECT_SLIDE:
|
||||
needsDir = true;
|
||||
dwFlags |= AW_SLIDE;
|
||||
case wxSHOW_EFFECT_ROLL_TO_RIGHT:
|
||||
dwFlags |= AW_HOR_POSITIVE;
|
||||
break;
|
||||
|
||||
case wxSHOW_EFFECT_ROLL_TO_TOP:
|
||||
dwFlags |= AW_VER_NEGATIVE;
|
||||
break;
|
||||
|
||||
case wxSHOW_EFFECT_ROLL_TO_BOTTOM:
|
||||
dwFlags |= AW_VER_POSITIVE;
|
||||
break;
|
||||
|
||||
case wxSHOW_EFFECT_SLIDE_TO_LEFT:
|
||||
dwFlags |= AW_SLIDE | AW_HOR_NEGATIVE;
|
||||
break;
|
||||
|
||||
case wxSHOW_EFFECT_SLIDE_TO_RIGHT:
|
||||
dwFlags |= AW_SLIDE | AW_HOR_POSITIVE;
|
||||
break;
|
||||
|
||||
case wxSHOW_EFFECT_SLIDE_TO_TOP:
|
||||
dwFlags |= AW_SLIDE | AW_VER_NEGATIVE;
|
||||
break;
|
||||
|
||||
case wxSHOW_EFFECT_SLIDE_TO_BOTTOM:
|
||||
dwFlags |= AW_SLIDE | AW_VER_POSITIVE;
|
||||
break;
|
||||
|
||||
case wxSHOW_EFFECT_BLEND:
|
||||
@@ -792,38 +814,6 @@ wxWindowMSW::MSWShowWithEffect(bool show,
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( needsDir )
|
||||
{
|
||||
switch ( dir )
|
||||
{
|
||||
case wxTOP:
|
||||
dwFlags |= AW_VER_NEGATIVE;
|
||||
break;
|
||||
|
||||
case wxBOTTOM:
|
||||
dwFlags |= AW_VER_POSITIVE;
|
||||
break;
|
||||
|
||||
case wxLEFT:
|
||||
dwFlags |= AW_HOR_NEGATIVE;
|
||||
break;
|
||||
|
||||
case wxRIGHT:
|
||||
dwFlags |= AW_HOR_POSITIVE;
|
||||
break;
|
||||
|
||||
default:
|
||||
wxFAIL_MSG( _T("unknown window effect direction") );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else // animation effect which doesn't need the direction
|
||||
{
|
||||
wxASSERT_MSG( dir == wxBOTTOM,
|
||||
_T("non-default direction used unnecessarily") );
|
||||
}
|
||||
|
||||
|
||||
if ( !(*s_pfnAnimateWindow)(GetHwnd(), timeout, dwFlags) )
|
||||
{
|
||||
wxLogLastError(_T("AnimateWindow"));
|
||||
|
Reference in New Issue
Block a user