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 » U++ Library support » U++ Widgets - General questions or Mixed problems » DockCtrl (A dockable window widget for U++)
Re: DockCtrl (A dockable window widget for U++) [message #11998 is a reply to message #11997] Sun, 07 October 2007 11:16 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1093
Registered: August 2007
Senior Contributor
unodgs wrote on Sun, 07 October 2007 12:04

luzr wrote on Sun, 07 October 2007 04:26


I must have missed something... Where is the new executable? Smile


Oblivion always updates first post in this topic.


Smile Yes, IMO it's better to keep it that way. I update the executable on the first post every week.


Re: DockCtrl (A dockable window widget for U++) [message #11999 is a reply to message #11995] Sun, 07 October 2007 11:22 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1093
Registered: August 2007
Senior Contributor
unodgs wrote on Sun, 07 October 2007 10:43

Oblivion wrote on Sat, 06 October 2007 20:52

Ok, here is the new executable.
I've added basic QT-like DnD animation. Finally I've got my hands on two linux distros (Ubuntu-Beryl and Pardus (Turkish)). So I hope that I will release a X11 based exe in coming weeks. (I didn't have the time to install them. (I'll do it probably this week).


Hi! Very impressive! It's almost what I was thinking of (those cool qt animations can be added at the very end). The only missing thing now is tabbed panel and I wonder how tabs should look like. Should they have native look (then you could use tabctrl code to render tabs) or custom one. I think native will be better. Anyway don't stop coding Wink Results are great!



Well, I prefer native look too. To tell you the truth, it is easy to implement a custom tabctrl. But I think the native U++ style should be preserved (but it is going to be more time consuming).
Anyway, I will try to implement a native looking tabctrl (what worries me most is that the native tabctrl has tabs only on top. But we want it to be alignmed dynamically on any side.)


Re: DockCtrl (A dockable window widget for U++) [message #12004 is a reply to message #11482] Sun, 07 October 2007 18:58 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1093
Registered: August 2007
Senior Contributor
I have added a working TheIDE screenshot with DockCtrl. I couldn't post the modded TheIDE executable, the file limit is 2 MB and I don't know if it will be legal to do so. So if Mirek (I'm calling you Mirek, but hope you dont mind)or any other developers can confirm that it is legal, I will compress and upload a Win32 executable of TheIDE 709-Dev1 asap.

Here is the actual code:

in ide.h
// Splitter pfsplit;
// Splitter wesplit;

//========================================================== ============
// DockCtrl declarations.
// ---------------------
// DockCtrl dockctrl (main control)
//
// DockWindows are used instead of the splitters:
// pfsplit -> packagelistdock, filelistdock;
// bottom -> bottomdock
//========================================================== ============

DockCtrl dockctrl;
DockWindow packagelistdock, filelistdock, bottomdock;


in ide.cpp (Ide::SetMain())

//=======================================
// Actual DockCtrl code...
//=======================================

if(dockctrl.IsOpen() || dockctrl.IsChild()) dockctrl.Remove();
Add(dockctrl.Base(this).SetPaneSize(180).Dock(packagelistdoc k.SetLabel( "Packages").Left().SShow().SetIcon(IdeImg::Package())));
dockctrl.SetPaneSize(180).Dock(filelistdock.SetLabel("File List").Left().SShow().SetIcon(IdeImg::Source()));
dockctrl.SetPaneSize(260).Dock(bottomdock.SetLabel("Bottom Pane").Bottom().SShow().SetIcon(IdeImg::console()));


//=======================================
//
//=======================================

(this is the actual and-will-be syntax of DockCtrl(SetIcon() is optional).

in idewin.cpp 9 lines of code commented out.

// editor_bottom.Vert(right_split, bottom);
// editor_bottom.SetPos(8000);

// pfsplit.SetPos(2000);
// pfsplit.Vert(package, filelist);
// wesplit.Vert(pfsplit, editor_bottom);
// wesplit.SetPos(10);
// Add(wesplit);
// packagelistdock.Float();

and added:


packagelistdock << package.SizePos();
filelistdock << filelist.SizePos();
bottomdock << bottom.SizePos();

And, yes it is working and this easy. Hide bottom pane and hide workspace codes are broken, but the can be fixed by adding

dockctrl.ShowxxxPane()
dockctrl.HidexxxPane()

codes at appropriate lines.

(here xxx is left,right, top, bottom (eg. ShowLeftPane())

Smile

(probably there are more difficulties that I will encounter, but it's neither TheIDE's nor DockCtrl's fault).

Regards



[Updated on: Sun, 07 October 2007 20:02]

Report message to a moderator

Re: DockCtrl (A dockable window widget for U++) [message #12154 is a reply to message #11482] Sat, 13 October 2007 14:13 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1093
Registered: August 2007
Senior Contributor
Hi,
This week I've managed to add default and custom chameleon/skin support for DockWindow. From now on, it is possible to skin the dragbar and dragbar buttons. By default, there are 3 skins: classic, enhanced and modern. By default, DockWindow class uses modern skin. But it can be changed on-the-fly through Control Panel. I've also added a custom skin support, so that programmer can add his/her custom skin to the skin list. (Hope you'll like it). For other changes and example executable, please look at the change log. It's in the first post of this topic.

Smile

Any feedback, suggestions, hints and constructive criticism are welcome.

Regards.


Re: DockCtrl (A dockable window widget for U++) [message #12155 is a reply to message #12154] Sat, 13 October 2007 17:10 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

New buttons are quite pretty, but IMO too much rounded. I found you fixed inserting window "in the middle". I mean in the previous version if there were 3 or more docked windows in a row it wasn't possible to insert dragged window at 2nd or 3rd position - only at the beginning or the end. Now I can Smile but if I drag the widnow and "docking system" shows blue rectangle and in the meantime mouse goes over a splitter bar - blue rectangle disappear and appears again as soon as mouse is not longer over the splitter. This causes unpleasant effect some kind of flickering. If you could eliminate that please do it Smile.
The second problem is right docked window. It's not possible to get it and put it in the same position (to make it fills the whole right area (from top to the bottom of the window)).
If something of it it's unclear to you please ask for further explanations.
All in all we're very close to achieve basic functionality. Great progress!
Re: DockCtrl (A dockable window widget for U++) [message #12156 is a reply to message #12155] Sat, 13 October 2007 17:19 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

One more bug. Run your example. Now grab the right panel and move it to the top right corner of the window (do not release the left mouse button). You should see blue rectangle in this corner. Now move the mouse down. You should observe a lot of flickering.
Re: DockCtrl (A dockable window widget for U++) [message #12157 is a reply to message #12155] Sat, 13 October 2007 18:07 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1093
Registered: August 2007
Senior Contributor
Quote:

New buttons are quite pretty, but IMO too much rounded.


Well I'm not very good at drawing and graphics. If someone would provide me with a better image/icon set, I will gladly change the so-called "skins." Smile

Quote:

if I drag the widnow and "docking system" shows blue rectangle and in the meantime mouse goes over a splitter bar - blue rectangle disappear and appears again as soon as mouse is not longer over the splitter. This causes unpleasant effect some kind of flickering. If you could eliminate that please do it Smile.


Yes I will eliminate the flickering problem in this week. It's very annoying indeed.

Quote:

The second problem is right docked window. It's not possible to get it and put it in the same position (to make it fills the whole right area (from top to the bottom of the window)).


Smile Oops, my fault. I was so busy with the dock positioning and chameleon that I forgot to implement the ShowPane() method for empty panes (It gets locked when it's empty and there is no dnd-source). I'll fix it asap.


And, Thank you for your bug reports and feedback. Smile

regards


[Updated on: Sat, 13 October 2007 18:14]

Report message to a moderator

Re: DockCtrl (A dockable window widget for U++) [message #12390 is a reply to message #11482] Sat, 27 October 2007 12:01 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1093
Registered: August 2007
Senior Contributor
Ok, here we are again. Sorry for the long delay. I was very busy in last week. So you will only find a number of bugfixes in the current example (0.49.9.9a). The good news I think we are much more closer to the first publication of the source code. I've finally installed the two Linux derivatives (Ubuntu (with beryl) and Pardus) and I will probably compile the example on them this, or next week. I've implemented a qt-like animation but did not have the time to test it, so it will stay disabled for a little while. As for the skins, Classic skin is reverted to the standard system color, so I think it now has more native-look. I've also added to one of the dockwindows a simple "layout." (to show that they are fully in U++). The Tabbed dockwindows are finally in progress too...
Ps: I am well aware that Drag-Drop animations and sizing are not very good. They will be improved, asap)

Regards.


Re: DockCtrl (A dockable window widget for U++) [message #12536 is a reply to message #12390] Wed, 07 November 2007 20:18 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

Hi. Sorry for delayed answer. 0.49.9.9a (how do you know what particular number is for Wink ) is great. I mean all my bugs are in fact gone. I like the new blue background when window is detached. I'm waiting for a new version!
Re: DockCtrl (A dockable window widget for U++) [message #12619 is a reply to message #12536] Sun, 11 November 2007 00:16 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1093
Registered: August 2007
Senior Contributor
Hi, I am sorry for the delay (both for the answer and for the new exe). But, unfortunately, I am still too busy with my school and my job, so I am going to post a new executable (hopefully with the linux/X11 exe this time) next week. As for the version numbers, I am going to sync it with the U++ and use U++ versioning style (e.g. 711a) when I release the source code Smile

p.s.: Don't be mistaken by the slow down. Progress is only temporarily slowed down. I will not drop the project (actually, it is in progress at the background). Wink


Re: DockCtrl (A dockable window widget for U++) [message #12660 is a reply to message #12619] Mon, 12 November 2007 15:40 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
How are you doing on the X11 port? I've been looking at the problem myself and it looks like X11 doesn't supply the necessary events to implement window dragging as cleanly as on Windows. The only available event is the equivalent of WM_MOVE, and you can't get the status of the mouse buttons during the drag without calling XQueryPointer, which should probably be avoided.

I've seen it suggested that Qt requires Window Manager specific code for this (I haven't checked the source myself) which, if true, would mean that a 'pure' X11 implementation may be impossible. Additionally, changes to TopWindow would be necessary to support the _NET_WM_WINDOW_TYPE_DOCK style.

In case it helps, here is the code that starts window dragging after an undocking:
	Atom xwndDrag = XAtom("_NET_WM_MOVERESIZE");
	XEvent e;
	Zero(e);
	e.xclient.type = ClientMessage;
	e.xclient.message_type = xwndDrag;
	e.xclient.window = wnd.GetWindow();
	e.xclient.format = 32;
	e.xclient.display = Xdisplay;
	e.xclient.send_event = XTrue;
	e.xclient.data.l[0] = p.x;
	e.xclient.data.l[1] = p.y;
	e.xclient.data.l[2] = 8;
	e.xclient.data.l[3] = 1;
	e.xclient.data.l[4] = 0;	
	
	XUngrabPointer( Xdisplay, CurrentTime );
	XSendEvent(Xdisplay, RootWindow(Xdisplay, Xscreenno), XFalse, SubstructureNotifyMask, &e);
	XFlush(Xdisplay);	
It is the same as doing:
	SendMessage(wnd.GetHWND(), WM_NCLBUTTONDOWN, 2, MAKELONG(p.x, p.y));
with Win32.

If you find/have found a solution to the window dragging issue I'd love to hear about it Smile

James

[Updated on: Mon, 12 November 2007 15:52]

Report message to a moderator

Re: DockCtrl (A dockable window widget for U++) [message #12674 is a reply to message #12660] Mon, 12 November 2007 23:12 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1093
Registered: August 2007
Senior Contributor
Thank you very much mrjt. To be honest, since the only platform specific implementation is about window dragging and moving, this issue is the cause of the delay of the X11 executable. I'm trying to find a workaround for it. After I achieve at something concrete, I would be glad to share my experience with you Smile

[Updated on: Mon, 12 November 2007 23:20]

Report message to a moderator

Re: DockCtrl (A dockable window widget for U++) [message #12706 is a reply to message #12674] Tue, 13 November 2007 16:14 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Thanks. The reason I'm interested is that I'm still working on a version of this myself (for fun as much as anything else). I've attached a demo, which is pretty much feature complete barring the X11 port. I've decided that your drag-drop approach is better than VS style popups, but it's not quite as pretty as yours Smile

Known issues:
Autohide popup alignment is incorrect on right/bottom bars (I have no idea why this is, it varies depending on the window).
Sizing of docked windows isn't intelligent enough yet.
Tabs are quite ugly (I'm waiting for the new Chameleonized QuickTabs so I can steal the drawing code Smile).
Still not tested on Vista, so please let me know if there are problems.

James
  • Attachment: DockTest.zip
    (Size: 524.76KB, Downloaded 265 times)

[Updated on: Wed, 14 November 2007 11:08]

Report message to a moderator

Re: DockCtrl (A dockable window widget for U++) [message #12719 is a reply to message #12706] Tue, 13 November 2007 21:51 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1093
Registered: August 2007
Senior Contributor
To be honest, your widget is far better than mine (at least, in functionality Smile ) And I'm really impressed by the progress. I think i will need your help (If you dont mind) for the autohide feature. Mine is not very good Sad Which ctrl did you use to create that sliding pane?

ps: There is a bug in your docktest.exe which leads to crash on Xp and Vista (basic):

When I try to undock (float) a tabbed window via the dropdown menu ("floating"), AND when it asks: "There are multiple tabs open, which would you like to float", if I select the "All other tabs" option, the example crashes immediately.





Re: DockCtrl (A dockable window widget for U++) [message #12721 is a reply to message #12719] Wed, 14 November 2007 09:10 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

I see we have two competiting solutions Smile Great Smile I think you should work together instead of developing the same thing separately. Maybe we should add DockCtrl to uvs tree so you could easily cooperate.
I also think that Oblivion's docking system is prettier and more intuitive. I think following qt docking system is the best way. Qt guys did great job there. As for tabs. I could modify quick tabs to be more universal widget that could draw tabs in any direction and support drag and drop in any direction too. Of course I don't have any objections to coping paint routines to your code if you want to develeop the whole system on your own now.
Anyway both of you are doing a great job. Just don't stop Smile This will be very important part of upp.
Re: DockCtrl (A dockable window widget for U++) [message #12725 is a reply to message #12719] Wed, 14 November 2007 11:46 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Oblivion

And I'm really impressed by the progress.
Thank you, I guess I've had more time do spend ont it than you have.

Oblivion

ps: There is a bug in your docktest.exe which leads to crash on Xp and Vista (basic):
Thanks, I've fixed it and re-uploaded.
Oblivion

Which ctrl did you use to create that sliding pane?
It's a popup that gets resized to do the animation. I may have to change this as I'm not sure it will work on Linux.
unodgs

I also think that Oblivion's docking system is prettier and more intuitive.
It's definitely prettier, but as everything is drawn with chameleon this is easy to change. I'm not sure what you mean by more intuitive because if you enable simple docking and disable tabbing they work almost identically.

The complex docking (it works something like a tree of splitter ctrls) is actually the main reason I was developing this myself - I didn't think anyone else would and I wanted it Smile
unodgs

I think following qt docking system is the best way. Qt guys did great job there.
I've only seen the examples, but I disagree. I think they are fairly ugly, missing features and even contain some small bugs. We can do much better.

The only things currently missing to match the Qt feature set is the animation and some configuration options. After that I have a list of additional features that I want.
unodgs

I could modify quick tabs to be more universal widget that could draw tabs in any direction and support drag and drop in any direction too.

This was partly my intention as I think Upp would be improved by having a general QuickTabs frame, which I could then use. But I think you would do a much better job at this than me!
unodgs

I think you should work together instead of developing the same thing separately.

I agree, but since niether of us has posted the source this has been impossible. I want to do some tidying/restructuring first (it's complicated code and gets a bit messy in places) and I'm away this weekend, but I'll hopefully post it next week.

The next problem is the X11 port. I have a bad feeling about this Sad

James

[Updated on: Wed, 14 November 2007 11:50]

Report message to a moderator

Re: DockCtrl (A dockable window widget for U++) [message #12726 is a reply to message #12725] Wed, 14 November 2007 13:15 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

Quote:

I'm not sure what you mean by more intuitive because if you enable simple docking and disable tabbing they work almost identically.

Yes, you're right. Didn't notice that switch Smile I toyed a little bit more with your app and found that in not simple docking mode you allow to divide window "in four ways" (I hope you know what I mean Smile ). And I know why it looked strange at first sight to me. If for example you drag a window to the bottom part of a main window and there is another widnow the height of these 2 widnows should be summed up not divided by 2.
Anyway I think we could have this 2 docking systems built-in (with some switches like calculating this height/width mode for example)
Quote:

I've only seen the examples, but I disagree. I think they are fairly ugly, missing features and even contain some small bugs. We can do much better.
The only things currently missing to match the Qt feature set is the animation and some configuration options. After that I have a list of additional features that I want.

Try mainwidnows example. And of course we could be better. I'll modify my previous statement. We should at least achieve qt level Smile And in fact only those animations are not implemented yet.
Quote:

This was partly my intention as I think Upp would be improved by having a general QuickTabs frame, which I could then use. But I think you would do a much better job at this than me!

Ok, just tell me (you and oblivion) what interface you need (eg what callbacks should be there and when they should be called).
Quote:

I agree, but since niether of us has posted the source this has been impossible. I want to do some tidying/restructuring first (it's complicated code and gets a bit messy in places) and I'm away this weekend, but I'll hopefully post it next week.


So post the code right now Smile (you can sand it to me by email if you don't want to make it public yet) I'll move it to our repository tree and give you instructions how to use it.
Quote:


The next problem is the X11 port. I have a bad feeling about this

I guess so. But let's have it done in win32 first at least.
Re: DockCtrl (A dockable window widget for U++) [message #12740 is a reply to message #12726] Wed, 14 November 2007 16:47 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
I guess I may as well post it. Just don't look to closely at the code Smile

unodgs

If for example you drag a window to the bottom part of a main window and there is another widnow the height of these 2 widnows should be summed up not divided by 2.

This is what I meant by sizing needs more intelligence. It works reasonably well in simple mode (though it still needs improvement), but becomes difficult to work out what's going on in more complex cases and I haven't sorted it out yet. One reason for some restructuring is to make this easier.

unodgs

Ok, just tell me (you and oblivion) what interface you need (eg what callbacks should be there and when they should be called).

My requirements aren't great. Something like:
Callback 	WhenSelect;
Callback 	WhenHighlight;
Callback 	WhenDrag;
Callback 	WhenContext;
Callback        WhenTabClose;

QuickTabs &AddTab(Value &key, Value &list, Display *display = NULL);

QuickTabs &NoSelection(bool s = true);
QuickTabs &NoHighlight(bool h = true);
// Plus usual get/set stuff
Plus some caveats:
Drag-drop needs to be overridable, because I need dragged tabs to turn into windows, not start a DnD op.
Height (width if vertical) must be scaleable in some way.
I think everything specialised I need could then be added by an inheriting class (Autohide, storing Ctrls etc.). You can see my TabBar class for exactly what I use, I hadn't really got as far as generalising it.

James
  • Attachment: Docking.zip
    (Size: 31.40KB, Downloaded 267 times)
Re: DockCtrl (A dockable window widget for U++) [message #12742 is a reply to message #12726] Wed, 14 November 2007 17:08 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1093
Registered: August 2007
Senior Contributor
Quote:

So post the code right now Smile (you can sand it to me by email if you don't want to make it public yet) I'll move it to our repository tree and give you instructions how to use it.


Ok then, so here's the deal Smile

I will gladly send you (and/or mrjt) the source code of my "dockctrl" implementation. And I will send you the 049.9.9a (package used in the last executable I've uploaded )because 0.50 (with tabs and autohide) is in progress, and the code is not stable yet . I removed all the buggy autohide system from the source). I'm not posting here; not because I consider it to be a "top secret" government project, but because I think that the source code is not mature enough, and as mrjt stated, it has to be refactored/restructured (and it will be). But please don't expect a miracle; the code is, imho, fairly simple for a such project (that's a reason why I'm not confident to publish it yet, you may find it it almost "silly" when you examine it).

But please give me some feed back, I want to know your idea about the code. Only then, if you find it reasonably good, I will be willing to see it on the uvs of U++. Smile

And one more thing. I am considering to convert the names of the main classes.
Is it not better to make the main ctrl (dockctrl), a window rather than a ctrl. I mean, currently the docs are called DockWindow and the main ctrl is called DockCtrl. Would it not be better if the main ctrl has the name DockWindow? And would it not be better if an application which wants to use docking system, should derive its main window from the DockWindow rather than a TopWindow ? Imho, this is a better approach. What would you think about it?




Re: DockCtrl (A dockable window widget for U++) [message #12746 is a reply to message #12742] Wed, 14 November 2007 17:54 Go to previous messageGo to previous message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
A window would probably be better, though the way I've done it you can have either (have a look at bottom of DockBase.h). The only problem here is that any MenuBars/StatusBars added to the window need to be added before the SplitterFrames.
Previous Topic: TheIDE bug in layout designer?
Next Topic: Linux RectTracker problem
Goto Forum:
  


Current Time: Mon Apr 29 09:54:51 CEST 2024

Total time taken to generate the page: 0.02053 seconds