Recent

Author Topic: Please tell me what components are there for MDI  (Read 889 times)

Leximus

  • Newbie
  • Posts: 2
Please tell me what components are there for MDI
« on: January 28, 2023, 11:44:57 am »
I am writing a code editor application, I need to use MDI. Please tell me what are the components for this and what are their pros and cons?

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: Please tell me what components are there for MDI
« Reply #1 on: January 28, 2023, 12:04:14 pm »
https://en.wikipedia.org/wiki/Multiple-document_interface for pro's and con's. It is at this point in time usually considered bad design, although wikipedia not fully reflects this. Some call MDI legacy, but that is not entirely true.
Lazarus has some MDI support, but not really cross-platform, I believe.
If you are on Windows only, I have some code as example, though.
If that is not enough? Use SDI, not MDI. SDI has much better cross-platform support.
That said, I use MDI on Windows myself for some legacy applications, because users expect it.
Usually, for an editor, it is better to use a tabbed interface and/or maybe use anchor docking.
The latter is well supported by Lazarus and also looks quite a bit more modern.
Anchor docking is actually SDI but looks like MDI when well used/designed.

So my professional opinion is to generally avoid MDI and I would go for anchor docking. But there are some cases where MDI is still relevant, not from the perspective of the programmer but that of the user.
It is an important design decision, so think it through carefully!

(Side note: My mother was a pretty avid Delphi programmer until her death 3 years ago at 89. She preferred MDI for her database applications. I still have her laptop with all her code on it.. and not bad at all, compared to some things we see here. She used to teach computer literacy to older people and used to complain why these old people did not understand computers: she was MUCH older than most of them...)
« Last Edit: January 28, 2023, 12:25:55 pm by Thaddy »
Specialize a type, not a var.

Leximus

  • Newbie
  • Posts: 2
Re: Please tell me what components are there for MDI
« Reply #2 on: January 28, 2023, 01:42:16 pm »
I'm making a cross-platform application and I need it to run on both Linux and Windows. This is the main condition.
I need to use exactly MDI, since many windows can be opened and the main functions will be in the main menu.
So far I have only found MultiDoc(https://wiki.freepascal.org/MultiDoc) , but I don't know how cross-platform it is and maybe there is something better.

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: Please tell me what components are there for MDI
« Reply #3 on: January 28, 2023, 02:42:44 pm »
Do you realize that the Lazarus IDE itself, with all its menu options, is an SDI interface? And NOT MDI?
I thought you would have thought it through by now? Anyway, it is your decision and I can only give advice from experience. MDI cross-platform is a challenge. (read: the road to nowhere)
But it can be done if you insist. For the readers: I never bashed MDI, just merely pointed out my opinion and some practical remarks.
« Last Edit: January 28, 2023, 02:49:08 pm by Thaddy »
Specialize a type, not a var.

Fred vS

  • Hero Member
  • *****
  • Posts: 3158
    • StrumPract is the musicians best friend
Re: Please tell me what components are there for MDI
« Reply #4 on: January 28, 2023, 02:54:43 pm »
Hello.

If you want a widgetset that has docking forms and MDI at "root" (without the need to install external components), you may envisage to try MSEgui:
https://github.com/mse-org/mseide-msegui
https://wiki.lazarus.freepascal.org/MSEide%2BMSEgui

His docking and MDI are working perfectly.

« Last Edit: January 28, 2023, 02:56:48 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Please tell me what components are there for MDI
« Reply #5 on: January 28, 2023, 03:23:43 pm »
Afaik there is some MDI support in the QT widgetset, and some more in the Win32 widgetset.   

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: Please tell me what components are there for MDI
« Reply #6 on: January 28, 2023, 04:07:18 pm »
Afaik there is some MDI support in the QT widgetset, and some more in the Win32 widgetset.
"Some" support, Windows being a bit more complete, but not refined.
But as I wrote, it is ultimately a design decision.
( Although I might have a problem with MDI style interfaces, my mother obviously disagreed )
« Last Edit: January 28, 2023, 04:10:28 pm by Thaddy »
Specialize a type, not a var.

 

TinyPortal © 2005-2018