Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » UppHub » Docking package (plus examples)
Docking package (plus examples) [message #13581] Tue, 15 January 2008 14:24 Go to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
This is a window docking framework designed to give the end-user and developer complete control over their workspace by floating/docking/hiding windows. The aim is to emulate and improve upon the a combination feature set offered by Qt and Visual Studio, while retaining Upp style and ease-or-use for the developer.

Currently the package is stable, almost feature complete and quite polished. There have been no major bugs for a while now and I use it myself in a large and complex application.

Source code and examples can be found in this thread (work back from the end until you find it) or the bazaar section of the SVN. It is also now distributed in Upp releases, under bazaar, but that may not be up-to-date. An example win32 exe is attached.

Full feature list:
- API documentaion included
- X11 support with native windows
- Animated Autohide
- Animated Docking/Undocking
- Full Serialization support
- Tabbed windows with nesting (one tabbed window inside another)
- Support for popup docking hints (sort of like Visual Studio). Inherit from PopUpDockWindow.
- Fully themed tabs (includes grouping/tab arrangemen with CTRL key)
- Vertical or Horizontal docking handles, chameleonized
- Transparent docking hints (when dragging over tabs)
- The ability for the user (or API) to create/save/load layouts)
- Window grouping support (organise windows by user or developer designated group)
- A window manager that allows the user to manage (including create/delete) groups and layouts (see screenshot)
- Predefined menus that can be added directly to an application
- Many configurable options

last update SVN Revision 268.

James

[Updated on: Fri, 23 May 2008 18:24]

Report message to a moderator

Re: Docking / DockTest packages [message #13585 is a reply to message #13581] Tue, 15 January 2008 19:19 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
mrjt wrote on Tue, 15 January 2008 14:24

I've recently refactored and improved the Docking package in the SVN (Docking is the main source, DockTest is an example). Current features include:

- Normal (Simple) or Nested (Complex) docking
- Docking to/from tabs (tabs to be upgraded to the new style QuickTabs when available)
- Animated Autohide
- Animated Docking/Undocking (New) Very Happy
- Vertical or Horizontal docking handles, chameleonized (New)
- Allow/Deny options for docking on a per window or all window basis, plus more configurable options (New)
- Partial support for size hints (to be improved)
- Partial X11 support (tearing/docking of windows works but there are problems with the behaviour of floating windows) (New)

This release should be very stable on XP but flaky on Linux. Unfortunately I'm unable to test it on Vista so if there are any problems please let me know. Any other bug reports or suggestions are also welcome.

I've attached the compiled DockTest package as a quick demo (Edit: re-uploaded with a minor improvement).

Cheers,
James


Very nice test case with animation.
I've not yet looked at the code. I wonder if it is possible to align the tabs vertically? I mean the text is horizontal but the tabs are on the left o right side of the ctrl.

Luigi
Re: Docking / DockTest packages [message #13587 is a reply to message #13585] Tue, 15 January 2008 20:10 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
Hi!

Very nice indeed. And really useful.

I tested it a little under Vista, and I managed to break it a little. While moving around the tabs, I docked one on the top, near another one on the top, and it disappeared. Further tries to dock something on top behaved as if there where tree panels, one of them invisible.

Apart from this little bug which I couldn't reproduce yet, it all works great. There are some aesthetic problems, like those counter intuitive tab placements (but AFAIK you said you are going to use QuickTabs in the future), and the text is way to small and not really centered.

But these details are quite trivial and I hope in no time we'll have full docking support, both as you implemented it and for menus and toolbars also.
Re: Docking / DockTest packages [message #13595 is a reply to message #13585] Wed, 16 January 2008 11:50 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
forlano

I wonder if it is possible to align the tabs vertically? I mean the text is horizontal but the tabs are on the left o right side of the ctrl.

cbpporter

There are some aesthetic problems, like those counter intuitive tab placements (but AFAIK you said you are going to use QuickTabs in the future), and the text is way to small and not really centered.

Tabs will indeed be improved, I haven't spent any development time on them recently since I've been waiting for an official tab-bar implementation. I'll hopefully add various tab alignment options once this is done. All the other visual elements are thoughly chameleonized and can be tinkered with very easily.

cbpporter

Apart from this little bug which I couldn't reproduce yet, it all works great.

It doesn't sound like a Vista bug, but is very similar to a bug I'm aware of with the animation system. As you say it's difficult to reproduce so I've had problems fixing it even though I know what the root cause is.

Thanks for your comments, I'm glad you like it. I've already started thinking about the toolbars, the principles are the same but the implementation if quite different. The trick is finding a clever and cohesive way of tying it all together, I believe Qt just adds it all to every main window by default and you have to disable it with compiler flags - a very ugly solution.

Cheers,
James

[Updated on: Wed, 16 January 2008 11:55]

Report message to a moderator

Re: Docking / DockTest packages [message #13596 is a reply to message #13595] Wed, 16 January 2008 12:16 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
Quote:

've already started thinking about the toolbars, the principles are the same but the implementation if quite different.

Well a simple solution could be to just change the skin and the grab bar, and insert the toolbar normally into the container. This should work for menus too. Problem is vertical/side-by-side stacking.

The ToolkitPro way, with visual hints is also interesting.
Re: Docking / DockTest packages [message #13598 is a reply to message #13596] Wed, 16 January 2008 12:44 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
My best idea so far is something like this:
1- A ToolBar is linked to a ctrl (the only one that it can be attached to), and then added as a frame normally.
2- Dragging the handle on the ToolBar tears it off and it is displayed as some sort of draggable popup (oddly, even Microsoft uses popups for this and I've already got all the necessary code).
3- When being dragged you have two options:
- if dragged to an edge of the owning ctrl you can add it as a new frame ( this does stacking)
- if dragged over another toolbar it can be added to it as a child
This seems to solve most of the obvious problems, although I'm sure it won't be as easy as it sounds (frame ordering could be a problem, as will containing toolbars in other toolbars).


I've never (knowingly) seen ToolKit Pro, can you give me a rough idea what you mean?

[Updated on: Wed, 16 January 2008 12:48]

Report message to a moderator

Re: Docking / DockTest packages [message #13600 is a reply to message #13598] Wed, 16 January 2008 14:51 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
Quote:

I've never (knowingly) seen ToolKit Pro, can you give me a rough idea what you mean?

For some strange reason, Print Screen doesn't work when dragging those windows, so I can't paste a screenshot. But basically, when dragging a window over a component, over every border where a dock is possible, a little icon appears. When you move the cursor close to the icon, the animation kicks in and shows where the new position will be. This solves the problem of trying to position something somewhere and getting a lot of jumpy animations and stuff, but is a little more work for the user, because he has to bring the window near the icon, not near his desired position.

[Updated on: Wed, 16 January 2008 14:54]

Report message to a moderator

Re: Docking / DockTest packages [message #13601 is a reply to message #13600] Wed, 16 January 2008 15:36 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
That doesn't sounds very difficult to do. One of my original ideas was to allow different interfaces by inheriting from DockWindow (its possible, but not easy unless you have a good grasp of how it works internally), so I might have a go at implementing this. It actually sounds similar to the Visual Studio popups, only Microsoft's version is rather clumsy.
Re: Docking / DockTest packages [message #13602 is a reply to message #13601] Wed, 16 January 2008 16:25 Go to previous messageGo to next message
chickenk is currently offline  chickenk
Messages: 169
Registered: May 2007
Location: Grenoble, France
Experienced Member
Here are screenshots from an app developed in my company, using ToolKitPro:

1. Start dragging the "Build log" window. We can see the hints appearing on the center of the docked window (the mouse cursor is in the docked window area so it is active) and on the borders of all its containers (in this case, the main container only).

index.php?t=getfile&id=938&private=0


Lionel

[Updated on: Wed, 16 January 2008 16:33]

Report message to a moderator

Re: Docking / DockTest packages [message #13604 is a reply to message #13602] Wed, 16 January 2008 16:27 Go to previous messageGo to next message
chickenk is currently offline  chickenk
Messages: 169
Registered: May 2007
Location: Grenoble, France
Experienced Member
2. Dragging the mouse cursor over the hint representing the right border of the docked pane. The hint color is changed, I think it would be nicer to change its opacity.

index.php?t=getfile&id=939&private=0


Lionel
Re: Docking / DockTest packages [message #13605 is a reply to message #13604] Wed, 16 January 2008 16:30 Go to previous messageGo to next message
chickenk is currently offline  chickenk
Messages: 169
Registered: May 2007
Location: Grenoble, France
Experienced Member
3. Dragging the mouse cursor over the hint representing a new tabbar item (note that there already is a tabbar: 'Project' and 'Globals' are 2 tabs). The anticipated area is not really optimal (the tab title rectangle is not at the place it will be displayed) but it's self-explanatory anyway.

index.php?t=getfile&id=940&private=0


Lionel
Re: Docking / DockTest packages [message #13607 is a reply to message #13605] Wed, 16 January 2008 18:51 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Thanks. The problem with reproducing that look is that AFAIK the irregularly shaped and partially transparent popups/overlays are not possible with Upp at the moment. You can get close on Windows, but it causes all sorts of drawing problems, and IMO in V. Studio it doesn't work very well either. I believe it may not be possible at all on Linux, but I haven't verified this myself.

Having said that, it is possible to get something aproximating this. I've attached a quick demo, its got bugs and you'll have to excuse my icons as I'm shit at drawing Smile. Note that this is implemented purely as inheritance, so both options (DnD/Popups) are available.

[Updated on: Wed, 09 April 2008 16:30]

Report message to a moderator

Re: Docking / DockTest packages [message #13609 is a reply to message #13607] Wed, 16 January 2008 20:36 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
mrjt wrote on Wed, 16 January 2008 18:51


Having said that, it is possible to get something aproximating this. I've attached a quick demo, its got bugs and you'll have to excuse my icons as I'm shit at drawing Smile.


Hi James,

I've seen that feature in your code in the past, then disappeared in the next releases. Is there some reason? I found it very useful to help the user in positioning the tab... just the look need to be improved as you pointed out, but I like the overall effect.

Luigi
Re: Docking / DockTest packages [message #13611 is a reply to message #13609] Wed, 16 January 2008 23:30 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
Quote:

Having said that, it is possible to get something aproximating this. I've attached a quick demo, its got bugs and you'll have to excuse my icons as I'm shit at drawing . Note that this is implemented purely as inheritance, so both options (DnD/Popups) are available.

Very good Very Happy. Who cares about transparency anyway? And I also like the icons. Just a little fine tuning and it will be great. I hope it makes it into CtrlLib or some other "official" package. But I laso like Oblivion's docker. He's looks a little better (even though the tabs could be smaller), but your's behaves a little bit nicer. Two implementations are better than one (sometimes).
Re: Docking / DockTest packages [message #13612 is a reply to message #13609] Thu, 17 January 2008 11:04 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
forlano wrote on Wed, 16 January 2008 19:36

I've seen that feature in your code in the past, then disappeared in the next releases. Is there some reason?

I ended up focusing mainly on the drag-drop approach since nobody said they wanted it done this way, and when I had to rewrite it to add X11 support (that was a complete bitch!) I didn't bother with it. It was quick to add it back and I'd always planned on having different interfaces - in fact I've got a couple of less orthodox ones I'll try out once I've fixed some other things.

Quote:

I hope it makes it into CtrlLib or some other "official" package. But I laso like Oblivion's docker. He's looks a little better (even though the tabs could be smaller), but your's behaves a little bit nicer.

The code comes in the bazaar section of the SVN, and I hope that once it's more polished it will be added the the officially numbered distributions (probably as a seperate package like GridCrl), but that's up to the U++ team.
Appearance-wise you could make it look identical to Oblivion's version (appart from the Tabs) just by changing the fontsize and handle images in the DockableCtrl Cham. style, and eventually I'll have to have more styles available. I personally quite like it with the much smaller handles.

James

[Updated on: Thu, 17 January 2008 11:52]

Report message to a moderator

Re: Docking / DockTest packages [message #13617 is a reply to message #13612] Thu, 17 January 2008 16:36 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
mrjt wrote on Thu, 17 January 2008 05:04


The code comes in the bazaar section of the SVN, and I hope that once it's more polished it will be added the the officially numbered distributions (probably as a seperate package like GridCrl), but that's up to the U++ team.



Actually, Bazaar was already shipped with last "dev", also somewhat hidden (no assemblies).

It is actually interesting question about integrating it:

- first, should it be placed as another nest in the MyApps assembly ("c:\MyApps;c:\upp\bazaar;c:\upp\uppsrc")?

- then, perhaps it should be divided into Bazaar and BazaarExamples, and BazaarExamples assembly precreated.

- also, I think it would be a good idea to write some description of package that would clearly designated it as Bazaar part, and with info about author(s). "Bazaar: Docking, by James Thomas"

Mirek
Re: Docking / DockTest packages [message #13621 is a reply to message #13617] Thu, 17 January 2008 19:27 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Seems sensible.

I've also now got a first version of dockable ToolBars/Menus, they were incredibly easy to implement, no more than a few hours coding Smile. No changes to CtrlLib are required (yet) apart from the bugfix http://www.ultimatepp.org/forum/index.php?t=msg&th=3023& amp; amp;start=0&.

I've attached a version of modified version UWord as a demo. There are some display problems that may require CtrlLib changes to fix since MenuBar and ToolBar were never designed for some of this.

All thats missing is the ability to have multiple toolbars on one line.

[Updated on: Wed, 09 April 2008 16:30]

Report message to a moderator

Re: Docking / DockTest packages [message #13690 is a reply to message #13621] Tue, 22 January 2008 13:34 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Docking, SVN Revision 99:
Complete X11 support using native windows
Fixed animation bug that prevented dockings to empty side docks.

Now that I have full X11 support I'm going to add docking to one of my applications, so now I won't have any choice but to support it Smile

I've only tested properly on KDE (only briefly on Gnome), so if you have a different WM please test it and let me know of any problems.

James
Re: Docking / DockTest packages [message #13694 is a reply to message #13690] Tue, 22 January 2008 21:06 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1092
Registered: August 2007
Senior Contributor
James, I'm going to upload the new version of DockCtrl to the SVN repository this week end. In case you need it, I Hope you'll find the "ripped" TabInterface (from Quicktabs) class useful for your version. It now draws left/right tabs (of course, with your hint for chameleon, thank you for it Wink. I'm currently working on scrollbar of left/right tabs). As far as I know your code, it should be very easy to convert into it (probably only 4 or 5 lines of declaration, e.g. should change...)



Regards.


[Updated on: Tue, 22 January 2008 21:12]

Report message to a moderator

Re: Docking / DockTest packages [message #13746 is a reply to message #13694] Fri, 25 January 2008 16:46 Go to previous messageGo to previous message
Oblivion is currently offline  Oblivion
Messages: 1092
Registered: August 2007
Senior Contributor
James, I'm uploading the TabInterface Class source code with a basic example. It is now able to draw all four positions (left/right/top/bottom) and has scrollbar on all sides...Smile

Also, as in the original Quicktabs, it supports icons, closebuttons, event handling, etc... I ripped out the unneeded part (file load/save and grouping) from the code, but it is quite easy if you want to put them back in (actually, If Daniel permits, I can add these changes to the current Quicktabs in the SVN too). It draws using chameleon so it is easy to skinnize...

I Hope You'll find it useful if you are going to use it in your Docking.


Regards...



[Updated on: Fri, 25 January 2008 16:47]

Report message to a moderator

Previous Topic: SysInfo, Functions4U and Controls4U packages
Next Topic: TabBar Major Revision
Goto Forum:
  


Current Time: Tue Apr 16 10:52:37 CEST 2024

Total time taken to generate the page: 0.01916 seconds