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)
Re: Docking package (plus examples) [message #19289 is a reply to message #19116] Mon, 24 November 2008 13:27 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Sorry for the delay.

I think I've fixed the X11 issues. it was an uninitialised variable, as usual. I missed this only testing with example 2 because it serializes and initialises the variable.

I haven't looked at the Vista 'no contents' problem, this will probably take some time to fix and I'm pretty busy at the mo. It should be noted that this problem will occur anytime the WM behaviour is not what I'm expecting (some Linux WMs do this too) and each instance just has to be fixed on it's own. I don't think there is a universal solution.

I cannot reproduce any problems with closing tabs (after the X11 fix), could you provide more information?

Novo


I wonder if it is possible to make at least one stable docking control/package?

Yes. The problems you've encountered are the result of:
1- Not enough prople having used it to report all of the bugs yet
2- System specific support being required for certain OSs
Both of these will be fixed with time and your feedback will help, response time is just a little slow at the moment because I'm very busy.

Quote:

Sorry for being annoying.

Nonsense Smile Thank you for the feedback!

James
Re: Docking package (plus examples) [message #19291 is a reply to message #19289] Mon, 24 November 2008 18:14 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
mrjt wrote on Mon, 24 November 2008 07:27


1- Not enough prople having used it to report all of the bugs yet



That can be improved by moving it to uppsrc... Smile

Mirek
Re: Docking package (plus examples) [message #19293 is a reply to message #19289] Mon, 24 November 2008 18:48 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
Thanks.

mrjt wrote on Mon, 24 November 2008 07:27


I cannot reproduce any problems with closing tabs (after the X11 fix), could you provide more information?

James


I checked in Windows XP Professional, no administrative privileges, svn rev. 671, MSVC 71. Closing tabs crashes in Debug configuration in DockCont.cpp line 383 with memory access violation. This is a call to Layout(). TheIDE debugger is not very helpful in this situation. And the Visual Studio itself cannot open executable.

There is no crash in Optimal configuration. In this case controls just get hidden.

Behavior is different when DockingExample1 runs under TheIDE debugger or standalone. Under debugger ArrayCtrl1 and TreeCtrl1 disappear when I start dragging TreeCtrl2. Looks like uninitialized variable to me.

I ran DockingExample1 under Purify and got only a report about two memory leaks and nothing about reading uninitialized memory. That is strange.


Regards,
Novo
Re: Docking package (plus examples) [message #19295 is a reply to message #19291] Mon, 24 November 2008 19:13 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

luzr wrote on Mon, 24 November 2008 12:14

mrjt wrote on Mon, 24 November 2008 07:27


1- Not enough prople having used it to report all of the bugs yet



That can be improved by moving it to uppsrc... Smile

Mirek


I already moved it in my local repo. Maybe I'll commit it. I waited for complete integration of it with ide (50%) but recently I was simply lack of time. So I'll move it there now if noone raises an objection Smile
Re: Docking package (plus examples) [message #19297 is a reply to message #19295] Mon, 24 November 2008 20:20 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
unodgs wrote on Mon, 24 November 2008 13:13

So I'll move it there now if noone raises an objection Smile


IMHO Docking package is not usable at the moment.


Regards,
Novo
Re: Docking package (plus examples) [message #19304 is a reply to message #19275] Tue, 25 November 2008 06:00 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
Oblivion wrote on Sun, 23 November 2008 16:38

If possible, could you give some details about the assert?




Hi Oblivion,

DockCtrlExample + Vista + disabled "Show window contents while dragging" + MSVC71/MSVC9 + SVN rev. 671 + Debug configuration, of course.

Just launch DockCtrlExample and try to close "Dock 4".

DockTabs.cpp line 436. This is a call to WhenActive() in method TabInterface::LeftDown(). Assert happens in Vector::Get(int i). Variable "active" is zero.

I'm also getting memory access violation when trying to dock "Dock 5" control into "Dock 2" control. It happens in Ctrl.cpp line 258, method Ctrl::IsVisible(). It is called from CtrlDraw.cpp line 43 (Ctrl::Refresh()), which is called from DockableCtrl.cpp line 192, DockableCtrl::WindowProc().

I hope that helps.


Regards,
Novo
Re: Docking package (plus examples) [message #19308 is a reply to message #19293] Tue, 25 November 2008 13:39 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Novo

I checked in Windows XP Professional, no administrative privileges, svn rev. 671, MSVC 71. Closing tabs crashes in Debug configuration in DockCont.cpp line 383 with memory access violation. This is a call to Layout(). TheIDE debugger is not very helpful in this situation. And the Visual Studio itself cannot open executable.

There is no crash in Optimal configuration. In this case controls just get hidden.


Thanks, I've found and fixed the problem. It was introduced with a recent change, and a ctrl was deleting itself by accident. It was the change I made after saying:
Novo

there is also one major addition I need to make which may introduce some new bugs.
So I'm not that suprised Smile

Novo

Looks like uninitialized variable to me.

I didn't get around to updating the svn yesterday, so I would guess that this is the problem I fixed.

Novo

IMHO Docking package is not usable at the moment.
I've actually been using an older stable version of it for a few months without issues. I do have the advantage of a fixed target platform however.

I've now updated the SVN (rev. 672) with both fixes and changed the code style to better match uppsrc. I don't plan on making any major additions to the code now (unless someone comes up with some amazing new features), so I have no objections to moving it to uppsrc. I'll update and improve the documentation when I get the chance, perhaps later this week.

[Updated on: Tue, 25 November 2008 14:06]

Report message to a moderator

Re: Docking package (plus examples) [message #19314 is a reply to message #19308] Tue, 25 November 2008 18:09 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
Hi mrjt,

Thanks for taking care of the problems!

Docking package got much more stable, although there is a couple of minor issues.

1) Undocking-docking of a single control still shrinks its size. To reproduce that try to undock-dock “ArrayCtrl 2” in DockingExample1. It will shrink to the size of splitter.

2) Layout of “Dockable Window Manager” is broken.


index.php?t=getfile&id=1499&private=0
  • Attachment: dwm.JPG
    (Size: 32.27KB, Downloaded 1089 times)


Regards,
Novo
Re: Docking package (plus examples) [message #19315 is a reply to message #19314] Tue, 25 November 2008 18:52 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Thanks.

I've fixed the layout issue.

The size issue is more complicated, it a combinatiojn of two factors:
- This is actually deliberate. The docking code is attempting to keep all of the other ctrls that are docked in the same pane above their minimum sizes. The newly docked ctrl is guaranteed to get it's minimum size but anything more than that is dependent on how much spare space there is.
If you make the window larger (I've updated DockingExample1 so that you can now do this) you should see the ctrl getting more space.
There is still rom for improvement in the sizing algorithms, if you have any ideas please let me know
- There was a minor bug that may have prevented the ctrl using as much size as it was supposed to, but in this case I don't think it was the limiting factor

New update is revision 674

James
Re: Docking package (plus examples) [message #19326 is a reply to message #19315] Wed, 26 November 2008 18:04 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
Hi James,

mrjt wrote on Tue, 25 November 2008 12:52


I've fixed the layout issue.

James


Thanks a lot!

I checked Docking package with disabled "Show window contents while dragging" in both Windows XP and Vista. Docking is still not working in both these configurations. In opposite, DockCtrlExample (by Ismail Yilmaz) is working correctly in these configurations. I suspect Ismail won’t object stealing some of his code … Wink

Thanks.


Regards,
Novo
Re: Docking package (plus examples) [message #19332 is a reply to message #19326] Thu, 27 November 2008 10:28 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Novo wrote on Wed, 26 November 2008 17:04

Hi James,

mrjt wrote on Tue, 25 November 2008 12:52


I've fixed the layout issue.

James


Thanks a lot!

I checked Docking package with disabled "Show window contents while dragging" in both Windows XP and Vista. Docking is still not working in both these configurations. In opposite, DockCtrlExample (by Ismail Yilmaz) is working correctly in these configurations. I suspect Ismail won’t object stealing some of his code … Wink

Thanks.


I didn't realise you could do it in XP as well, I would have fixed it sooner Smile

Turned out I just needed to change the event I was listening for to WM_MOVING. The fix is in revision 678.

Thanks for all your testing!

[Updated on: Thu, 27 November 2008 11:34]

Report message to a moderator

Re: Docking package (plus examples) [message #19343 is a reply to message #19326] Thu, 27 November 2008 20:46 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1092
Registered: August 2007
Senior Contributor
Novo wrote on Wed, 26 November 2008 19:04

Hi James,

mrjt wrote on Tue, 25 November 2008 12:52


I've fixed the layout issue.

James


Thanks a lot!

I checked Docking package with disabled "Show window contents while dragging" in both Windows XP and Vista. Docking is still not working in both these configurations. In opposite, DockCtrlExample (by Ismail Yilmaz) is working correctly in these configurations. I suspect Ismail won�t object stealing some of his code � Wink

Thanks.



Hi Novo,

Of course I won't mind. DockCtrl and it's example codes belong to U++ community. Please feel free to use/modify/change and "steal" it Smile

Hi Mrjt,

Don't worry about "beta" testers. Currently, I am testing your Docking package on several OS configurations (ranging from latest (k)ubuntu distros (8.10/KDE 4+ and Gnome 2.24) to XP(SP3)/Vista(SP1)/Win98(SE). I have encountered some "small" bugs, but didn't have the time to make a list of them (by the way, it seems that most of them are already exposed). I will come up with an up-to-date bug list asap.

Regards.


[Updated on: Thu, 27 November 2008 20:47]

Report message to a moderator

Re: Docking package (plus examples) [message #19347 is a reply to message #19343] Fri, 28 November 2008 07:28 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
Hi James,

Thank you very much! I didn't mean to push you. I just wanted to use Docking package and met all these problems. They all used to be major problems for me.

Thanks again!


Regards,
Novo
Re: Docking package (plus examples) [message #19784 is a reply to message #19347] Sun, 18 January 2009 20:18 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
Is it possible to create hierarchical docking structure?

For example, I'm developing a database application. In database world you have master tables and detail tables (one-to-many relationship). Detail tables can have their detail tables, e.t.c.

It would be nice to be able to represent such hierarchical system as a set of docking controls.

The only limitation I see right now is that the Docking system seems to be a flat system. You have one main DockWindow, and you can dock DockingCtrl everywhere you want. The only hierarchy allowed is nested tabs via NestedTabs() call.

You can doc your controls everywhere in DockWindow.

In my database world I'd like to have a set of DockWindow (or docking containers), which is organized hierarchically, and DockingCtrl linked (and limited) to a particular docking container, so, I may dock detail controls to a particular main control only.

TIA


Regards,
Novo
Re: Docking package (plus examples) [message #19790 is a reply to message #19784] Wed, 21 January 2009 12:15 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Novo wrote on Sun, 18 January 2009 19:18

Is it possible to create hierarchical docking structure?

For example, I'm developing a database application. In database world you have master tables and detail tables (one-to-many relationship). Detail tables can have their detail tables, e.t.c.

It would be nice to be able to represent such hierarchical system as a set of docking controls.

The only limitation I see right now is that the Docking system seems to be a flat system. You have one main DockWindow, and you can dock DockingCtrl everywhere you want. The only hierarchy allowed is nested tabs via NestedTabs() call.

You can doc your controls everywhere in DockWindow.

In my database world I'd like to have a set of DockWindow (or docking containers), which is organized hierarchically, and DockingCtrl linked (and limited) to a particular docking container, so, I may dock detail controls to a particular main control only.

TIA


Holy crap, it works! I never tried that because it just seemed too insane to work Smile. You can have a DockWindow as a child of another DockWindow, and you can even have a Dockable DockWindow.

I've attached a modified version of DockingExample1 that shows this (see the DockInit function in main), but it's very simple:
	// Add our child docking window!
	DockTop(Dockable(subdock, "Child DockWindow").SizeHint(Size(300, 400)));
	subdock.DockTop(Dockable(arrayctrl2, "ArrayCtrl 2").SizeHint(Size(300, 200)));
	subdock.DockRight(Dockable(treectrl2, "TreeCtrl 2").SizeHint(Size(300, 200)));

[Updated on: Wed, 21 January 2009 12:20]

Report message to a moderator

Re: Docking package (plus examples) [message #19801 is a reply to message #19790] Thu, 22 January 2009 06:47 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
mrjt wrote on Wed, 21 January 2009 06:15


Holy crap, it works! I never tried that because it just seemed too insane to work Smile. You can have a DockWindow as a child of another DockWindow, and you can even have a Dockable DockWindow.

I've attached a modified version of DockingExample1 that shows this (see the DockInit function in main), but it's very simple:
	// Add our child docking window!
	DockTop(Dockable(subdock, "Child DockWindow").SizeHint(Size(300, 400)));
	subdock.DockTop(Dockable(arrayctrl2, "ArrayCtrl 2").SizeHint(Size(300, 200)));
	subdock.DockRight(Dockable(treectrl2, "TreeCtrl 2").SizeHint(Size(300, 200)));




It is just cool !!! Thanks a lot !!! I thought I may have only one TopWindow or DocWindow in my application.

One small problem. When I hide a control, which belongs to subdock (treectrl2, for example), and then make it float using DocManager, treectrl2 takes main DocWindow as a container. So, I cannot dock it back into "Child DockWindow".


Regards,
Novo
Re: Docking package (plus examples) [message #19802 is a reply to message #19801] Thu, 22 January 2009 11:12 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Ah, I made a mistake. The code should be:
	// Add our child docking window!
	DockTop(Dockable(subdock, "Child DockWindow").SizeHint(Size(300, 400)));
	subdock.DockTop(subdock.Dockable(arrayctrl2, "ArrayCtrl 2").SizeHint(Size(300, 200)));
	subdock.DockRight(subdock.Dockable(treectrl2, "TreeCtrl 2").SizeHint(Size(300, 200)));

Because the Dockable function registers the ctrl with the window it must be called using on the DockWindow you wish to own it, otherwise at some point there will be problems Smile

The Docking configration window only applies to a single DockWindow instance.
Re: Docking package (plus examples) [message #19805 is a reply to message #19802] Fri, 23 January 2009 05:14 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
Thanks.

mrjt wrote on Thu, 22 January 2009 05:12


The Docking configration window only applies to a single DockWindow instance.


In such case how can I prevent closing of DockableCtrl? Once closed it cannot be accessed any more ...


Regards,
Novo
Re: Docking package (plus examples) [message #19814 is a reply to message #19805] Fri, 23 January 2009 13:20 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
You have several options here:
- Use the DockWindow::WindowButtons function to remove the close button from all it's child windows
- You can use the Docking config window to manage all of the DockWindows, but only one at a time. Just call DockWindow::DockManager on the window you want to manage.
- Provide some custom method for controlling the windows. The DockMenu class is provided to support custom menus. Or perhaps you could have a toolbar with window icons, and when the user clicking on them would call DockWindow::ActiveDockable to restore it to it's last position. There are many options here.

[Updated on: Fri, 23 January 2009 13:50]

Report message to a moderator

Re: Docking package (plus examples) [message #19815 is a reply to message #19814] Fri, 23 January 2009 14:39 Go to previous messageGo to previous message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
After fiddling with it for a bit I found a few relatively minor bugs with Activate that I've fixed.

Also calling ActivateDockable on an already visible window now highlights it's position for the user. Useful on a crowded display.

Revision 797.

Also heres the code to fill a toolbar with DockableCtrl icons:
void DockingExample::WindowBar(Bar &bar)
{
	const Vector<DockableCtrl *> &ctrl = GetDockableCtrls();
	for (int i = 0; i < ctrl.GetCount(); i++)
		bar.Add(AsString(ctrl[i]->GetTitle()), ctrl[i]->GetIcon(), THISBACK1(ActivateWindow, ctrl[i]));
}

void DockingExample::ActivateWindow(DockableCtrl *ctrl)
{
	ActivateDockable(*ctrl);
}

It would be nice to limit the icons only to invisble windows, but I can't find a reliable way of triggering a Callback notification when ctrls close. There are just too many code paths that control it, but I might have a another go in the future.
Previous Topic: SysInfo, Functions4U and Controls4U packages
Next Topic: TabBar Major Revision
Goto Forum:
  


Current Time: Thu Apr 25 04:08:19 CEST 2024

Total time taken to generate the page: 0.03250 seconds