A.M. Hoornweg 144 Posted March 26, 2020 Hello all, my most important application, a big beast I've been working on for almost two decades and which I must maintain/support indefinitely, is an MDI application. The program offers 50+ different views and editors and the users (working on oil rigs) usually have a handful of these MDI child windows open simultaneously. The program can optionally run in SDI mode but nobody does that - it only clutters their desktop and they must have other applications (such as Word and Excel) open at the same time. A MDI window also has the advantage that you can quickly drag the whole thing (with all child windows) to a different monitor if it gets in the way. It is currently built using Delphi XE. I already had high-dpi awareness V2 working usably (don't ask - it took tons of hacks and sleepless nights) but since I expected native high-dpi support to come to Delphi some day, all those hacks can be automatically disabled with an IFDEF. So now I'm trying to migrate this application from Delphi XE to Delphi Rio. I can compile and run it successfully, but unfortunately Embarcadero chose to not support high-DPI in MDI applications and the visual result is really disappointing. MDI child windows are now unusably small on a high-resolution monitor. I can't force the SDI application model through my users' throats so I must either get this DPI awareness to work properly on Rio or stick with Delphi XE. Sure I could write some flags into the Windows 10 registry to make the whole application non-DPI aware, but that's not a satisfactory solution. I had DPI-awareness working and now I'm losing that. Any ideas on how to solve this? Share this post Link to post
Sherlock 663 Posted March 26, 2020 MDI is said to be an interface type, Microsoft wants to get rid of. There are lots of people propagating to switch to other models such as TDI. This old SO Q&A should get the message across: https://stackoverflow.com/questions/486020/is-there-still-a-place-for-mdi That said, you could create an issue on https://quality.embarcadero.com Share this post Link to post
Lars Fosdal 1792 Posted March 26, 2020 MDI has been deprecated for years and is severely broken under Windows 10. Seems that a lot of messages no longer are sent or passed down to children. 1 Share this post Link to post
Anders Melander 1784 Posted March 26, 2020 3 hours ago, Sherlock said: MDI is said to be an interface type, Microsoft wants to get rid of. "is said to" = rumor The SO thread is just a lot of different opinions on MDI. Like this thread will probably become. 1 hour ago, Lars Fosdal said: MDI has been deprecated for years Do you have any proof for that claim? I've seen it many, many times but never with any reliable sources. Also one would think that MS would document that fact, in the relevant API and concept documentation, like they usually do... I have several MDI applications that runs just fine on Windows 10. They're all based on DevExpress though and I don't know if they have done anything special to handle Win10 but I doubt it. Share this post Link to post
A.M. Hoornweg 144 Posted March 26, 2020 1 hour ago, Lars Fosdal said: MDI has been deprecated for years and is severely broken under Windows 10. Seems that a lot of messages no longer are sent or passed down to children. MDI itself works fine on Windows 10 for me. Share this post Link to post
Lars Fosdal 1792 Posted March 26, 2020 The last time I checked, I got transparent client areas and border areas. Share this post Link to post
Uwe Raabe 2058 Posted March 26, 2020 Quote Warning: The Per Monitor V2 (and many of the other High-DPI features in Windows) have no support for the MDI child windows model. Microsoft has stopped addressing bugs reported for MDI, and we recommend migrating to a different multi-windows model (multiple floating windows, docked panes, tabbed windows, etc.) Taken from: http://docwiki.embarcadero.com/RADStudio/Rio/en/Per_Monitor_V2 1 Share this post Link to post
Lars Fosdal 1792 Posted March 26, 2020 @Anders Melander: I may have been tooting the MS party line on MDI, without having read an actual deprecation statement,https://docs.microsoft.com/en-us/windows/win32/winmsg/multiple-document-interface "[Many new and intermediate users find it difficult to learn to use MDI applications. Therefore, you should consider other models for your user interface. However, you can use MDI for applications which do not easily fit into an existing model.]" However, this thread by Joel Spolsky from 2002 (!) accentuates how long ago MS started pushing that party line...https://discuss.fogcreek.com/joelonsoftware/default.asp?cmd=show&ixpost=2748 Basic functionality seems to be there, even with Per Monitor V2 - but I only gave it a cursory glance. I think I was on 1809 the last time I checked and at the time it was definitively borked. Currently on 1909. Share this post Link to post
Anders Melander 1784 Posted March 26, 2020 27 minutes ago, Uwe Raabe said: Taken from: http://docwiki.embarcadero.com/RADStudio/Rio/en/Per_Monitor_V2 Thanks. It's still a secondary source but I guess that if Embarcadero believes it to be canon then we have to work from that. Share this post Link to post
Anders Melander 1784 Posted March 26, 2020 2 minutes ago, Lars Fosdal said: However, this thread by Joel Spolsky Yes I know about all the different opinions against MDI and while I agree with some of them that's not the topic of this thread. Also I think quoting Joel went out of vogue some 15 years ago Share this post Link to post
A.M. Hoornweg 144 Posted March 26, 2020 43 minutes ago, Lars Fosdal said: The last time I checked, I got transparent client areas and border areas. I've never noticed. All my mdi client forms have either a panel or a tscrollbox in the background. Share this post Link to post
Lars Fosdal 1792 Posted March 26, 2020 Agree on the Joel thing - but the argument still stands with regards to MDI. Its demise has been plotted for at least two decades. Share this post Link to post
Anders Melander 1784 Posted March 26, 2020 Anyhoo, to actually address then issue, if the OP wants to maintain MDI and support High-DPI then I would recommend having a look at DevExpress' Tabbed MDI: https://community.devexpress.com/blogs/thinking/archive/2010/08/16/vcl-tabbed-mdi-multiple-document-interface.aspx Another alternative is to use docking. Just don't use the VCL docking. It sucks. Share this post Link to post
A.M. Hoornweg 144 Posted March 26, 2020 The whole thing with MDI is that it is not only suitable to offer a user multiple documents at the same time, but also multiple views at the same time. I haven't seen a good GUI alternative for that. Anything with tabs, bars, pagecontrols etc basically serves to only hide views from sight which is quite the opposite of what I need. 1 Share this post Link to post
Lars Fosdal 1792 Posted March 26, 2020 It would actually be nice to have something MDI like - but without the container. It would need multi-display support. The main window could be a narrow up top thing, or a sidebar thing. Share this post Link to post
A.M. Hoornweg 144 Posted March 26, 2020 2 minutes ago, Anders Melander said: Anyhoo, to actually address then issue, if the OP wants to maintain MDI and support High-DPI then I would recommend having a look at DevExpress' Tabbed MDI: https://community.devexpress.com/blogs/thinking/archive/2010/08/16/vcl-tabbed-mdi-multiple-document-interface.aspx Another alternative is to use docking. Just don't use the VCL docking. It sucks. "Tabbed MDI" hides views from sight. In my application, editing data in one view influences calculated values and graphical output in other views and the user really needs to have these views in sight simultaneously. That's the whole point, to have multiple views in sight and to let the user rather than the GUI paradigm decide which ones he wants to see. Share this post Link to post
A.M. Hoornweg 144 Posted March 26, 2020 1 minute ago, Lars Fosdal said: It would actually be nice to have something MDI like - but without the container. It would need multi-display support. The main window could be a narrow up top thing, or a sidebar thing. That's the second mode in which my application works. A toolbar at the top and free floating windows that can be moved between screens. Only... The users don't want to use it that way. Share this post Link to post
Anders Melander 1784 Posted March 26, 2020 1 minute ago, A.M. Hoornweg said: In my application, editing data in one view influences calculated values and graphical output in other views and the user really needs to have these views in sight simultaneously. Sounds like docking is the better choice then. Share this post Link to post
Lars Fosdal 1792 Posted March 26, 2020 Users are a fickle bunch. Only devs are worse 😛 2 Share this post Link to post
A.M. Hoornweg 144 Posted March 26, 2020 Just now, Anders Melander said: Sounds like docking is the better choice then. "Docking" is a paradigm that lets the users assemble a view layout that is not supposed to change often (because docking is awkward). In my case that won't work. There are over 50 scalable views in my application and the user needs most of them on a daily basis. And often there will be multiple instances of the same view type open, to compare data from the oil well with older reference wells nearby. Share this post Link to post
Bob Devine 11 Posted March 26, 2020 I rolled my own using TscExPanel from http://www.almdev.com/. Easy to do and also makes it easy to have the ability to switch between MDI and SDI since you're decoupled from the MS MDI. Nice set of components and Alexey was quick to add some features I needed for the MDI. Cheers, Bob Share this post Link to post
Vincent Parrett 750 Posted March 26, 2020 @A.M. Hoornweg have a look at the LMD Docking library, we use it in FinalBuilder and it is by far the best implementation of docking I have seen for delphi. https://lmd.de/products/vcl/lmddockpack/ You can save layouts and switch between them quite easily. In FinalBuilder, we save the layout separately for when there is 1) no projects open, 2) projects open in design mode and 3) when a project is running. Switching layouts is pretty simple and saving/restoring them them is trivial. Share this post Link to post
Sherlock 663 Posted March 27, 2020 16 hours ago, Anders Melander said: Also I think quoting Joel went out of vogue some 15 years ago Blasphemy! Share this post Link to post
eivindbakkestuen 47 Posted March 27, 2020 21 hours ago, A.M. Hoornweg said: "Docking" is a paradigm that lets the users assemble a view layout that is not supposed to change often (because docking is awkward). In my case that won't work. There are over 50 scalable views in my application and the user needs most of them on a daily basis. And often there will be multiple instances of the same view type open, to compare data from the oil well with older reference wells nearby. You may want to test docking. You're not locked to docking the windows in particular places, they can float around on the "desktop" inside your application. You decide what kind of docking etc operations are applicable (perhaps you have a few child windows where it would be appropriate to only see one of them at a time, so would work in a tabbed child window, etc). I'm attaching an image of an application using the DevEx docking library; could just as well have been done with MDI. Share this post Link to post
A.M. Hoornweg 144 Posted March 27, 2020 14 hours ago, Vincent Parrett said: @A.M. Hoornweg have a look at the LMD Docking library, we use it in FinalBuilder and it is by far the best implementation of docking I have seen for delphi. https://lmd.de/products/vcl/lmddockpack/ You can save layouts and switch between them quite easily. In FinalBuilder, we save the layout separately for when there is 1) no projects open, 2) projects open in design mode and 3) when a project is running. Switching layouts is pretty simple and saving/restoring them them is trivial. Hmmm. I have a subscription to both LMD VCL Complete and Finalbuilder. Though I love Finalbuilder, the docking solution it uses is unsuitable for my own application. Finalbuilder is basically an IDE, I love it, but the actual fiddling with action properties is done with modal dialog windows son one can only fiddle with one thing simultaneously. And re-arranging docked panels is by no means trivial. You see, once you detach a panel it has to fit into a rectangular space somewhere. You can't just place the panel anywhere you like, it's not like other panels will intelligently move out of the way if you want to drop one somewhere. When I try, I find myself dragging a panel around, hoping it will snap in somewhere suitable. So once I have a usable layout, I simply try not to break it! MDI may not be the prettiest solution but it actually solves a ton of problems. Open a dozen views or editors at once? Check. Auto-align them all? Check. Want to maximize one of them? It takes just one click. Restore the previous situation? One click. 1 Share this post Link to post