Recent

Author Topic: Docking windows  (Read 12080 times)

LazaruX

  • Hero Member
  • *****
  • Posts: 597
  • Lazarus original cheetah.The cheetah doesn't cheat
Docking windows
« on: January 20, 2017, 01:59:07 pm »
LazDock, EasyDockManager, AnchorDock, Sparta, ...

Can somebody explain how to create 3 forms which dock to a main form?
I find it very confusing, different names for the same feature.
I have tried to follow the steps here: http://wiki.freepascal.org/Anchor_Docking#Features
but they are not clear enough. Is there a tutorial which even somebody with 0 knowledge will be able to follow?

jmpessoa

  • Hero Member
  • *****
  • Posts: 2297
Re: Docking windows
« Reply #1 on: January 20, 2017, 05:33:44 pm »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

LazaruX

  • Hero Member
  • *****
  • Posts: 597
  • Lazarus original cheetah.The cheetah doesn't cheat
Re: Docking windows
« Reply #2 on: January 21, 2017, 10:32:51 pm »
"For all those who ever wanted "their" Lazarus to look and behave close to the latest releases of Delphi™ / C++ Builder™ but gave up because of some very annoying bugs, here comes a solution: "

I don't want Lazarus to be docked, I already managed to do that. I want to create docked applications.
I want to create a main form and 2 sub forms and be able to dock those 2 sub forms to the main form.

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1106
Re: Docking windows
« Reply #3 on: January 21, 2017, 10:58:32 pm »
If you cannot dock your application, then MDI or TDI might be an alternative for you.

Take a look here for MDI (multiple document interface):
http://forum.lazarus.freepascal.org/index.php/topic,34137.0.html
http://forum.lazarus.freepascal.org/index.php/topic,29357.msg185322.html#msg185322

And look here for TDI (tabbed document interface):
http://forum.lazarus.freepascal.org/index.php/topic,34142.0.html

LazaruX

  • Hero Member
  • *****
  • Posts: 597
  • Lazarus original cheetah.The cheetah doesn't cheat
Re: Docking windows
« Reply #4 on: January 22, 2017, 10:52:36 pm »
I know what TDI and MDI are, and that's not what I want. I want to know what is the difference between Anchordock, Easy DOck, Sparta ... and how I can create a simple application with Windows that dock.
I don't want to dock the IDE (already did), I don't want another interface.

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: Docking windows
« Reply #5 on: January 23, 2017, 02:02:51 am »
I want to know what is the difference between Anchordock, Easy DOck, Sparta ... and how I can create a simple application with Windows that dock.
AnchorDocking is the recommended solution. I think it works quite well. It has improved steadily. Please try AnchorDocking in Lazarus trunk if you have problems.
It has the MiniIDE example, take a look.

EasyDock has not been maintained recently and has problems.

Sparta implements the docked form designer in Lazarus IDE. It is not related to AnchorDocking or other general purpose docking solutions.
IIRC the earlier (now obsolete) docking solution in Sparta was a fork of GlassDocking which is a fork of AnchorDocking.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

LazaruX

  • Hero Member
  • *****
  • Posts: 597
  • Lazarus original cheetah.The cheetah doesn't cheat
Re: Docking windows
« Reply #6 on: January 24, 2017, 12:36:00 pm »
Ok I managed to strip down the MiniIDE project. I removed the forms create din code and added my own forms which now dock (I had to add some code in FormCreate).
Now I have an issue: when I dock my windows the layout is not saved

mangakissa

  • Hero Member
  • *****
  • Posts: 1131
Re: Docking windows
« Reply #7 on: January 24, 2017, 01:27:17 pm »
Can somebody explain how to create 3 forms which dock to a main form?
Using a panel or tabsheet as owner?
Code: Pascal  [Select][+][-]
  1. var Frm : TForm;
  2. begin
  3.   Frm := Tform.create(panel1);
  4.   Frm.parent := Frm;
  5. end;
Or do you mean something else?
Lazarus 2.06 (64b) / FPC 3.0.4 / Windows 10
stucked on Delphi 10.3.1

LazaruX

  • Hero Member
  • *****
  • Posts: 597
  • Lazarus original cheetah.The cheetah doesn't cheat
Re: Docking windows
« Reply #8 on: January 26, 2017, 04:40:13 pm »
I don't know if those 5 lines of code help me, it would be great to have a tutorial step by step, and not the existing one.

I currently have been able to modify MiniIDE and I have created 2 extra forms which now dock to the main windows. The issue I have is that the layout cannot be saved to xml.

LazaruX

  • Hero Member
  • *****
  • Posts: 597
  • Lazarus original cheetah.The cheetah doesn't cheat
Re: Docking windows
« Reply #9 on: January 30, 2017, 04:38:10 pm »
No answer...?

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: Docking windows
« Reply #10 on: February 01, 2017, 10:43:23 pm »
I currently have been able to modify MiniIDE and I have created 2 extra forms which now dock to the main windows. The issue I have is that the layout cannot be saved to xml.
Does saving work in the MiniIDE itself? It works here.
I believe you can figure out what makes the difference by debugging your code.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

LazaruX

  • Hero Member
  • *****
  • Posts: 597
  • Lazarus original cheetah.The cheetah doesn't cheat
Re: Docking windows
« Reply #11 on: February 01, 2017, 10:44:51 pm »
Saving the layout of the forms created in code (as provided in the example MainIDE) works. Saving the layout of the forms I have added does not work. But the forms I have added can be docked.

laggyluk

  • Jr. Member
  • **
  • Posts: 69
Re: Docking windows
« Reply #12 on: February 10, 2017, 11:04:25 am »
I'm just doing same thing and it works fine

Your dockable forms creation must be handled in DockMasterCreateControl() like in that example for layout saving to work

http://wiki.freepascal.org/Anchor_Docking#Procedure_to_create_all_other_forms_by_name

LazaruX

  • Hero Member
  • *****
  • Posts: 597
  • Lazarus original cheetah.The cheetah doesn't cheat
Re: Docking windows
« Reply #13 on: February 10, 2017, 11:06:34 am »
How exactly?

laggyluk

  • Jr. Member
  • **
  • Posts: 69
Re: Docking windows
« Reply #14 on: February 10, 2017, 11:14:56 am »
exactly like in MiniIDE example.. just look how it's creating SimpleForm and do similarly with your forms.

 

TinyPortal © 2005-2018