]> git.saurik.com Git - wxWidgets.git/commitdiff
Add EnableCloseButton() as wxMSW does. Use it in
authorRobert Roebling <robert@roebling.de>
Fri, 27 Oct 2006 08:18:26 +0000 (08:18 +0000)
committerRobert Roebling <robert@roebling.de>
Fri, 27 Oct 2006 08:18:26 +0000 (08:18 +0000)
    wxProgressDialog so that without wxPD_CAN_ABORT
    you cannot close the dialog.
  Closes [ 1585563 ] wxProgressDialog @ GTK CloseButton

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

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

index ac0081c8fc56c6a53f065545d835ec66a5368b10..cd48f4f7e1213b40654e2723bbdd1b5db0a6b2de 100644 (file)
@@ -51,6 +51,8 @@ public:
     virtual void SetIcons(const wxIconBundle& icons);
     virtual void Restore();
 
+    virtual bool EnableCloseButton(bool enable = true);
+
     virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL);
     virtual bool IsFullScreen() const { return m_fsIsShowing; };
 
index 95e31b363a377db22fbe3a94f3384e92ff6d709c..d243ce4b584299242c57d5270342eff60ce0627b 100644 (file)
@@ -694,7 +694,18 @@ wxTopLevelWindowGTK::~wxTopLevelWindowGTK()
         g_lastActiveFrame = NULL;
 }
 
-
+bool wxTopLevelWindowGTK::EnableCloseButton( bool enable )
+{
+    if (enable)
+        m_gdkFunc |= GDK_FUNC_CLOSE;
+    else
+        m_gdkFunc &= ~GDK_FUNC_CLOSE;
+    
+    if (GTK_WIDGET_REALIZED(m_widget) && (m_widget->window))
+        gdk_window_set_functions( m_widget->window, (GdkWMFunction)m_gdkFunc );
+        
+    return true;
+}
 
 bool wxTopLevelWindowGTK::ShowFullScreen(bool show, long style )
 {