Added wxTopLevelWindow::HasFocus() as discussed.
authorRobert Roebling <robert@roebling.de>
Sun, 26 Sep 2004 14:17:23 +0000 (14:17 +0000)
committerRobert Roebling <robert@roebling.de>
Sun, 26 Sep 2004 14:17:23 +0000 (14:17 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29398 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/gtk/toplevel.h
include/wx/gtk1/toplevel.h
include/wx/toplevel.h
src/gtk/toplevel.cpp
src/gtk1/toplevel.cpp

index 8ee1660d8bfc94ba268ad26f18a813a64eef1c5f..c55ec91352754b57ad034adf90250e7a5f2a70a9 100644 (file)
@@ -64,6 +64,8 @@ public:
 
     virtual bool Show(bool show = TRUE);
 
+    virtual bool HasFocus();
+
     virtual void SetTitle( const wxString &title );
     virtual wxString GetTitle() const { return m_title; }
 
index 8ee1660d8bfc94ba268ad26f18a813a64eef1c5f..c55ec91352754b57ad034adf90250e7a5f2a70a9 100644 (file)
@@ -64,6 +64,8 @@ public:
 
     virtual bool Show(bool show = TRUE);
 
+    virtual bool HasFocus();
+
     virtual void SetTitle( const wxString &title );
     virtual wxString GetTitle() const { return m_title; }
 
index cdabc866957f48ebb6bb85c3d53d7d34e444e86f..89fcba6c0dd31fa04d44620294ea1cf8e18b0956 100644 (file)
@@ -174,7 +174,10 @@ public:
     // Attracts the users attention to this window if the application is
     // inactive (should be called when a background event occurs)
     virtual void RequestUserAttention(int flags = wxUSER_ATTENTION_INFO);
-
+    
+    // Is this the active frame (highlighted in the taskbar)?
+    virtual bool HasFocus()
+        { return (wxGetTopLevelParent(FindFocus()) == this); }
 
     // implementation only from now on
     // -------------------------------
index 96e0da6119f614273e41d30326fa4946c6bffdc4..d5fff696dd247c683f636880743875e9c1bfd666 100644 (file)
@@ -1067,4 +1067,13 @@ bool wxTopLevelWindowGTK::SetShape(const wxRegion& region)
     return do_shape_combine_region(window, region);
 }
 
+bool wxTopLevelWindowGTK::HasFocus()
+{
+#ifdef __WXGTK20__
+    return GTK_WINDOW( m_widget )->has_toplevel_focus;
+#else
+    return ( wxGetTopLevelParent(FindFocus()) = this );
+#endif
+}
+
 // vi:sts=4:sw=4:et
index 96e0da6119f614273e41d30326fa4946c6bffdc4..d5fff696dd247c683f636880743875e9c1bfd666 100644 (file)
@@ -1067,4 +1067,13 @@ bool wxTopLevelWindowGTK::SetShape(const wxRegion& region)
     return do_shape_combine_region(window, region);
 }
 
+bool wxTopLevelWindowGTK::HasFocus()
+{
+#ifdef __WXGTK20__
+    return GTK_WINDOW( m_widget )->has_toplevel_focus;
+#else
+    return ( wxGetTopLevelParent(FindFocus()) = this );
+#endif
+}
+
 // vi:sts=4:sw=4:et