Recent

Author Topic: MDI Application problem  (Read 25060 times)

PeterX

  • Sr. Member
  • ****
  • Posts: 404
Re: MDI Application problem
« Reply #30 on: May 21, 2021, 04:20:23 pm »
MDIsimulator06.zip

works better than before, but I still have trouble
finding the right place in the source code
for storing / reloading "OldPosition" ..
« Last Edit: May 21, 2021, 04:46:03 pm by PeterX »
usually using latest Lazarus release version with Windows 10

PeterX

  • Sr. Member
  • ****
  • Posts: 404
Re: MDI Application problem
« Reply #31 on: May 21, 2021, 10:29:01 pm »
Changes from minimized to normal to (simulated) maximized and back. This works now.
usually using latest Lazarus release version with Windows 10

PeterX

  • Sr. Member
  • ****
  • Posts: 404
Re: MDI Application problem
« Reply #32 on: May 22, 2021, 11:18:23 am »
I am waiting since about 2016 for a working MDI in LCL (win32).
With a - very very old - large project in my hands, born under Delphi 5, twenty years ago.
But until today I never had the knowledge of how to implement MDI, or how to simulate it.

Just a remark: MDI applications are deprecated (by microsoft) for the past 20 years ..
I still do not understand why people make such general statements like that.
Indeed I would never recommend starting a new Project based on MDI today.

=> https://docs.microsoft.com/en-us/windows/win32/winmsg/multiple-document-interface
The official Microsoft Website does indeed no more recommend MDI, yes.
"Many new and intermediate users find it difficult to learn to use MDI applications.
Therefore, you should consider other models for your user interface.
"

But Microsoft would terminate all the apps out there that still use MDI
if they would wipe out native MDI support in Windows.

Microsoft explains us - statement from date 05/31/2018:
"However, you can use MDI for applications which do not easily fit into an existing model."
https://docs.microsoft.com/en-us/windows/win32/winmsg/multiple-document-interface


Microsoft has never improved MDI anymore (I think ..) over the last years
because it's a "dead" user interface.
But Microsoft has never stopped supporting MDI in Windows OS.


MDI applications ... never worked well with Lazarus.
I can agree with that.

But, as even old Delphi 5 compiled MDI applications do still work (more or less ..),
this is a Lazarus LCL win32 widgetset issue, not a Microsoft issue.


So I hope, my "MDIsimulator" helps out a little bit here, keeping some old MDI projects alive.
Or the existing win32 MDI code in Trunk is committed for a upcoming Lazarus Release Version one day ..

( Hint:  in  "MDIsimulator" Forms do not set Mainform to fsMDIForm / ChildForm to fsMDIChild - this is not real MDI ! )
« Last Edit: May 22, 2021, 11:26:20 am by PeterX »
usually using latest Lazarus release version with Windows 10

PeterX

  • Sr. Member
  • ****
  • Posts: 404
Re: MDI Application problem
« Reply #33 on: May 23, 2021, 06:53:55 pm »
The trunk has working MDI for windows.
I tried this today .. works !
usually using latest Lazarus release version with Windows 10

jamie

  • Hero Member
  • *****
  • Posts: 6131
Re: MDI Application problem
« Reply #34 on: May 23, 2021, 07:45:18 pm »
Years ago with smaller res screens the MDI didn't always work well for users but since many now have far more screen res you can now build MDI apps with lots of childs in the parent and still have room..
The only true wisdom is knowing you know nothing

PeterX

  • Sr. Member
  • ****
  • Posts: 404
Re: MDI Application problem
« Reply #35 on: May 23, 2021, 09:19:52 pm »
 :D    8)    ::)    >:D

Everybody wants this back:
usually using latest Lazarus release version with Windows 10

jamie

  • Hero Member
  • *****
  • Posts: 6131
Re: MDI Application problem
« Reply #36 on: May 23, 2021, 11:34:23 pm »
Lets not get carried away!  :D
The only true wisdom is knowing you know nothing

bpranoto

  • Full Member
  • ***
  • Posts: 136
Re: MDI Application problem
« Reply #37 on: May 24, 2021, 05:24:09 am »
Wow cool,

Will it work on other platform? It will be great if you publish your work. Thanks

PeterX

  • Sr. Member
  • ****
  • Posts: 404
Re: MDI Application problem
« Reply #38 on: May 24, 2021, 02:19:18 pm »
Wow cool,

Will it work on other platform? It will be great if you publish your work. Thanks
I already attached my example "MDIsimulator" as sourcecode in earlier posts here.
But "MDIsimulator" is only a playground for trying to simulate MDI behavior under Windows.
I don't know how far this maybe works on other platforms. Please download and try.


I did not do any work inside Lazarus LCL sources.
So I'm sorry, I cannot publish anything else.

The Multi Document Interface thing inside Lazarus that I was talking about
in my latest posts, is the win32 widgetset. Windows only.
And currently exists in Trunk only (developer version), not in the current 2.0.12 Lazarus.
=>
https://wiki.lazarus.freepascal.org/Getting_Lazarus#Getting_Lazarus_from_Subversion_server


For MDI You could try qt5 widgetset - which is said to be working under Windows, Linux and MacOS.
But I know nothing about that widgetset ..
=>
https://wiki.lazarus.freepascal.org/Qt5_Interface
« Last Edit: May 24, 2021, 02:23:50 pm by PeterX »
usually using latest Lazarus release version with Windows 10

bpranoto

  • Full Member
  • ***
  • Posts: 136
Re: MDI Application problem
« Reply #39 on: May 24, 2021, 05:11:56 pm »
I already attached my example "MDIsimulator" as sourcecode in earlier posts here.
But "MDIsimulator" is only a playground for trying to simulate MDI behavior under Windows.
I don't know how far this maybe works on other platforms. Please download and try.

It doesn't compile in Linux. After commenting out Windows uses clause, I got this:

Code: Pascal  [Select][+][-]
  1. Compile Project, Target: exeOutput/MDIsimulator: Exit code 1, Errors: 6
  2. subunit.pas(46,37) Error: Identifier not found "TWMSysCommand"
  3. subunit.pas(46,61) Error: Identifier not found "WM_SYSCOMMAND"
  4. subunit.pas(46,74) Error: Illegal expression after message directive
  5. subunit.pas(47,48) Error: Identifier not found "TWMWindowPosChanging"
  6. subunit.pas(47,79) Error: Identifier not found "WM_WINDOWPOSCHANGING"
  7. subunit.pas(47,99) Error: Illegal expression after message directive
  8.  



Quote
For MDI You could try qt5 widgetset - which is said to be working under Windows, Linux and MacOS.

Yes, I have played with it some times ago. The MDI works well. The thing was I couldn't use qt5 widget set because it doesn't support Raw printing which I needed that time.

PeterX

  • Sr. Member
  • ****
  • Posts: 404
Re: MDI Application problem
« Reply #40 on: May 24, 2021, 06:13:46 pm »
As TChildForm.WMSysCommand() does nothing for You,
in Your OS, You can delete this function.


WMWindowPosChanging() does something and cannot be dropped ..

I found something that might help here =>
Topic: Porting Win32 code to Apple Mac
https://forum.lazarus.freepascal.org/index.php?topic=37959.0


[Edit]
Looks like this now:
Code: Pascal  [Select][+][-]
  1.     procedure WMWindowPosChanging(var Message: TLMWindowPosChanging); message LM_WINDOWPOSCHANGING;
« Last Edit: May 24, 2021, 06:17:44 pm by PeterX »
usually using latest Lazarus release version with Windows 10

PeterX

  • Sr. Member
  • ****
  • Posts: 404
Re: MDI Application problem
« Reply #41 on: May 27, 2021, 12:58:19 am »
Found something while playing around with the Example code today ..

https://forum.lazarus.freepascal.org/index.php/topic,54771.msg407060/topicseen.html#new
usually using latest Lazarus release version with Windows 10

PeterX

  • Sr. Member
  • ****
  • Posts: 404
Re: MDI Application problem
« Reply #42 on: May 31, 2021, 01:09:28 am »
I kept on working on this thing,
and some bugs are solved.

- wrong "Old Size" stored on ChildWin Create
- from Minimized directly to Maximized lead to wrong stored Size
- uses real wsMaximized property now

But there's still missing a lot ..
« Last Edit: May 31, 2021, 01:12:05 am by PeterX »
usually using latest Lazarus release version with Windows 10

 

TinyPortal © 2005-2018