Recent

Author Topic: MDI application  (Read 5012 times)

libaudf

  • Newbie
  • Posts: 3
    • Frédéric Libaud, Expert en Numérique
MDI application
« on: August 14, 2015, 11:49:05 am »
Hi,

I'm actually develop an MDI application for Linux, Windows and others.
But I've discovered a bug on Windows release with LCL on the 2.6.x version.
Some posts speak about but with no solution.
I've found an alternative to execute correctly and the code is :

 oChildMDI := TChildMDI.create(self);
oChildMDI.Parent:= self;
{$ifdef WINDOWS}
oChildMDI.Top:= 0;
oChildMDI.Left:= 0;
oChildMDI.Width:= ClientWidth - 4;
oChildMDI:= ClientHeight - 4;
{$else}
oChildMDI.Align:= alClient;
{$endif}
oChildMDI.Show;

And we need to specify properties :

Align alNone
BorderStyle bsNone
FormStyle wsMDIChild

The reason of the bug is that MDI child window bug on the loop message manager when Align property is set.
Frédéric Libaud, Digital Expert

Europe, France, Pays-de-Loire, Loire-Atlantique

http://www.libaudfrederic.fr

Graeme

  • Hero Member
  • *****
  • Posts: 1428
    • Graeme on the web
Re: MDI application
« Reply #1 on: August 14, 2015, 01:22:27 pm »
LCL is very inconsistent between it's widgetsets (LCL-gtk2, LCL-win32, LCL-qt etc). I experienced this back in 2005 and nothing has changed to date. Hence your IFDEF usage in you code - which funny enough is exactly what LCL is not supposed to do.

As far as I know the only LCL widgetset that actually supports a usable MDI is LCL-Qt. So maybe you are better off using LCL-Qt on all your platforms, even Windows. But this makes deployment harder as you need to ship extra 3rd party (very large) libraries. Also since about the last 5+ years, nobody is really interested in tackling the MDI issues in Lazarus, so don't hold your breath for any fixes any time soon.

Alternatively, switch to a truly cross-platform toolkit - something fully custom drawn and 100% implemented in Object Pascal. Something that is not just a bad abstraction layer on top of other toolkits. If you do that you will never need IFDEF's in your application code again.  I'm sure you could figure out what alternatives are available to you.  ;)
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

 

TinyPortal © 2005-2018