]> git.saurik.com Git - wxWidgets.git/commitdiff
Make "More windows..." menu item in MDI "Window" menu work in wxMSW.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 20 Jan 2013 02:09:31 +0000 (02:09 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 20 Jan 2013 02:09:31 +0000 (02:09 +0000)
Don't interpret the commands from this menu item as child window selection.

Closes #3295.

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

docs/changes.txt
src/msw/mdi.cpp

index 8406f7ecf44203e77d2075986576f67c366a1aa2..1286439f00a947096e56d8fa4490465444c0f7db 100644 (file)
@@ -613,6 +613,7 @@ wxGTK:
 - Make key event handling consistent with wxMSW (John Rails).
 - Fix printing in landscape mode (Marcin Wojdyr).
 - Fix path selection in wx{File,Dir}Dialog with GTK+ > 2.24.10 (obfuscated).
+- Make "More windows..." menu item in MDI "Window" menu actually work.
 
 wxMSW:
 
index 46e0166c80ba353a231113466748919251e2904e..e6ea206faccd5f524ec7db4125a2015bc632e55d 100644 (file)
@@ -62,9 +62,17 @@ namespace
 // constants
 // ---------------------------------------------------------------------------
 
-// This range gives a maximum of 500 MDI children. Should be enough :-)
+// First ID for the MDI child menu item in the "Window" menu.
 const int wxFIRST_MDI_CHILD = 4100;
-const int wxLAST_MDI_CHILD = 4600;
+
+// There can be no more than 9 children in the "Window" menu as beginning with
+// the tenth one they're not shown and "More windows..." menu item is used
+// instead.
+const int wxLAST_MDI_CHILD = wxFIRST_MDI_CHILD + 8;
+
+// The ID of the "More windows..." menu item is the next one after the last
+// child.
+const int wxID_MDI_MORE_WINDOWS = wxLAST_MDI_CHILD + 1;
 
 // The MDI "Window" menu label
 const char *WINDOW_MENU_LABEL = gettext_noop("&Window");
@@ -562,8 +570,9 @@ WXLRESULT wxMDIParentFrame::MSWWindowProc(WXUINT message,
                 WXHWND hwnd;
                 UnpackCommand(wParam, lParam, &id, &hwnd, &cmd);
 
-                if ( cmd == 0 /* menu */ &&
-                        id >= SC_SIZE /* first system menu command */ )
+                if ( id == wxID_MDI_MORE_WINDOWS ||
+                     (cmd == 0 /* menu */ &&
+                        id >= SC_SIZE /* first system menu command */) )
                 {
                     MSWDefWindowProc(message, wParam, lParam);
                     processed = true;