Author Topic: Still docking  (Read 21897 times)

dodi

  • New Member
  • *
  • Posts: 25
Still docking
« on: February 16, 2009, 12:44:03 pm »
I'm almost stuck in making docking work as it should work. There are so many things that should be changed, and every single item deserves considerations WRT its possible influence on other code.

Currently I see no way to introduce all the required changes step by step, so how should I proceed???

Is nobody really interested in well working docking?

DoDi

Leledumbo

  • Hero Member
  • *****
  • Posts: 8836
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Still docking
« Reply #1 on: February 17, 2009, 05:59:58 am »
Have you tried the new Manual Docker component? Perhaps you can learn from that.

Paul Ishenin

  • Sr. Member
  • ****
  • Posts: 274
Re: Still docking
« Reply #2 on: February 17, 2009, 08:45:48 am »
It is really there important topic and I feel gratitude that you are working on it. But there are too many more basic things that needs to be fixed :( Maybe we (me, Mattias, you, others who interested in this topic) can choose some time when we all be able to discuss all problems together.

dodi

  • New Member
  • *
  • Posts: 25
Re: Still docking
« Reply #3 on: February 19, 2009, 03:37:06 pm »
It is really there important topic and I feel gratitude that you are working on it. But there are too many more basic things that needs to be fixed :( Maybe we (me, Mattias, you, others who interested in this topic) can choose some time when we all be able to discuss all problems together.

Many of the "many more problems" IMO stem from the lack of rules for the architecture and extensibility of the LCL. With regards to docking, I'm fighting the same problem, in variations, over and over again: a lot of abstract base classes have been introduced into the LCL, which only *pretend* that they could be implemented in any other way, different from their first implementation. Some practical problems:

- LDockTree has to use typecasts allover, because the basic node type (TDockZone) has to be extended with new properties and methods, in order to make that base class usable at all.

- The TLazDockZone again is not extensible due to private members, which have to be accessed in a derived class, but are invisible outside the Controls or LDockTree units.

- Adding beforementioned new members to the base class would require, that every existing implementation has to *implement* these new methods as well, and also has to *use* the new elements properly.

- The use of a DefaultNodeClass inside the encapsulated (immutable) default implementation makes it impossible to derive further tree node classes, for e.g. a special TopZone and LeafZone, because only one class type is selectable for the creation of every new node.
Possible cure: use a virtual method for the creation of polymorphic elements, instead of a variable holding one class type.

- The DragManager, DragObject and DragPerformer are coupled so tightly with each other, and with TControls and TWinControl, that it's impossible to change anything without rewriting all related classes alltogether.

- Some objects, like the DragManager, have to be singletons. While a DragManager variable holds a reference to that singleton, it's impossible to exchange that object by a different implementation.

(only to mention some of the most annoying problems)

This is why I *had* to implement my revised docking manager almost from scratch, and currently try the same for beforementioned DragManager and related classes. Obviously this is not a meaningful way to only cure some bugs in the LCL, because it will be hard (who ever would?) extract the really required changes from such a parallel implementation, and to update the existing default implementation in only the really required places. Not to mention the changes to the default implementation, that may occur during development of an alternative implementation, and have to be mirrored in that implementation immediately.


A well thought architecture should allow for alternative implementations *without* touching the basic LCL units. Sealed default implementations, of abstract base classes, should *not* be allowed inside the *same* unit, because they will hide all details, which may prevent an alternative implementation at all. How should something be implemented, when access to hidden (private...) elements of the default implementation or some related class is impossible from a different unit? Such restrictions make it impossible to modify the default implementation slightly, by overriding virtual methods in a derived class, as well as deriving a very new class from the the base class.

Whoever introduces a new abstract base class should be *liable* for the proof of their usefulness, and for a documentation of the *intended* use of that class and their interaction with other classes, so that it's possible to extend that class at all, and to replace the default by a different implementation.

Now I know better, and you may know as well, why I hate the "classitis" as found in the LCL. Some developers like to introduce new classes every now and then, because it *might* make sense to extend these classes later. More discipline and stricter rules are required, so that such extensions *really* can be implemented later.


And a last rant, for now <g>:

I'm pretty sure that *many* people would like to contribute to the LCL, by fixing bugs or by fully implementing rudimentary functionality. Currently the efficiency of such contributors is near zero, due to the lack of documentation of even the most basic details of the current implementation. Currently 10% of the contributors (the team) spend 100% of their time with the implementation, whereas the other 90% spend 99% of their time in exploring the the undocumented behaviour, purpose and relationship of class members.

When instead the gurus would spend only 10% of their time for documentation (better all their time), and let others do the implementation, the efficiency would increase by factors! Currently the lack of documentation prevents even a discussion of possible implementations, because none but the "inventors" of $something know about the intended or actual use and implementation of that $something.

IMO Lazarus is an excellent (counter-)example of teamwork. Such a big project deserves good documentation, so that as many people as possible can do the work, while the managers only have to integrate those contributions and hunt only the most complicated bugs.

DoDi

msdobrescu

  • New Member
  • *
  • Posts: 22
Re: Still docking
« Reply #4 on: August 03, 2009, 01:44:23 pm »
Hi, I am a newbie of Lazarus, but a little experienced with Delphi.
I have tried to use the Lazarus' docking classes and I would like to have some serious docking components for my app.

I do not intend to criticize the work done by this group of enthusiasts ... and not only enthusiasts. First of all, I must say that I have switched to C/C++ (I would like to have this option for Lazarus, as C++ Builder), CS, java, along years and I come back to free pascal.
I think Pascal is as good as C/C++.

So, to go back to the subject, I would implement docking in other way.
I would take a good example of implementation here:

http://sourceforge.net/projects/dockpanelsuite/

This is CS and Windows only, but the functionality is great, conceptually speaking and disregarding the implementation (imho).

To be short:
1. I would use an align-able control that handles docking, regularly being expanded on all the remaining client area of a form (so the current bug that wipes out the menu wouldn't occur).
2. I would consider that when I dock something to the side of the dock component, the docked control will take all the length or height  of that side (depending on the side, whether it is horizontal or vertical)
3. I wouldn't take the controls of the main form to a docking page
4. I wouldn't care for the parent of the docking control components to be nil.

I don't know if there is a docking set of components in Delphi to, unfortunately Wink, keep the compatibility (is there one?).

I think these components would help many application developers with a comprehensive GUI, being a good replacement for win32 MDI (which is a nice try, but unproductive as was already discussed on this forum). Some great IDE apps (and not only) share the concept of MDI implemented as tab pages: Visual Studio, Eclipse, Netbeans. Lazarus hopefully tends too. BTW, I would like to have such GUI in Lazarus.

I would also like to help, but actual implementation of docking gives me headaches (my fault Cheesy) and it is hard to follow by me. I will not give up on it, however.
Unfortunately it is hard to debug due to the fact that mouse hovering triggers some events and I never get to the point I need because of that. Only DebugLn are useful.
Another weak point of me is that I have no experience in cross-platform, I would be able to develop win32 only in such component (I guess api calls are forbidden)...

So, what do you think?
Will docking become a reliable and useful set of components soon?
Does it worth the effort of rewriting actual components?

Please understand, although I might have been impolite, my intention was not to hurt some people's feelings - people that invested a lot of time and energy in this project. I am grateful to them, actually.  Angel
 
Regards,
Mike

dodi

  • New Member
  • *
  • Posts: 25
Re: Still docking
« Reply #5 on: August 03, 2009, 07:25:59 pm »
Quote
Unfortunately it is hard to debug due to the fact that mouse hovering triggers some events and I never get to the point I need because of that. Only DebugLn are useful.

Right. Dragging requires a good concept, that doesn't deserve much debugging.

Quote
Another weak point of me is that I have no experience in cross-platform, I would be able to develop win32 only in such component (I guess api calls are forbidden)...

Since it's still not clear how dragging is supported by the various widgetsets and window managers, it's hard to find a portable solution. All the .NET and Java models have to support just their own platform, nothing else.

Quote
So, what do you think?
Will docking become a reliable and useful set of components soon?
Does it worth the effort of rewriting actual components?

If you want to rewrite or improve the AnchorDocking components and manager, then you are welcome. I for my part don't like it for several reasons, and would prefer an approach based on the Delphi docking model.

I've been playing with an IDE clone, using drag-dock like in the Delphi IDE. You may want to have an look at the dockmanager\elasticsite example.

DoDi

msdobrescu

  • New Member
  • *
  • Posts: 22
Re: Still docking
« Reply #6 on: August 03, 2009, 07:56:18 pm »
.Net and Java implementations are just proofs for the concept. They demonstrate a functionality preferred by the people in general. The elasticsite  example is a good start, a step to the needed features.
I must say that actual implementation is a bit messy...  :(
Still I hope it will be cleaned up and improved...

msdobrescu

  • New Member
  • *
  • Posts: 22
Re: Still docking
« Reply #7 on: August 03, 2009, 08:16:42 pm »
Thinking further, I would consider that fsMDIForm could designate a Dock Manager form, and, consequently, fsMDIChild a Docked form (tabbed). Would help porting apps in the old style.

msdobrescu

  • New Member
  • *
  • Posts: 22
Re: Still docking
« Reply #8 on: August 05, 2009, 08:31:13 am »
Hello again,

I hope I'm not bugging you...

I have had a look to the comps and DoDi is right, I think.
Developing further the actual TLaz* comps is like filling up a closet with all the stuff we don't use currently. Some day, when we open it, will fall down on us all that stuff.

I would re-think these comps while is there still time...  ::)

msdobrescu

  • New Member
  • *
  • Posts: 22
Re: Still docking
« Reply #9 on: August 05, 2009, 08:15:04 pm »
Hi,

I've tried the step by step docking example.
I have the feeling that the main form, that should be the container of all others, is 'assimilated' by the last docked one. At least the alignment... but I can undock it and its container disappears and the menu comes back to it.

Is this expected?
I've been following the tutorial I think (http://wiki.lazarus.freepascal.org/Achor_Docking_Step_by_step_example).

dodi

  • New Member
  • *
  • Posts: 25
Re: Still docking
« Reply #10 on: August 05, 2009, 08:34:26 pm »
Menus disappear by design, as soon as forms are docked into an new container. That's why Delphi docks windows into already existing forms, so that the docksite form does not loose anything.

This behaviour makes this docking approach useless to me, until we have menus (and more) as true controls (as in gtk), or until the menus of the docked forms are added to the menu of the new docksite. This e.g. is what you could implement.

Otherwise all the dockable forms should have no menus of their own, and a docksite (IDE main bar...) with a menu should be used as the container for multiple docked forms.

DoDi

msdobrescu

  • New Member
  • *
  • Posts: 22
Re: Still docking
« Reply #11 on: August 05, 2009, 08:51:43 pm »
My question relates to the docking of the main form (i.e. the one that should contain the others) in some other container, and having the wrong (?) alignment.
Menus are a weak point in lcl, generally speaking, because they are not native. On MacOS are not merging as usual menus. But to disappear by design??? It is wrong wrong wrong!!!  :o

Did you implement anything else related docking? I have the feeling that is possible to avoid all the stuff TLaz*.

Mike

dodi

  • New Member
  • *
  • Posts: 25
Re: Still docking
« Reply #12 on: August 05, 2009, 09:25:48 pm »
I've made the DragManager work, and implemented the EasyDockManager. Everything in examples\dockmanager is my work.

The EasyDockManager is an update of the LDockTree, and the remaining applications demonstrate some docking features, as well as bugs and missing features in related components or on other platforms/widgetsets.

The EasyDockManager implements notebook docking with dockable tabs - a first step towards an multi-window (Delphi like) editor. I really miss the display of multiple files in separate windows in Lazarus, and this is how I came to docking at all.

What's still missing is a convention for docking windows on Linux (currently only controls can be docked), and for saving and restoring layouts (as implemented in the LazDock... classes).

Currently I'm busy with other projects, and want to come back when the docking future is discussed (next Lazarus version, Paul promised).

DoDi

msdobrescu

  • New Member
  • *
  • Posts: 22
Re: Still docking
« Reply #13 on: August 05, 2009, 09:35:05 pm »
When is planned to discuss (what means 'next version')?
I am also interested in docking for lazarus and for my app I plan to do.
I've tried your examples and I face serious problems there (like splitters going through menu bar or each other).
I would like to have something similar to the Weifen Luo's for .net. And I know others that like that concept.
I wish to help you, but I need time to understand what's implemented and I miss a small doc on what and how it is expected to work.

Please give me a sign if you start to debate on lazarus future docking.

Regards, Mike.
« Last Edit: August 06, 2009, 06:52:10 am by msdobrescu »

dodi

  • New Member
  • *
  • Posts: 25
Re: Still docking
« Reply #14 on: August 06, 2009, 02:18:16 am »
Next version means: after the coming release version. Currently all developers are busy with the 0.28 release.

Right, the splitters could be beautified. Do you want to do that? But there is much more that has to be fixed in the components and widgetsets.

The documentation is comparable to the Delphi documentation: the interface is described there, but not the implementation. I've added some comments and ToDo's to the implementation. For general information see
http://wiki.lazarus.freepascal.org/LCL_Drag_Drop#Common_Principles
and
http://dodi-lcl-dragging.blogspot.com/

DoDi

 

TinyPortal © 2005-2018