]> git.saurik.com Git - wxWidgets.git/commitdiff
[wxGTK] Support changing the wxSTAY_ON_TOP style value run-time through wxWindow...
authorMart Raudsepp <leio@gentoo.org>
Mon, 7 Nov 2005 20:00:50 +0000 (20:00 +0000)
committerMart Raudsepp <leio@gentoo.org>
Mon, 7 Nov 2005 20:00:50 +0000 (20:00 +0000)
more styles to follow

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36116 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

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

index 3858f082719114bc75f48f3cb53fe475abed56b7..2729119b501694b6884457f080a02e2d475b2fde 100644 (file)
@@ -58,6 +58,8 @@ public:
 
     virtual void RequestUserAttention(int flags = wxUSER_ATTENTION_INFO);
 
+    virtual void SetWindowStyleFlag( long style );
+
     virtual bool Show(bool show = true);
 
     virtual void Raise();
index ba05d1b3f23f2e37a2133fa2bb3e472aca311e62..3ec4c2805fa20c5a555c0c58d93a50dde4fbfa5f 100644 (file)
@@ -59,6 +59,8 @@ public:
     virtual bool Show( bool show = true );
     virtual bool Enable( bool enable = true );
 
+    virtual void SetWindowStyleFlag( long style );
+
     virtual bool IsRetained() const;
 
     virtual void SetFocus();
index 3858f082719114bc75f48f3cb53fe475abed56b7..2729119b501694b6884457f080a02e2d475b2fde 100644 (file)
@@ -58,6 +58,8 @@ public:
 
     virtual void RequestUserAttention(int flags = wxUSER_ATTENTION_INFO);
 
+    virtual void SetWindowStyleFlag( long style );
+
     virtual bool Show(bool show = true);
 
     virtual void Raise();
index ba05d1b3f23f2e37a2133fa2bb3e472aca311e62..3ec4c2805fa20c5a555c0c58d93a50dde4fbfa5f 100644 (file)
@@ -59,6 +59,8 @@ public:
     virtual bool Show( bool show = true );
     virtual bool Enable( bool enable = true );
 
+    virtual void SetWindowStyleFlag( long style );
+
     virtual bool IsRetained() const;
 
     virtual void SetFocus();
index f8bcd99d54141ad93874e598a1822eca007a4485..d8472ece1d8743876fe31ad0683a1e9b9844bb48 100644 (file)
@@ -572,7 +572,7 @@ bool wxTopLevelWindowGTK::Create( wxWindow *parent,
     }
 #endif
 
-#if GTK_CHECK_VERSION(2,4,0)
+#ifdef __WXGTK24__
     if (!gtk_check_version(2,4,0))
     {
         if (style & wxSTAY_ON_TOP)
@@ -1361,3 +1361,22 @@ void wxTopLevelWindowGTK::RequestUserAttention(int flags)
 #endif
         wxgtk_window_set_urgency_hint(GTK_WINDOW( m_widget ), new_hint_value);
 }
+
+void wxTopLevelWindowGTK::SetWindowStyleFlag( long style )
+{
+    // Store which styles were changed
+    long styleChanges = style ^ m_windowStyle;
+
+    // Process wxWindow styles. This also updates the internal variable
+    // Therefore m_windowStyle bits carry now the _new_ style values
+    wxWindow::SetWindowStyleFlag(style);
+
+    // just return for now if widget does not exist yet
+    if (!m_widget)
+        return;
+
+#ifdef __WXGTK24__
+    if ( (styleChanges & wxSTAY_ON_TOP) && !gtk_check_version(2,4,0) )
+        gtk_window_set_keep_above(GTK_WINDOW(m_widget), m_windowStyle & wxSTAY_ON_TOP);
+#endif
+}
index 826fdd3c31b184a6f4d2db7b7cc88a455b3d7c33..871cd2fd6315682c4a84752dd801e1554a8e6e3b 100644 (file)
@@ -4814,6 +4814,11 @@ void wxWindowGTK::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
     m_clipPaintRegion = false;
 }
 
+void wxWindowGTK::SetWindowStyleFlag( long style )
+{
+    // Updates the internal variable. NB: Now m_windowStyle bits carry the _new_ style values already
+    wxWindowBase::SetWindowStyleFlag(style);
+}
 
 // Find the wxWindow at the current mouse position, also returning the mouse
 // position.
index f8bcd99d54141ad93874e598a1822eca007a4485..d8472ece1d8743876fe31ad0683a1e9b9844bb48 100644 (file)
@@ -572,7 +572,7 @@ bool wxTopLevelWindowGTK::Create( wxWindow *parent,
     }
 #endif
 
-#if GTK_CHECK_VERSION(2,4,0)
+#ifdef __WXGTK24__
     if (!gtk_check_version(2,4,0))
     {
         if (style & wxSTAY_ON_TOP)
@@ -1361,3 +1361,22 @@ void wxTopLevelWindowGTK::RequestUserAttention(int flags)
 #endif
         wxgtk_window_set_urgency_hint(GTK_WINDOW( m_widget ), new_hint_value);
 }
+
+void wxTopLevelWindowGTK::SetWindowStyleFlag( long style )
+{
+    // Store which styles were changed
+    long styleChanges = style ^ m_windowStyle;
+
+    // Process wxWindow styles. This also updates the internal variable
+    // Therefore m_windowStyle bits carry now the _new_ style values
+    wxWindow::SetWindowStyleFlag(style);
+
+    // just return for now if widget does not exist yet
+    if (!m_widget)
+        return;
+
+#ifdef __WXGTK24__
+    if ( (styleChanges & wxSTAY_ON_TOP) && !gtk_check_version(2,4,0) )
+        gtk_window_set_keep_above(GTK_WINDOW(m_widget), m_windowStyle & wxSTAY_ON_TOP);
+#endif
+}
index 826fdd3c31b184a6f4d2db7b7cc88a455b3d7c33..871cd2fd6315682c4a84752dd801e1554a8e6e3b 100644 (file)
@@ -4814,6 +4814,11 @@ void wxWindowGTK::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
     m_clipPaintRegion = false;
 }
 
+void wxWindowGTK::SetWindowStyleFlag( long style )
+{
+    // Updates the internal variable. NB: Now m_windowStyle bits carry the _new_ style values already
+    wxWindowBase::SetWindowStyleFlag(style);
+}
 
 // Find the wxWindow at the current mouse position, also returning the mouse
 // position.