]> git.saurik.com Git - wxWidgets.git/commitdiff
moved EnableCloseButton() from wxialog to wxTLW
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 15 Nov 2001 02:21:43 +0000 (02:21 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 15 Nov 2001 02:21:43 +0000 (02:21 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12427 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/msw/dialog.h
include/wx/msw/toplevel.h
src/msw/dialog.cpp
src/msw/toplevel.cpp

index 552f764fc809b9d9a9b3038af8cd2f65922cafc4..9e13ae773fa3049152c599f84859369aa3f163ea 100644 (file)
@@ -70,9 +70,6 @@ public:
     // returns TRUE if we're in a modal loop
     bool IsModalShowing() const;
 
-    // wxMSW only: remove the "Close" button from the dialog
-    bool EnableCloseButton(bool enable = TRUE);
-
     // implementation only from now on
     // -------------------------------
 
index e84fe2267ee2ed24c3023c32cd574e464649b654..66c81cfb453dd2861cfb081c5a033517e5c1e8b2 100644 (file)
@@ -62,6 +62,10 @@ public:
     virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL);
     virtual bool IsFullScreen() const { return m_fsIsShowing; }
 
+    // wxMSW only: EnableCloseButton(FALSE) may be used to remove the "Close"
+    // button from the title bar
+    bool EnableCloseButton(bool enable = TRUE);
+
     // implementation from now on
     // --------------------------
 
index 620a3de16ae80ebb2f6768b5f7f6784e6604b211..7a3531d84b8f6e1c70294dbe6c84b25373f4b969 100644 (file)
@@ -127,38 +127,6 @@ bool wxDialog::Create(wxWindow *parent,
     return TRUE;
 }
 
-bool wxDialog::EnableCloseButton(bool enable)
-{
-#ifndef __WXMICROWIN__
-    // get system (a.k.a. window) menu
-    HMENU hmenu = ::GetSystemMenu(GetHwnd(), FALSE /* get it */);
-    if ( !hmenu )
-    {
-        wxLogLastError(_T("GetSystemMenu"));
-
-        return FALSE;
-    }
-
-    // enabling/disabling the close item from it also automatically
-    // disables/enabling the close title bar button
-    if ( !::EnableMenuItem(hmenu, SC_CLOSE,
-                           MF_BYCOMMAND | (enable ? MF_ENABLED : MF_GRAYED)) )
-    {
-        wxLogLastError(_T("EnableMenuItem(SC_CLOSE)"));
-
-        return FALSE;
-    }
-
-    // update appearance immediately
-    if ( !::DrawMenuBar(GetHwnd()) )
-    {
-        wxLogLastError(_T("DrawMenuBar"));
-    }
-#endif
-
-    return TRUE;
-}
-
 void wxDialog::SetModal(bool flag)
 {
     if ( flag )
index b5da266564757dffea826fadd076040bcfc11028..005d4a78bf4c7625427183f98a605c9a77455466 100644 (file)
@@ -601,3 +601,36 @@ void wxTopLevelWindowMSW::SetIcon(const wxIcon& icon)
     }
 #endif // __WIN95__
 }
+
+bool wxTopLevelWindowMSW::EnableCloseButton(bool enable)
+{
+#ifndef __WXMICROWIN__
+    // get system (a.k.a. window) menu
+    HMENU hmenu = ::GetSystemMenu(GetHwnd(), FALSE /* get it */);
+    if ( !hmenu )
+    {
+        wxLogLastError(_T("GetSystemMenu"));
+
+        return FALSE;
+    }
+
+    // enabling/disabling the close item from it also automatically
+    // disables/enables the close title bar button
+    if ( !::EnableMenuItem(hmenu, SC_CLOSE,
+                           MF_BYCOMMAND | (enable ? MF_ENABLED : MF_GRAYED)) )
+    {
+        wxLogLastError(_T("EnableMenuItem(SC_CLOSE)"));
+
+        return FALSE;
+    }
+
+    // update appearance immediately
+    if ( !::DrawMenuBar(GetHwnd()) )
+    {
+        wxLogLastError(_T("DrawMenuBar"));
+    }
+#endif // !__WXMICROWIN__
+
+    return TRUE;
+}
+