From 6b30a44ed0be21bd0cf26f609d4ca50fb8b965c0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 26 Sep 2004 14:32:09 +0000 Subject: [PATCH] renamed HasFocus() to IsActive() to avoid confusion with FindFocus(); documented it; avoid code duplication in GTK1 version git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29401 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 1 + docs/latex/wx/tlw.tex | 8 ++++++++ include/wx/gtk/toplevel.h | 2 +- include/wx/gtk1/toplevel.h | 2 +- include/wx/toplevel.h | 2 +- src/gtk/toplevel.cpp | 5 ++--- src/gtk1/toplevel.cpp | 5 ++--- 7 files changed, 16 insertions(+), 9 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 532d802b88..d4d7ecdd34 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -241,6 +241,7 @@ All (GUI): - the XRC contrib library was moved to the core - wx(Choice/List/Note)book controls send CHANG(ED/ING) events in SetSelection - it is now possible to create a wxFont with given size in pixels (d2walter) +- added wxTopLevelWindow::IsActive() Unix: diff --git a/docs/latex/wx/tlw.tex b/docs/latex/wx/tlw.tex index 17404418fe..be43aa4c93 100644 --- a/docs/latex/wx/tlw.tex +++ b/docs/latex/wx/tlw.tex @@ -67,6 +67,14 @@ Gets a string containing the window title. See \helpref{wxTopLevelWindow::SetTitle}{wxtoplevelwindowsettitle}. +\membersection{wxTopLevelWindow::IsActive}\label{wxtoplevelwindowisactive} + +\constfunc{bool}{IsActive}{\void} + +Returns \true if this window is currently active, i.e. if the user is currently +working with it. + + \membersection{wxTopLevelWindow::Iconize}\label{wxtoplevelwindowiconize} \func{void}{Iconize}{\param{bool}{ iconize}} diff --git a/include/wx/gtk/toplevel.h b/include/wx/gtk/toplevel.h index c55ec91352..0e6dce8801 100644 --- a/include/wx/gtk/toplevel.h +++ b/include/wx/gtk/toplevel.h @@ -64,7 +64,7 @@ public: virtual bool Show(bool show = TRUE); - virtual bool HasFocus(); + virtual bool IsActive(); virtual void SetTitle( const wxString &title ); virtual wxString GetTitle() const { return m_title; } diff --git a/include/wx/gtk1/toplevel.h b/include/wx/gtk1/toplevel.h index c55ec91352..0e6dce8801 100644 --- a/include/wx/gtk1/toplevel.h +++ b/include/wx/gtk1/toplevel.h @@ -64,7 +64,7 @@ public: virtual bool Show(bool show = TRUE); - virtual bool HasFocus(); + virtual bool IsActive(); virtual void SetTitle( const wxString &title ); virtual wxString GetTitle() const { return m_title; } diff --git a/include/wx/toplevel.h b/include/wx/toplevel.h index 89fcba6c0d..a18741217d 100644 --- a/include/wx/toplevel.h +++ b/include/wx/toplevel.h @@ -176,7 +176,7 @@ public: virtual void RequestUserAttention(int flags = wxUSER_ATTENTION_INFO); // Is this the active frame (highlighted in the taskbar)? - virtual bool HasFocus() + virtual bool IsActive() { return (wxGetTopLevelParent(FindFocus()) == this); } // implementation only from now on diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index d5fff696dd..4b737edd73 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -1067,13 +1067,12 @@ bool wxTopLevelWindowGTK::SetShape(const wxRegion& region) return do_shape_combine_region(window, region); } -bool wxTopLevelWindowGTK::HasFocus() +bool wxTopLevelWindowGTK::IsActive() { #ifdef __WXGTK20__ return GTK_WINDOW( m_widget )->has_toplevel_focus; #else - return ( wxGetTopLevelParent(FindFocus()) = this ); + return wxTopLevelWindowBase::IsActive(); #endif } -// vi:sts=4:sw=4:et diff --git a/src/gtk1/toplevel.cpp b/src/gtk1/toplevel.cpp index d5fff696dd..4b737edd73 100644 --- a/src/gtk1/toplevel.cpp +++ b/src/gtk1/toplevel.cpp @@ -1067,13 +1067,12 @@ bool wxTopLevelWindowGTK::SetShape(const wxRegion& region) return do_shape_combine_region(window, region); } -bool wxTopLevelWindowGTK::HasFocus() +bool wxTopLevelWindowGTK::IsActive() { #ifdef __WXGTK20__ return GTK_WINDOW( m_widget )->has_toplevel_focus; #else - return ( wxGetTopLevelParent(FindFocus()) = this ); + return wxTopLevelWindowBase::IsActive(); #endif } -// vi:sts=4:sw=4:et -- 2.45.2