From ffa50e73618bab4f57ea423b9178a9c08b44433a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 5 Oct 2009 22:53:57 +0000 Subject: [PATCH] Added wxSHOW_EFFECT_NONE. Calling Show/HideWithEffect() with this effect is the same as calling just the normal Show/Hide(). This is convenient as it allows to use the same API, whether with effects or without them. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62267 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/window.h | 1 + interface/wx/window.h | 7 +++++++ samples/shaped/shaped.cpp | 3 ++- src/msw/window.cpp | 3 +++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/include/wx/window.h b/include/wx/window.h index d85c077433..42a300ef82 100644 --- a/include/wx/window.h +++ b/include/wx/window.h @@ -118,6 +118,7 @@ enum wxWindowVariant // valid values for Show/HideWithEffect() enum wxShowEffect { + wxSHOW_EFFECT_NONE, wxSHOW_EFFECT_ROLL_TO_LEFT, wxSHOW_EFFECT_ROLL_TO_RIGHT, wxSHOW_EFFECT_ROLL_TO_TOP, diff --git a/interface/wx/window.h b/interface/wx/window.h index f14f24f050..c3a1924e3c 100644 --- a/interface/wx/window.h +++ b/interface/wx/window.h @@ -12,6 +12,13 @@ */ enum wxShowEffect { + /** + No effect, equivalent to normal wxWindow::Show() or Hide() call. + + @since 2.9.1 + */ + wxSHOW_EFFECT_NONE, + /// Roll window to the left wxSHOW_EFFECT_ROLL_TO_LEFT, diff --git a/samples/shaped/shaped.cpp b/samples/shaped/shaped.cpp index 6f93d5c8c1..6e9a0d955c 100644 --- a/samples/shaped/shaped.cpp +++ b/samples/shaped/shaped.cpp @@ -181,6 +181,7 @@ private: { static const char *names[] = { + "none", "roll to left", "roll to right", "roll to top", @@ -346,7 +347,7 @@ void MainFrame::OnShowEffect(wxCommandEvent& event) return; } - new EffectFrame(this, eff,1000); + new EffectFrame(this, eff, 1000); } // ---------------------------------------------------------------------------- diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 4316f77e8b..72d9fe96c1 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -724,6 +724,9 @@ wxWindowMSW::MSWShowWithEffect(bool show, wxShowEffect effect, unsigned timeout) { + if ( effect == wxSHOW_EFFECT_NONE ) + return Show(show); + if ( !wxWindowBase::Show(show) ) return false; -- 2.47.2