[Lazarus] MDI implementation for Win32
badsectoracula at gmail.com
Tue Jan 14 21:21:23 CET 2020
Recently i wanted to use MDI in some of my Windows tools and since Lazarus
seems to not support it with the Win32 widgetset, i decided to try and make
an attempt at implementing it.
You can find a patch at https://bugs.freepascal.org/view.php?id=36582
I have only implemented whatever i could find in Delphi 2 (the only Delphi
i have available). I wrote a small demo "MDI doodle" application that uses
all of the available APIs and tries to trigger various behaviors (e.g.
showing/hiding a toolbar/status bar to update the client area, creating MDI
children forms while existing ones are maximized, vetoing modifications via
MDI childrens' CloseQuery, merging menus using GroupIndex, etc). The demo
can be compiled in both Delphi 2 and Lazarus to compare the behavior of the
two and is attached in the bug report above too.
You can also see it in action here: https://i.imgur.com/GznF35A.png (at the
left side is the Delphi 2 version, at the right side is the Lazarus
The patch is written against SVN trunk at revision 62555. There might be
some unnecessary tests in the code, but since i am not very familiar with
it i decided to be a more cautious. Also since there is already an MDI
implementation (AFAIK, didn't try it) for Qt, i decided to stick as much as
i can on the widgetset side (the two main changes i made on the LCL side
was to add an ArrangeIcons method in TCustomForm to mimic the Delphi one
and add Merge/Unmerge methods in TMainMenu, again to mimic the Delphi
methods and hopefully the functionality too :-P).
Feel free to remove any tests you think aren't necessary and make any other
changes you think are worth it.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the lazarus