MDI FORMS lazarus / 10-Designer ---------------------------------------------------------------------- sanor · 2010-01-26 12:44 MDI is not yet implemented. Is there any provision for its implementation in lazarus? ---------------------------------------------------------------------- theo · 2010-01-26 13:06 http://wiki.lazarus.freepascal.org/MultiDoc But MDI is not really recommended anymore: http://msdn.microsoft.com/en-us/library/ms632591(VS.85).aspx ---------------------------------------------------------------------- sanor · 2010-01-26 14:23 What is the diference between MultiDoc and LMDI? thanks ---------------------------------------------------------------------- Ñuño_Martínez · 2010-01-26 15:30 Basicly, LMDI is Windows only while MultiDoc is multiplatform (Windows and Linux and may be MacOS also). ---------------------------------------------------------------------- LazaruX · 2010-02-05 09:59 Quote from: theo on January 26, 2010, 02:06:11 pm\But MDI is not really recommended anymore: http://msdn.microsoft.com/en-us/library/ms632591(VS.85).aspx Even if still Microsoft Excel (2007) uses MDI forms... ---------------------------------------------------------------------- Ocye · 2010-02-05 10:53 QuoteMany new and intermediate users find it difficult to learn to use MDI applications.Stupid reason. I loved to compare large number lists by fast switching between tables per Ctrl+Tab. Such a pattern comparison wouldn't be possible with Alt+Tab. But at least Linux have nothing like MDI and that's a good reason to think about other solutions. ---------------------------------------------------------------------- Wodzu · 2010-02-05 13:56 I woul'd not say that it is not recommended byt he Microsoft. They only say to consider other models. What is hard to learn it is their damn ribbon invention ;-) ---------------------------------------------------------------------- davesimplewear · 2010-02-06 00:30 Another way to approach MDI is to have your parent form and achild form using a panel on the main form as the parent for your child as below: procedure TfMain.sbAddBooksClick(Sender: TObject); var aForm :TfAdd; begin    aForm := TfAdd.Create(pBack);    with aForm do      beginprocedure TfMain.sbAddBooksClick(Sender: TObject); var aForm :TfAdd; begin    aForm := TfAdd.Create(pBack);    with aForm do      begin       BorderStyle := bsNone;       BorderIcons :=[];       Parent := pBack;       Left :=0;       Top :=0;       Align := alClient;       Show;     end;     sbAddBooks.Enabled:= False; end;       BorderStyle := bsNone;       BorderIcons :=[];       Parent := pBack;       Left :=0;       Top :=0;       Align := alClient;       Show;     end;     sbAddBooks.Enabled:= False; end; pBack being the panel on the main form the child being fAdd . Hope that helps. Regards Dave ---------------------------------------------------------------------- davesimplewear · 2010-02-06 00:31 HMMM something wrong with that paste, try again: procedure TfMain.sbAddBooksClick(Sender: TObject); var aForm :TfAdd; begin    aForm := TfAdd.Create(pBack);    with aForm do      begin       BorderStyle := bsNone;       BorderIcons :=[];       Parent := pBack;       Left :=0;       Top :=0;       Align := alClient;       Show;     end;     sbAddBooks.Enabled:= False; end; ---------------------------------------------------------------------- Ocye · 2010-02-06 09:53 This doesn't work under Linux. Rather emulate the form by a panel. ---------------------------------------------------------------------- davesimplewear · 2010-02-06 23:31 Sorry to burst your bubble, but it does work in linux as that is the only OS I use, as MDI is not available that is the point of it emulating the child, it is actually using the form in the panel, the panel emulates the child area, to look like it was mdi you just leave out the align and Border Style and Border Icons so that they show. Regards Dave ---------------------------------------------------------------------- Ocye · 2010-02-07 09:51 I don't get any header for the "mdi-form" even if I move a second form into with "Parent:=form1" (GTK2). Resizing, alignment, switching between mdi's etc. wouldn't be available too. ---------------------------------------------------------------------- davesimplewear · 2010-02-07 22:49 I guess that would leave multidoc, though why you would want mdi puzzles me, as there are other solutions out there for different child displays. You could use a pagecontrol creating a different sheet for whatever child, if you did not want tabs you would need to use a TNoteBook as at the present time the Tabs on aTPagecontrol won't hide. There was another control that simulated MDI but can't remember what it was called. As has been discussed previously the MDI interface is now dis-used. Perhaps you could give an outline of what you are trying to achieve and someone might be able to suggest an alternative for you. Regards Dave ---------------------------------------------------------------------- scept1c · 2010-02-08 12:24 "Basicly, LMDI is Windows only while MultiDoc is multiplatform (Windows and Linux and may be MacOS also)" do you prefer to use LMDI or Multidoc? what to choose? ---------------------------------------------------------------------- Ñuño_Martínez · 2010-02-08 12:45 I never used them. Actually I never used "MDI". ---------------------------------------------------------------------- marcov · 2010-02-09 15:43 I think MDI should be implemented for Windows. I had a quick look, and the initial implementation is not that much work probably, but the follow up will be hell. (to squash all bugs and incompatibilities). Sb (iirc Zeljan) remarked that QT also supported MDI like functionality. ---------------------------------------------------------------------- zeljko · 2010-02-09 16:34 Yes, MDI works ok with qt (I'm using it in our ERP application). Of course interface need simple patch (for delphi compat) with routines like: in TCustomForm ...   {MDI implementation}   function ActiveMDIChild: TCustomForm; virtual;   function GetMDIChildren(AIndex: Integer): TCustomForm; virtual;   function MDIChildCount: Integer; virtual;   property MDIChildren[I: Integer]: TCustomForm read GetMDIChildren; With this patch, qt completely handle all MDI features I need.Of course there are more MDI routines to be implemented, but there's no single change needed in LCL except adding this routines (can't remember now, but maybe at one place if FStyle = fsMDIChild then blah..). ---------------------------------------------------------------------- zeljko · 2010-02-09 16:37 Quote from: marcov on February 09, 2010, 04:43:49 pmSb (iirc Zeljan) remarked that QT also supported MDI like functionality. It's remarked as partially supported, just because missing routines in TCustomForm for MDI children handling - instead of that it works ok. If someone can implement win32 part, then probably other developers will agree about adding it to LCL, but then also someone have to find the way how to implement it under gtk2 and carbon (gtk2 doesn't support "classic" MDI, dunno for carbon). Qt also supports two kinds of MDI - one is classic , second is tabbed mdi childs. ---------------------------------------------------------------------- LazaruX · 2010-08-02 15:12 But why does this seem to work? Am I just doing something very stupid? Or what? Will this work on Linux? http://img64.imageshack.us/img64/5158/mdi.jpg ---------------------------------------------------------------------- Leledumbo · 2010-08-03 04:49 QuoteBut why does this seem to work? Am I just doing something very stupid? Or what?CMIIW, but AFAIK the currently working one is form docking, not MDI. QuoteWill this work on Linux?Yes. ---------------------------------------------------------------------- Rogerther · 2010-10-19 13:13 Quote from: BPsoftware on August 02, 2010, 05:12:49 pmBut why does this seem to work? Am I just doing something very stupid? Or what? Will this work on Linux? http://img64.imageshack.us/img64/5158/mdi.jpg Hello all. I'm trying to create an application where a main form is always visible to the user (will have a calendar and reminders) and allow the user to have 2 or 3 windows simultaneously opened... (much like MDI). I tried to make the childs forms always on top but that didn't work (maybe if there was an option to put the form always on bottom and apply that to the main form...). I have already looked at multidoc and It looks like it uses images for the windows control bottoms (minimize,close,maximize) and that will change the look of the application depending on the environment. BPsoftware how did you managed to create a child form that doesn't disappear when you click in the main form. Can someone point some alternatives that could be applied to my problem? Thanks in advance. ---------------------------------------------------------------------- Rogerther · 2010-10-20 15:36 Would it be possible to implement something like always on bottom to apply to a main form? ---------------------------------------------------------------------- zeljko · 2010-10-20 16:51 I've implemented an MDI emulator for LCL (for widgetsets which does not have MDI (eg. Gtk2)). I'll commit it to svn trunk in few weeks probably (currently very busy with other things). Progress on MDI emu info: http://wiki.lazarus.freepascal.org/User:Zeljan  .. in My TODO list ---------------------------------------------------------------------- Rogerther · 2010-10-21 06:09 Quote from: zeljko on October 20, 2010, 06:51:44 pmI've implemented an MDI emulator for LCL (for widgetsets which does not have MDI (eg. Gtk2)). I'll commit it to svn trunk in few weeks probably (currently very busy with other things). Progress on MDI emu info: http://wiki.lazarus.freepascal.org/User:Zeljan  .. in My TODO list Thank you very much zeljko. ---------------------------------------------------------------------- matthius · 2011-06-08 14:31 Dont forget for integrating Child Forms to use TSuperForm in Extended projet. http://www.lazarus-components.org/index.php/Voir- details/Forms/129-TSuperForm.html http://code.google.com/p/extended/ There is also Man Frames and XML Frames on these pages.