From d317fdebc3d51c4bf17e89b558ff1a6538bf225c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 21 Jun 2008 16:17:13 +0000 Subject: [PATCH] add wxShowEvent::IsShown() and wxIconizeEvent::IsIconized() instead of (now deprecated) GetShow() and Iconized() respectively (#978) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54320 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/event.h | 13 +++++++++-- interface/event.h | 53 ++++++++++++++++++++++++++++++++++++++++++++ interface/toplevel.h | 2 +- interface/window.h | 2 +- 4 files changed, 66 insertions(+), 4 deletions(-) diff --git a/include/wx/event.h b/include/wx/event.h index 9fc7828003..0f9ee90215 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -1366,7 +1366,13 @@ public: { m_show = event.m_show; } void SetShow(bool show) { m_show = show; } - bool GetShow() const { return m_show; } + + // return true if the window was shown, false if hidden + bool IsShown() const { return m_show; } + +#ifdef WXWIN_COMPATIBILITY_2_8 + wxDEPRECATED( bool GetShow() const { return IsShown(); } ) +#endif virtual wxEvent *Clone() const { return new wxShowEvent(*this); } @@ -1391,8 +1397,11 @@ public: : wxEvent(event) { m_iconized = event.m_iconized; } +#ifdef WXWIN_COMPATIBILITY_2_8 + wxDEPRECATED( bool Iconized() const { return IsIconized(); } ) +#endif // return true if the frame was iconized, false if restored - bool Iconized() const { return m_iconized; } + bool IsIconized() const { return m_iconized; } virtual wxEvent *Clone() const { return new wxIconizeEvent(*this); } diff --git a/interface/event.h b/interface/event.h index 425d360c82..8c051f00d8 100644 --- a/interface/event.h +++ b/interface/event.h @@ -3115,6 +3115,54 @@ public: bool IsPopup() const; }; +/** + @class wxShowEvent + @wxheader{event.h} + + An event being sent when the window is shown or hidden. + + Currently only wxMSW, wxGTK and wxOS2 generate such events. + + @onlyfor{wxmsw,wxgtk,wxos2} + + @beginEventTable{wxShowEvent} + @event{EVT_SHOW(func)} + Process a wxEVT_SHOW event. + @endEventTable + + @library{wxcore} + @category{events} + + @see @ref overview_eventhandling, wxWindow::Show, + wxWindow::IsShown +*/ + +class wxShowEvent : public wxEvent +{ +public: + /** + Constructor. + */ + wxShowEvent(int winid = 0, bool show = false); + + /** + Set whether the windows was shown or hidden. + */ + void SetShow(bool show); + + /** + Return @true if the window has been shown, @false if it has been + hidden. + */ + bool IsShown() const; + + /** + @deprecated This function is deprecated in favour of IsShown(). + */ + bool GetShow() const; +}; + + /** @class wxIconizeEvent @@ -3149,6 +3197,11 @@ public: Returns @true if the frame has been iconized, @false if it has been restored. */ + bool IsIconized() const; + + /** + @deprecated This function is deprecated in favour of IsIconized(). + */ bool Iconized() const; }; diff --git a/interface/toplevel.h b/interface/toplevel.h index e87b3b31a3..f0432e2e68 100644 --- a/interface/toplevel.h +++ b/interface/toplevel.h @@ -132,7 +132,7 @@ public: @param iconize If @true, iconizes the window; if @false, shows and restores it. - @see IsIconized(), Maximize(). + @see IsIconized(), Maximize(), wxIconizeEvent. */ void Iconize(bool iconize); diff --git a/interface/window.h b/interface/window.h index 30102c6bab..2161f7dda8 100644 --- a/interface/window.h +++ b/interface/window.h @@ -2429,7 +2429,7 @@ public: @return @true if the window has been shown or hidden or @false if nothing was done because it already was in the requested state. - @see IsShown(), Hide(), wxRadioBox::Show + @see IsShown(), Hide(), wxRadioBox::Show, wxShowEvent. */ virtual bool Show(bool show = true); -- 2.45.2