U++ framework
Do not panic. Ask here before giving up.

Home » Developing U++ » UppHub » Docking package (plus examples)
Re: Docking package (plus examples) [message #21034 is a reply to message #21032] Mon, 27 April 2009 21:56 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 740
Registered: November 2008
Location: France
Contributor
Fantastic !

I'm going to try it right now.

I needed this functionnality in order to open several identical dialogs to make comparison views: no need for the special menu features and of course even less for serialisation.

Thanks Smile

Didier
Re: Docking package (plus examples) [message #21051 is a reply to message #21034] Tue, 28 April 2009 21:32 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 740
Registered: November 2008
Location: France
Contributor
OK works fine Cool

I added the following additional creator methods to enable constructors with parameters:

in 'class DockWindow'
	template<class T>
	DockableCtrl&   CreateDockable(WString title)						{ return Register(ctrls.Create<T>().Title(title)); }
	template<class T, class PARAM1>
	DockableCtrl&   CreateDockable(WString title, PARAM1 p1)			{ return Register(ctrls.Create<T>(p1).Title(title)); }

	template<class T>
	DockableCtrl&   CreateDockable(const char *title = 0)         		{ return CreateDockable<T>((WString)title); }
	template<class T, class PARAM1>
	DockableCtrl&   CreateDockable(const char *title, PARAM1 p1)        { return CreateDockable<T>((WString)title, p1); }




in 'class Array' : Core/Vcont.h
	template<class TT> TT& Create()     { TT *q = new TT; Add(q); return *q; }
	template<class TT, class PARAM1> TT& Create(PARAM1 p1)     { TT *q = new TT(p1); Add(q); return *q; }



Maybe it's a good idea to add such methods with 1,2,3,4 ... parameters since Array does not use Pick behaviour (copy is a move)

What do you think ?

Re: Docking package (plus examples) [message #21055 is a reply to message #21051] Wed, 29 April 2009 09:53 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Didier wrote on Tue, 28 April 2009 20:32


Maybe it's a good idea to add such methods with 1,2,3,4 ... parameters since Array does not use Pick behaviour (copy is a move)

What do you think ?

This should be avoided. The Upp way is to almost always use default constructors, as this solves many common problems. You should use some sort of initialisation function instead. The special cases are usually classes that are scoped as local variables, and never Ctrl derived classes since these are usually member variables.

I had made a mistake that made this more difficult though. I've just updated the SVN with the fix (CreateDockable now returns type T&). You can now do:
MyClassType &c = DockWindow::CreateDockable<MyClassType>("Title");
c.Init(param1);

or event better:
DockWindow::CreateDockable<MyClassType>("Title").Init(param1);
Re: Docking package (plus examples) [message #21839 is a reply to message #21055] Mon, 08 June 2009 03:57 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1431
Registered: December 2006
Ultimate Contributor
Could you please fix Docking package? It is broken (rev. 1289) because of changes to TabBar.


TIA



Regards,
Novo
Re: Docking package (plus examples) [message #22059 is a reply to message #21839] Tue, 16 June 2009 10:35 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Yes. I was on holiday all of last week but I'll have it done either today or tomorrow.

[Updated on: Tue, 16 June 2009 10:40]

Report message to a moderator

Re: Docking package (plus examples) [message #22070 is a reply to message #22059] Tue, 16 June 2009 17:09 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Done. Revision 1315.
Re: Docking package (plus examples) [message #22114 is a reply to message #22070] Thu, 18 June 2009 13:29 Go to previous messageGo to next message
ptDev is currently offline  ptDev
Messages: 25
Registered: June 2009
Promising Member
Hi,

Thanks for the Docking library and the update to make it work with the new version of TabBar.

I've been trying the Docking library, and noticed that a small bug. If you only have one docked window, and it is minimized, closing it causes the program to crash. Is this behaviour expected in any way?
Re: Docking package (plus examples) [message #22116 is a reply to message #22114] Thu, 18 June 2009 14:13 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Quote:

Hi,

Thanks for the Docking library and the update to make it work with the new version of TabBar.

I've been trying the Docking library, and noticed that a small bug. If you only have one docked window, and it is minimized, closing it causes the program to crash. Is this behaviour expected in any way?

It's a bug, though quite and interestingly subtle one. I've just committed the fix, plus I've stopped the AutoHide bar from always having an active tab (changes to both TabBar and Docking).
Re: Docking package (plus examples) [message #22126 is a reply to message #22070] Fri, 19 June 2009 03:54 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1431
Registered: December 2006
Ultimate Contributor
mrjt wrote on Tue, 16 June 2009 11:09

Done. Revision 1315.


Thanks for the fix.

It looks like rev. 1320 doesn't work on Linux. I checked that with 32 and 64-bit versions of Ubuntu 9.04 with Compiz enabled.

Floating window cannot be docked back.


Regards,
Novo
Re: Docking package (plus examples) [message #22131 is a reply to message #22126] Fri, 19 June 2009 09:38 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Bugger. I've never tested it with Compiz and none of the floating/docking code has changed, so perhaps it's that.

This might be much more difficult to fix, what I need is a log of X events during window draging and dropping.
Re: Docking package (plus examples) [message #22139 is a reply to message #22131] Fri, 19 June 2009 14:31 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1266
Registered: August 2007
Senior Contributor
Hi mrjt,

I can confirm that bug on Ubuntu + compiz too. OTOH, docking package (build 1320) works flawlessly on Kubuntu 9.04 + KDE 4.2.4 with/without window compositing enabled. Nice job! The only thing that is annoying me is the docking animation gets choppy on docks with 2 or more widgets.

Regards.


Re: Docking package (plus examples) [message #22170 is a reply to message #22131] Mon, 22 June 2009 00:52 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1431
Registered: December 2006
Ultimate Contributor
mrjt wrote on Fri, 19 June 2009 03:38

Bugger. I've never tested it with Compiz and none of the floating/docking code has changed, so perhaps it's that.

This might be much more difficult to fix, what I need is a log of X events during window draging and dropping.


Sorry for making you a problem again.

I attached a log of X11 events for DockingExample1. It is created using xtrace. I hope that it is what you need.

TIA

[Attachment is deleted ...]


Regards,
Novo

[Updated on: Sun, 19 July 2009 18:41]

Report message to a moderator

Re: Docking package (plus examples) [message #22180 is a reply to message #22170] Tue, 23 June 2009 12:07 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
I don't have much time to look at it now, but that might be too much information to get what I need. The best way is to add logging to the X11 window proc, i'll give you a patch to do this when I can.
Re: Docking package (plus examples) [message #22228 is a reply to message #13581] Thu, 25 June 2009 22:51 Go to previous messageGo to next message
cocob is currently offline  cocob
Messages: 156
Registered: January 2008
Experienced Member
is it possible to remove this line in the begining of Docking.h

using namespace Upp;

Because it is very diffcult to resolve names when some "using" are set in header files.

Thanks
cocob
Re: Docking package (plus examples) [message #22231 is a reply to message #22228] Fri, 26 June 2009 11:04 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Would you prefer
namespace Upp;
?
Re: Docking package (plus examples) [message #22239 is a reply to message #22228] Fri, 26 June 2009 15:29 Go to previous messageGo to next message
ptDev is currently offline  ptDev
Messages: 25
Registered: June 2009
Promising Member
I'm sorry for my confusion.

Is it that you wish to always type the additional "Upp::" scope prefix whenever you're referring to an U++ class?

Note that when you're making a new package, you can always omit the "using namespace Upp" statement and be explicit about the namespaces. In fact, you can even still refer to the namespaces for clarity, "using" or no "using".

Personally, I never saw any obvious advantage in this, but you do have the option to do so if you wish.

[Updated on: Fri, 26 June 2009 15:30]

Report message to a moderator

Re: Docking package (plus examples) [message #22242 is a reply to message #13581] Fri, 26 June 2009 18:55 Go to previous messageGo to next message
cocob is currently offline  cocob
Messages: 156
Registered: January 2008
Experienced Member
I use "using namespace Upp" too ! but not in header files !
It is the right way to proceed.

Yes i prefer namespace Upp { }

Thanks
cocob
Re: Docking package (plus examples) [message #22272 is a reply to message #22242] Mon, 29 June 2009 10:49 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Ok, committed. I can see your point. It's just never an issue for me as I will always be using the Upp namespace.
Re: Docking package (plus examples) [message #22499 is a reply to message #22180] Sun, 19 July 2009 18:43 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1431
Registered: December 2006
Ultimate Contributor
mrjt wrote on Tue, 23 June 2009 06:07

I don't have much time to look at it now, but that might be too much information to get what I need. The best way is to add logging to the X11 window proc, i'll give you a patch to do this when I can.


I can try to enable LLOG ...
Is that what you mean?


Regards,
Novo
Re: Docking package (plus examples) [message #22510 is a reply to message #22499] Mon, 20 July 2009 12:36 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
I think that should do it, but it's better if you can exclude expose events and some other stuff.

The problem is that there is no X11 event for 'this window is no longer being dragged'. In Windows this is quite easy, but for X11 I have to rely on unrelated events, and presumably Compiz is sending a slightly different sequence.

Sorry I don't have much time for this at the moment, but I will get to it eventually. If I new what events were needed it should be simple fix.
Re: Docking package (plus examples) [message #22642 is a reply to message #22510] Mon, 03 August 2009 10:43 Go to previous messageGo to next message
tojocky is currently offline  tojocky
Messages: 607
Registered: April 2008
Location: UK
Contributor

Hello All,
Very interesting project.. by I thing that have a little bag.
index.php?t=getfile&id=1866&private=0
This bug i produced on win32 windows xp os with the latest svn repository. When I unmark and after then mark Windows Menu button from Docking window Manager form, The buttons of the docking windows was positioned wrong.

[Updated on: Mon, 03 August 2009 10:53]

Report message to a moderator

Re: Docking package (plus examples) [message #22935 is a reply to message #22642] Sun, 30 August 2009 19:07 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 740
Registered: November 2008
Location: France
Contributor
Hi,

I have the latest svn version and there are two Docking pacakges:
one uppdev and one in bazaar.
The one in Bazaar works, the other one has unresolved conflicts and therefore does not compile.

Which one should be used ?
Re: Docking package (plus examples) [message #22945 is a reply to message #22935] Tue, 01 September 2009 12:57 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3458
Registered: August 2008
Senior Veteran
Hello Didier

As far as I know in Bazaar there are the "stable" versions of packages submitted by the Upp community.

Therefore the right package to use would be the one in Bazaar.

Best regards
Koldo


Best regards
Iñaki
Re: Docking package (plus examples) [message #22946 is a reply to message #13581] Tue, 01 September 2009 12:59 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3458
Registered: August 2008
Senior Veteran
Hello James Thomas

Here I enclose you a translation to spanish.

Best regards
Koldo
  • Attachment: Docking.t
    (Size: 3.20KB, Downloaded 391 times)


Best regards
Iñaki
Re: Docking package (plus examples) [message #22947 is a reply to message #22946] Tue, 01 September 2009 20:44 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 740
Registered: November 2008
Location: France
Contributor
Hi Koldo,

Thanks !
Re: Docking package (plus examples) [message #23179 is a reply to message #22642] Wed, 23 September 2009 13:38 Go to previous messageGo to next message
tojocky is currently offline  tojocky
Messages: 607
Registered: April 2008
Location: UK
Contributor

I see that this bug is not corrected.

It is persist in ubuntu 9.04 too!

tojocky wrote on Mon, 03 August 2009 11:43

Hello All,
Very interesting project.. by I thing that have a little bag.
index.php?t=getfile&id=1866&private=0
This bug i produced on win32 windows xp os with the latest svn repository. When I unmark and after then mark Windows Menu button from Docking window Manager form, The buttons of the docking windows was positioned wrong.

Re: Docking package (plus examples) [message #23299 is a reply to message #23179] Wed, 07 October 2009 18:55 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
tojocky wrote on Wed, 23 September 2009 12:38

I see that this bug is not corrected.

It is persist in ubuntu 9.04 too!

tojocky wrote on Mon, 03 August 2009 11:43

Hello All,
Very interesting project.. by I thing that have a little bag.
index.php?t=getfile&id=1866&private=0
This bug i produced on win32 windows xp os with the latest svn repository. When I unmark and after then mark Windows Menu button from Docking window Manager form, The buttons of the docking windows was positioned wrong.



Fixed. It was actually caused by hiding the buttons then showing them agan.

I haven't merged the translation files yet.
Re: Docking package (plus examples) [message #23524 is a reply to message #23299] Tue, 27 October 2009 11:22 Go to previous messageGo to next message
andrei_natanael is currently offline  andrei_natanael
Messages: 262
Registered: January 2009
Experienced Member
The un-docked window doesn't get docked back, it doesn't get docking hints shown. That happen on Gnome 2.28 with Gnome effects (not compiz), Ubuntu 9.10.

[Updated on: Tue, 27 October 2009 11:22]

Report message to a moderator

Re: Docking package (plus examples) [message #23661 is a reply to message #13581] Wed, 11 November 2009 13:22 Go to previous messageGo to next message
softcoder is currently offline  softcoder
Messages: 3
Registered: October 2009
Junior Member
At first: Thank you for this great cool thing!
But I think I've found a bug concerning styles in docking (I'm using WinXP).

To see what I mean, perform the following steps:
- Open DockingExample2 as project in UPP so you can compile it etc.
- Add this function (which is basing on BlueBar):
void DockingExample::ChangeStyle()
{
	TabCtrl::Style& ctrlTabBarStyle = DockTabBar::StyleDefault().Write();
	ctrlTabBarStyle.Standard();
	for(int i = 0; i < 4; i++)
	{
		ctrlTabBarStyle.text_color[i] = White();
	}
}

- In DockingExample::DockingExample() replace
button <<= THISBACK(OnUserGuide);	

by
button <<= THISBACK(ChangeStyle);

- Compile and execute the program.
- Look at the tabs (TreeCtrl 1 and 2) at the left bottom of the window. The font color is black as it should be.
- Pull one of the tabs out of the window so it becomes an additional floating window.
- Drag'n'drop the floating window where it was before.
- Now push the "User Guide" button -> font doesn't become white although it should become white.
- Pull out the tab again and drop it again to its old place -> font is white.

My current workaround (or even the best possible bugfix?) is to add the following line directly before Refresh() in DockCont::GroupRefresh():
tabbar.SetStyle(tabbar.GetAlign(), DockTabBar::StyleDefault());


This problem even occurs in UPP1679 (the newest version availabe here, but mainly using a much older one for some reasons).

Now the question: Is the problem sitting in front of my screen or is that really a bug? If it's a bug, is it a good solution?

TIA

softcoder
Re: Docking package (plus examples) [message #23663 is a reply to message #23661] Wed, 11 November 2009 18:23 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
The problem is that TabBar requires a different style for each orientation. These are generated on demand and you have to make sure you modify the correct one.

The Docking tabs use bottom alignment, so this should work:
void DockingExample::ChangeStyle()
{
	TabCtrl::Style& ctrlTabBarStyle = DockTabBar::StyleBottom().Write();
	ctrlTabBarStyle.Standard(); // Is this necessary?
	for(int i = 0; i < 4; i++)
	{
		ctrlTabBarStyle.text_color[i] = White();
	}
}
(untested though)

I'm suprised your solution works actually. This code:
tabbar.SetStyle(tabbar.GetAlign(), DockTabBar::StyleDefault());

is applying the style for top-aligned tabs to a bottom aligned TabBar. I would expect the tabs to be the wrong way up.
Re: Docking package (plus examples) [message #23966 is a reply to message #23663] Sat, 12 December 2009 19:44 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1310
Registered: September 2007
Ultimate Contributor
Hi,

I'm testing your docking package, really impressive Smile

I have just a small question : I'd need some sort of tabbed docking, but without having a dockable container... I mean, I'd need to tabify-untabify some windows inside a FIXED container, which shouldn't be dockable. When last tab is undocked it should stay empty in-place waiting for pages to be eventually re-tabified.
The docking bar shouldn't be present, either, just the tabs.
Is it possible ?

Another nice thing would be the ability to lock/unlock some parts or the whole interface.

Ciao

Max
Re: Docking package (plus examples) [message #23971 is a reply to message #23966] Sun, 13 December 2009 10:33 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 740
Registered: November 2008
Location: France
Contributor
Hi,

Try TabCtrl: tab management without docking facility.
I'm not it's what you need but it's simple and works well, you can also put controls in the tab to do whatever you want

Here is a screen shot of where you can see the different possibilities


Re: Docking package (plus examples) [message #23973 is a reply to message #23971] Sun, 13 December 2009 10:56 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1310
Registered: September 2007
Ultimate Contributor
Hi Didier,

That's not exactly what I meant, but it's indeed what I'm using Smile
I'll wait to introduce docking in my app later on.
What I wanted to do was the ability to open more application files, show them inside a tabbed view and have the ability to undock each "job" to have it on a separate window, if needed.... handy to look, for example, at 2 jobs at once.
Just a little comfort more when copy/paste between different jobs whithout having to switch between them with the tabs.
I like also the autohide function, for page selection, for example, but I'll wait to introduce it later, too. I think I'll have to extend a bit the docking package, but no time now.

Thank you for answer Smile

Ciao

Massimo
Re: Docking package (plus examples) [message #23998 is a reply to message #23973] Wed, 16 December 2009 13:36 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
I think everything you need is in the TabBar package, and you can add docking later. It's much more suited to a document tab system than TabCtrl is.

Just make a TopWindow derived document viewing window with a TabBar frame and add the callback behaviour. You may only need to use WhenClose and WhenAction, the others are there to support complex behaviour.

Unfortunately the Autohide behaviour is missing, I'm not sure why. Possibly I forgot to add it but it can also cause some layout problems so maybe it's left out for that reason. The DockTabBar class in the Docking package implements it and it's not much code so you could add it youself to a derived class.

If you want to overload the right-click menu you must create a derived class and overload ContextMenu.

There is a lot of additional stuff you can do with it if you want to (custom icons and Display, groups, key/value behaviour and stacking to name a few) but out-of-the box it should fit your requiredments fairly well. Let me know if you need some assistance, there isn't any documentation at the moment.

James
Re: Docking package (plus examples) [message #24030 is a reply to message #23998] Sat, 19 December 2009 23:06 Go to previous message
mdelfede is currently offline  mdelfede
Messages: 1310
Registered: September 2007
Ultimate Contributor
Hi mrjt,

thank you for suggestions, I' already using tabctrl, but I'll try to add docking/autohide later on, when app will be finished.

Ciao

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


Current Time: Mon Apr 27 20:06:07 GMT+2 2026

Total time taken to generate the page: 0.01850 seconds