zertovitch / gwindows

GWindows: GUI framework for MS Windows
https://sf.net/projects/gnavi/
21 stars 5 forks source link

MDI window menu issue on x64 #6

Closed zertovitch closed 2 years ago

zertovitch commented 2 years ago

Someone has noticed an issue ( https://sourceforge.net/p/l-e-a/tickets/1/ ) that is actually affecting GWindows, for multi-document windows.

You can see it happening on the sample : ./gwindows/samples/mdi/mdi_example.adb , which can be built through the project file gwindows_samples.gpr .

When built for 64-bit, the application adds to the Window menu new entries corresponding to news MDI child windows, as expected; the behaviour is identical to 32-bit build.

But a click on the menu entries themselves are doing nothing in the 64-bit version. Notably, the method On_MDI_Activate is not called.

Similarly, when there are more than 9 child windows, the "More windows..." (text in Windows user's language) is in the menu, but nothing happens when this menu entry is selected.

The issue seems to be tricky, since the system manages this part automatically - at least theoretically... In the MS doc, you can read:

https://docs.microsoft.com/en-us/windows/win32/winmsg/about-the-multiple-document-interface

"The system can add up to ten menu items to the window menu. When the tenth child window is created, the system adds the More Windows item to the window menu. Clicking this item displays the Select Window dialog box. The dialog box contains a list box with the titles of all MDI child windows currently available. The user can activate a child window by clicking its title in the list box."

zertovitch commented 2 years ago

Fixed in bdb105e365bad80f3b0cd3d640cac28611c54e0b