]> git.saurik.com Git - wxWidgets.git/commitdiff
added wxWindow::IsVisible() method
authorVáclav Slavík <vslavik@fastmail.fm>
Sun, 10 Sep 2006 15:38:54 +0000 (15:38 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Sun, 10 Sep 2006 15:38:54 +0000 (15:38 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41130 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/latex/wx/window.tex
include/wx/toplevel.h
include/wx/window.h
src/common/wincmn.cpp

index cd9326c4f0879c491af89e6524b2b8d942e9be47..581aa4be0024627276b8321ceee588cc2b457468 100644 (file)
@@ -1546,6 +1546,10 @@ Retained windows are only available on X platforms.
 
 Returns {\tt true} if the window is shown, {\tt false} if it has been hidden.
 
+\wxheading{See also}
+
+\helpref{wxWindow::IsVisible}{wxwindowisvisible}
+
 
 \membersection{wxWindow::IsTopLevel}\label{wxwindowistoplevel}
 
@@ -1556,6 +1560,18 @@ dialogs are considered to be top-level windows (even if they have a parent
 window).
 
 
+\membersection{wxWindow::IsVisible}\label{wxwindowisvisible}
+
+\constfunc{virtual bool}{IsVisible}{\void}
+
+Returns {\tt true} if the window is physically visible on the screen, i.e. it
+is shown and all its parents up to the toplevel window are shown as well.
+
+\wxheading{See also}
+
+\helpref{wxWindow::IsShown}{wxwindowisshown}
+
+
 \membersection{wxWindow::Layout}\label{wxwindowlayout}
 
 \func{void}{Layout}{\void}
index b90c1a65840046581204b80b7ea6a9f538ac17ec..fee628786c0b867a54eced821e5af6101f642e81 100644 (file)
@@ -229,6 +229,7 @@ public:
     // override some base class virtuals
     virtual bool Destroy();
     virtual bool IsTopLevel() const { return true; }
+    virtual bool IsVisible() const { return IsShown(); }
     virtual wxSize GetMaxSize() const;
 
     // event handlers
index e0b685a11021372884495d5a4376711533ee274e..7a20dcb81a9ae34993f16e91d00d84d89536f769 100644 (file)
@@ -479,6 +479,10 @@ public:
     virtual bool IsShown() const { return m_isShown; }
     virtual bool IsEnabled() const { return m_isEnabled; }
 
+    // returns true if the window is visible, i.e. IsShown() returns true
+    // if called on it and all its parents up to the first TLW
+    virtual bool IsVisible() const;
+
         // get/set window style (setting style won't update the window and so
         // is only useful for internal usage)
     virtual void SetWindowStyleFlag( long style ) { m_windowStyle = style; }
index a75b82f1dac90fc2d49af02f67c534b17e8872f8..08acc6455611c39795706be6284c33bf42e550cb 100644 (file)
@@ -744,6 +744,12 @@ bool wxWindowBase::Enable(bool enable)
         return false;
     }
 }
+
+bool wxWindowBase::IsVisible() const
+{
+    return IsShown() && (GetParent() == NULL || GetParent()->IsVisible());
+}
+
 // ----------------------------------------------------------------------------
 // RTTI
 // ----------------------------------------------------------------------------