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 #14270 is a reply to message #14267] Thu, 21 February 2008 13:23 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
You'll have a difficult job stealing my animation code! It's both horifically complicated (due to the tree-like nesting and size-hints) and implemented using a different ctrl. It's not too hard though, IMO the only real problem will be persuading the Splitter to proportionally resize it's children instead of just the animated one.

I'm going to steal your theming code though Smile Nice work!
Re: DockCtrl (A dockable window widget for U++) [message #14271 is a reply to message #14267] Thu, 21 February 2008 13:38 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
unodgs wrote on Thu, 21 February 2008 11:15

And window drag and drop should not work if I start dragging the tab.

I'm not sure about this. IMO in this situation the user is much more likely to want to move the window than re-arrange the tabs. It should be possible to drag the tabs though (works while holding CTRL key in my version).

Re: DockCtrl (A dockable window widget for U++) [message #14272 is a reply to message #14270] Thu, 21 February 2008 14:18 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1093
Registered: August 2007
Senior Contributor
Quote:


You'll have a difficult job stealing my animation code! It's both horifically complicated (due to the tree-like nesting and size-hints) and implemented using a different ctrl. It's not too hard though, IMO the only real problem will be persuading the Splitter to proportionally resize it's children instead of just the animated one.

I'm going to steal your theming code though Smile Nice work!



Well, I won't steal too much Smile I've already implemented a animation system (not in the public version). It's hard but not that hard. I Since I use the splitter as the baseclass of panesplitter, I overrided the layout() method -- i think it's good place to start. But I hate that "10000" bla bal proportion thing Mad

Also, if want to see the "magic" chameleon code just look inside the DockWindow::DraBar::Paint() and DockCtrlChStyle::StyleDefault()you won'belive how easy it is implemented (how fool was I not see it before Very Happy )

Wink




[Updated on: Thu, 21 February 2008 14:30]

Report message to a moderator

Re: DockCtrl (A dockable window widget for U++) [message #14273 is a reply to message #14267] Thu, 21 February 2008 14:27 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1093
Registered: August 2007
Senior Contributor
Quote:


And window drag and drop should not work if I start dragging the tab. The tab itself should be drageed instead in this particular case. If this and window animation (this could be stolen from mrjt Wink )will be done it's all, right? How about linux?



Well, I disagree. I intentionally removed the tab dragging code. Of course I can change that, but wouldn't it be better if the tabs could be rearranged using "middle button" drag (It'a piece of cake to implement this)? As for the linux thing, that what I'm going to steal from mrjt Very Happy I've already examined his X11 code and I have to say that He's done a great job there. It's also very easy to adopt by DockCtrl.

I have a lot of spare time this month, so probably I'll finish the code at the end of March (hopefully)


Re: DockCtrl (A dockable window widget for U++) [message #14275 is a reply to message #14271] Thu, 21 February 2008 15:04 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

mrjt wrote on Thu, 21 February 2008 07:38


I'm not sure about this. IMO in this situation the user is much more likely to want to move the window than re-arrange the tabs. It should be possible to drag the tabs though (works while holding CTRL key in my version).


IMO when you start to drag tab you WANT to rearange tab position, if you drag window top bar you WANT to drag just window. This is how qt docking system works. And Visual Studio too. You can also think of moving tab like about moving window because window is assigned to the tab.
Anyway. To satisfy all of us I propose:
If user start dragging a tab and mouse cursor is in tabs area you dragging the tab, if mouse cursor exceedes tabs area (+5-10 pixel border) user start dragging the window assigned to this tab.
If I hold ctrl tab is dragged no matter what. What do you think?
I only wonder if it's possible to implement with current upp's D&D api.
Re: DockCtrl (A dockable window widget for U++) [message #14277 is a reply to message #14275] Thu, 21 February 2008 15:43 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Quote:

This is how qt docking system works. And Visual Studio too.

The version of VS I have installed (VS Express 2005) works like this (I just checked):
Drag title bar: Detached/move whole window including all tabs
Drag a tab: Detach single tab
Drag a tab with SHIFT key: rearrange tabs

The Qt demo I have (version 4.x, but not the most recent):
Drag title bar: Detaches a single tab
Drag a tab: Does nothing
Drag a tab with SHIFT key: Does nothing (also CTRL does nothing)
Also, Qt doesn't seem to have the ability to detach a whole collection of tabs (hence why dragging the handle undocks only one tab). I don't have much experience beyond looking at some of the source with the Qt system though, so please correct me if I'm wrong.

I think we have it right personally.

[Updated on: Thu, 21 February 2008 15:45]

Report message to a moderator

Re: DockCtrl (A dockable window widget for U++) [message #14286 is a reply to message #14277] Thu, 21 February 2008 18:06 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

You're right. I checked qt example. I don't know why I saw dragable tabs Rolling Eyes I'm sure in VS 2003 I could drag tabs. So let's stay with dragging with Ctrl key pressed but we could add a switch to change this behaviour of course.
Re: DockCtrl (A dockable window widget for U++) [message #14290 is a reply to message #14286] Thu, 21 February 2008 19:27 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
If you want to have a play with how I think the tabs should work I've attached my latest stable build. I've just finished implementing theming (Thanks Oblivion!), and nested tabs. Hold down CTRL while dragging a tab collection to add it as nested (there is a switch to change the default behaviour but I haven't added to the example since I'll have to make a better on soon anyway).

I've also enabled tab grouping, with grayed-out tabs showing inactive (I find quicktabs just hiding them to be a bit confusing).

Hold CTRL to drag tabs. There may be some bugs.

James
  • Attachment: DockTest.zip
    (Size: 566.72KB, Downloaded 288 times)
Re: DockCtrl (A dockable window widget for U++) [message #14296 is a reply to message #14275] Thu, 21 February 2008 20:27 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1093
Registered: August 2007
Senior Contributor
Quote:


IMO when you start to drag tab you WANT to rearange tab position, if you drag window top bar you WANT to drag just window. This is how qt docking system works. And Visual Studio too. You can also think of moving tab like about moving window because window is assigned to the tab.
Anyway. To satisfy all of us I propose:
If user start dragging a tab and mouse cursor is in tabs area you dragging the tab, if mouse cursor exceedes tabs area (+5-10 pixel border) user start dragging the window assigned to this tab.
If I hold ctrl tab is dragged no matter what. What do you think?
I only wonder if it's possible to implement with current upp's D&D api.



Why are you so obsessed with the draggable tabs Very Happy (just kidding) . Well if it suits you, I will add it to my todo list on with high priority. I will add a switch for this. DockCtrl framework is (you may have noticed already) very flexible and it's easy to implement this Wink

Quote:


You're right. I checked qt example. I don't know why I saw dragable tabs Rolling Eyes I'm sure in VS 2003 I could drag tabs. So let's stay with dragging with Ctrl key pressed but we could add a switch to change this behaviour of course.



What about implementing Ctrl OR Middle Mouse Button Drag ?


[Updated on: Thu, 21 February 2008 20:36]

Report message to a moderator

Re: DockCtrl (A dockable window widget for U++) [message #14297 is a reply to message #14296] Thu, 21 February 2008 20:54 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

Oblivion wrote on Thu, 21 February 2008 14:27


Why are you so obsessed with the draggable tabs Very Happy (just kidding) . Well if it suits you, I will add it to my todo list on with high priority. I will add a switch for this. DockCtrl framework is (you may have noticed already) very flexible and it's easy to implement this Wink


I know why! I know why I thought qt has dragable tabs Smile That's because half a day I spend with eclipse.. And eclipse works the way I described as a solution to "satisfy us all". And I personally think this is the best option. It's very intuitive and you don't have to press any key to drag the tab. if you move a mouse outside tabs area you start to drag the whole window. Check this please (netbeans should work in the same way).
Quote:


What about implementing Ctrl OR Middle Mouse Button Drag ?


Yes it can be an option. I think we shoud make docking system as configurable as possible at least in this case.

PS: I also noticed a cool thing about qt. If dragged window is to be tabbed the destination place is not only light blue (like in our docking engine) but this blue area is also transparent so you can see previous tab content. I like it.
Re: DockCtrl (A dockable window widget for U++) [message #14298 is a reply to message #14290] Thu, 21 February 2008 21:04 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

mrjt wrote on Thu, 21 February 2008 13:27

If you want to have a play with how I think the tabs should work I've attached my latest stable build. I've just finished implementing theming (Thanks Oblivion!), and nested tabs. Hold down CTRL while dragging a tab collection to add it as nested (there is a switch to change the default behaviour but I haven't added to the example since I'll have to make a better on soon anyway).


Ctrl is not bad. Although in QuickTabs I used Ctrl to scroll tabs. I still think it's better (as option or as default) to follow eclipse solution. If you start draging the tab you drag the tab until mouse left tabs area.
Quote:


I've also enabled tab grouping, with grayed-out tabs showing inactive (I find quicktabs just hiding them to be a bit confusing).


It looks quite nice, but the main idea behind grouping was to reduce the scrollbar.. and make switching between tabs more comfortable.

[Updated on: Thu, 21 February 2008 21:05]

Report message to a moderator

Re: DockCtrl (A dockable window widget for U++) [message #14299 is a reply to message #14297] Thu, 21 February 2008 21:31 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1093
Registered: August 2007
Senior Contributor
Quote:


I know why! I know why I thought qt has dragable tabs Smile That's because half a day I spend with eclipse.. And eclipse works the way I described as a solution to "satisfy us all". And I personally think this is the best option. It's very intuitive and you don't have to press any key to drag the tab. if you move a mouse outside tabs area you start to drag the whole window. Check this please (netbeans should work in the same way).




Ok.

Quote:


Yes it can be an option. I think we shoud make docking system as configurable as possible at least in this case.




Well, I have good news for "us all" then Smile. I've implemented the both types of dragging (Ctrl + left drag OR solely middle drag tab repositioning) for both Tabwindows and Autohide (As I said before, DockCtrl is highly and easily configurable Wink ) and updated the Example exe and SVN Wink Just check out. I want to know your opinion. I will make it configurable through a variable too.

Quote:


PS: I also noticed a cool thing about qt. If dragged window is to be tabbed the destination place is not only light blue (like in our docking engine) but this blue area is also transparent so you can see previous tab content. I like it.



Yes, that's cool but how are we going to paint transparent? I'm not very good in using Draw functions of U++. Do you have any idea? I'm not sure -- I didn't try yet -- but, could we use Ctrl::DrawCtrl(Draw& w, int x, int y) method to draw the previous tab content on the animation Ctrl which provides that effect (since animation ctrl is only a ctrl) ? I will give it a try ( maybe I could take a snapshot manually and process it with dithering or stg. else). It sounds reasonable to me.


[Updated on: Thu, 21 February 2008 21:49]

Report message to a moderator

Re: DockCtrl (A dockable window widget for U++) [message #14321 is a reply to message #14298] Fri, 22 February 2008 14:33 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Quote:

PS: I also noticed a cool thing about qt. If dragged window is to be tabbed the destination place is not only light blue (like in our docking engine) but this blue area is also transparent so you can see previous tab content. I like it.

I had also been thinking about this, but I've only just worked out how to do it (my internal structure has now got to a point where I modify stuff quite easily. Thank FSM). See attached for an example. I'm going to improve the tab behaviour I think, but that requires more changes that I'm not quite ready to make. Looks nice though Smile

Oblivion: The trick is to overload Ctrl::PostPaint in you container class (TabWindow?) and then Draw something transparent over the whole View area. I'm using the following code to generate my highlight images:

Image StandardHighlight(Color inside, Color border)
{
	Size sz(5, 5);
	ImageBuffer ib(sz);
	RGBA *q = ~ib;
	for (int i = 0; i < 5; i++)
		for (int j = 0; j < 5; j++)
			*(q++) = (i == 4 || j == 4 || !i || !j) ? border : inside;
	ib.SetHotSpot(Point(1, 1));
	ib.Set2ndSpot(Point(3, 3));
	return ib;
}

Image AlphaHighlight(const Image &img, int alpha)
{
	ImageDraw draw(img.GetSize());
	draw.Alpha().DrawRect(img.GetSize(), Color(alpha, alpha, alpha));
	draw.DrawImage(0, 0, img);
	// Is there a better way to set hotspots than this?
	ImageBuffer ib((Image)draw);
	ib.SetHotSpot(Point(1, 1));
	ib.Set2ndSpot(Point(3, 3));
	return ib;
}

CH_STYLE(DockWindow, Style, StyleDefault)
{
	Image img = StandardHighlight(Blend(SColorHighlight, SColorPaper, 90), SColorHighlight);
	stdhighlight = img;
	tabhighlight = AlphaHighlight(img, 160);
}


unodgs wrote on Thu, 21 February 2008 20:04


Ctrl is not bad. Although in QuickTabs I used Ctrl to scroll tabs. I still think it's better (as option or as default) to follow eclipse solution. If you start draging the tab you drag the tab until mouse left tabs area.


I've just tried this and I don't think it possible with the current Upp Drag/Drop implementation. To make it work you need to call PasteClip::Reject from DragLeave. You have to do a nasty bodge just to get the PasteClip object to begin with, and calling Reject doesn't seem to release the mouse, so it's not possible to start dragging the window. The alternative is to not use DnD for tab dragging, but I'd much rather have a 'correct' solution.

Having tried it I agree that this is how it should work though, so I'll keep trying.

unodgs wrote on Thu, 21 February 2008 20:04


It looks quite nice, but the main idea behind grouping was to reduce the scrollbar.. and make switching between tabs more comfortable.

The grayed-out tabs are not included in the scroll limit. It works exactly the same as before except that you can see that there are non-active tabs.

I'm also trying out a new drag highlight:
index.php?t=getfile&id=1019&private=0
I think it's an improvement, what do you think?

Incidentally, all these features (grouping, scrollbar/tabbar autohide, etc.) are in my general TabBar class, based around standard Upp Value/Display architecture. QuickTabs is just a specialized bas class of this TabBar. It seems a shame to waste it on one project, should I release it to the SVN Bazaar?
  • Attachment: tabs.png
    (Size: 9.64KB, Downloaded 759 times)
  • Attachment: DockTest.zip
    (Size: 568.33KB, Downloaded 254 times)

[Updated on: Fri, 22 February 2008 14:38]

Report message to a moderator

Re: DockCtrl (A dockable window widget for U++) [message #14322 is a reply to message #14321] Fri, 22 February 2008 14:57 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1093
Registered: August 2007
Senior Contributor
Quote:


Oblivion: The trick is to overload Ctrl::PostPaint in you container class (TabWindow?) and then Draw something transparent over the whole View area. I'm using the following code to generate my highlight images:



Thank you Smile
I'll implement this asap.

Quote:


I'm also trying out a new drag highlight:
index.php?t=getfile&id=1019&private=0
I think it's an improvement, what do you think?


It sure is an improvement. Wink


Re: DockCtrl (A dockable window widget for U++) [message #14324 is a reply to message #14321] Fri, 22 February 2008 15:20 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

mrjt wrote on Fri, 22 February 2008 08:33


I had also been thinking about this, but I've only just worked out how to do it (my internal structure has now got to a point where I modify stuff quite easily. Thank FSM). See attached for an example. I'm going to improve the tab behaviour I think, but that requires more changes that I'm not quite ready to make. Looks nice though Smile

Oblivion: The trick is to overload Ctrl::PostPaint in you container class (TabWindow?) and then Draw something transparent over the whole View area. I'm using the following code to generate my highlight images:


Well, I'm impressed. Transparent looks great! And I must say window animation is working very well too.
The only thing you should do is to update quicktabs paint routines. The one you have do not work well with all themes and in right and bottom case eats last line of tab. But wait until tomorrow. I will update quicktabs one more time.
Quote:


Having tried it I agree that this is how it should work though, so I'll keep trying.


Great to hear that Smile
Quote:


I'm also trying out a new drag highlight:
index.php?t=getfile&id=1019&private=0
I think it's an improvement, what do you think?


Yes, but in this case I think that moved tab should not only be painted in drop places but in every mouse position.
Quote:


Incidentally, all these features (grouping, scrollbar/tabbar autohide, etc.) are in my general TabBar class, based around standard Upp Value/Display architecture. QuickTabs is just a specialized bas class of this TabBar. It seems a shame to waste it on one project, should I release it to the SVN Bazaar?


Ok, no problem. As I said many times before we should have one tab system that could be easily plugged into your, Oblivion or anyone else docikng code or used as a standalone widget.
So please make it separate directory and put there your tabs code. I'll try to integerate it with my recent changes. And then we should somehow force oblivions code to use it. I think it's possible.

BTW: I think we should focus on one docikng system. As the Oblivion was first he's now officaly resonsible for docking system. But I wouldn't like to waste your achievements. Maybe you could somehow cooperate with Oblivion. I know that everyone of us prefers own solutions the most Smile but maybe after some changes/adding some fatures you could use oblivion system in your apps and then just start working at oblivion's (upp) code.
What you and Onlivion think about it. Oblivion, could be the work split somehow so you could work together?
Of course I'm not forcing to making one docking system but that would be ideal solution IMO.

[Updated on: Fri, 22 February 2008 15:22]

Report message to a moderator

Re: DockCtrl (A dockable window widget for U++) [message #14325 is a reply to message #14324] Fri, 22 February 2008 15:26 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

Oblivion, I think you should abandom DockCtrl DEV802b.2 and just move out DockCtrl and DoctCtrlExample to the root (like before).
For example I used svn root directory in upp assembly definition and I'm not able to run DockCtrlExample app because it has #include <DockCtrl/DockCtrl.h>. It's very ok, but in current directory layout I'm forced to chage it to <DockCtrl DEV802b.2/DockCtrl/DockCtrl.h>.
And it makes preparing instlation of upp releases much harder. Can we get back to previous layout, please?

[Updated on: Fri, 22 February 2008 15:29]

Report message to a moderator

Re: DockCtrl (A dockable window widget for U++) [message #14326 is a reply to message #14325] Fri, 22 February 2008 15:31 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1093
Registered: August 2007
Senior Contributor
Quote:


Oblivion, I think you should abandom DockCtrl DEV802b.2 and just move out DockCtrl and DoctCtrlExample to the root (like before).
For example I used svn root directory in upp assembly definition and I'm not able to run DockCtrlExample app because it has #include <DockCtrl/DockCtrl.h>. It's very ok, but in current directory layout I'm forced to chage it to <DockCtrl DEV802b.2/DockCtrl/DockCtrl.h>.
And it makes preparing instlation of upp releases much harder. Can we get back to previous layout, please?



I guess you are right. My intention was to keep the SVN/Bazaar clean. Embarassed Ok, I'm moving it both to the main tree. Smile



[Updated on: Fri, 22 February 2008 15:56]

Report message to a moderator

Re: DockCtrl (A dockable window widget for U++) [message #14328 is a reply to message #14324] Fri, 22 February 2008 15:48 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
unodgs wrote on Fri, 22 February 2008 14:20


Well, I'm impressed. Transparent looks great! And I must say window animation is working very well too.
The only thing you should do is to update quicktabs paint routines. The one you have do not work well with all themes and in right and bottom case eats last line of tab. But wait until tomorrow. I will update quicktabs one more time.


My TabBar Paint routine not based on the current QuickTabs Paint code, as I wrote it before you added support for different alignments. Mine works by pre-caching all the rotated/mirrored style elements so that you don't have to do image copying and rotation in the Paint routine. On the other-hand the code is more complex.

I also orient left-hand tabs in an (IMO) more natural way (Autohide something to the left in my example to see the difference).
Quote:

Of course I'm not forcing to making one docking system but that would be ideal solution IMO.

I need to decide whether I really need the more complex form of Docking (not just single row, but nested tree of splitters). This was the original reason for needing my version, and it's not something that can be added at a later date.

[Updated on: Fri, 22 February 2008 15:48]

Report message to a moderator

Re: DockCtrl (A dockable window widget for U++) [message #14329 is a reply to message #14324] Fri, 22 February 2008 16:14 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1093
Registered: August 2007
Senior Contributor

Quote:


So please make it separate directory and put there your tabs code. I'll try to integerate it with my recent changes. And then we should somehow force oblivions code to use it. I think it's possible.



No problem, besides I'll give it a try to implement that transparent tab dragging too.


Quote:


BTW: I think we should focus on one docikng system. As the Oblivion was first he's now officaly resonsible for docking system. But I wouldn't like to waste your achievements. Maybe you could somehow cooperate with Oblivion. I know that everyone of us prefers own solutions the most Smile but maybe after some changes/adding some fatures you could use oblivion system in your apps and then just start working at oblivion's (upp) code.
What you and Onlivion think about it. Oblivion, could be the work split somehow so you could work together?
Of course I'm not forcing to making one docking system but that would be ideal solution IMO.




Well, we are "unofficially" cooperating already Smile (at least, I'm using some part of Mrjt's code. E.g. I took the Autohidebar animation control, X11 support (by the way, I've implemented mrjt's X11 support but have no time to test it due to some technical reasons. I Will upload it tonight to the SVN) alpha blending from him. (I've implemented this too, I took severeal lines of code Wink ) And I'm very thankful to him.

But there is one big problem with our docking frameworks: they are, totally (or, let's say mostly) different. We use different techniques to handle the docks. They look similar, but not act so. So, IMHO, it would be painful to "merge" them. Yet we still can and already cooperate (As I said before, he helps me most of the time).


[Updated on: Fri, 22 February 2008 16:17]

Report message to a moderator

Re: DockCtrl (A dockable window widget for U++) [message #14330 is a reply to message #14321] Fri, 22 February 2008 16:23 Go to previous messageGo to previous message
Oblivion is currently offline  Oblivion
Messages: 1093
Registered: August 2007
Senior Contributor
Quote:


Oblivion: The trick is to overload Ctrl::PostPaint in you container class (TabWindow?) and then Draw something transparent over the whole View area. I'm using the following code to generate my highlight images:



By the way, what is Ctrl::PostPaint()? Shocked
Is there such a method in Ctrl class ?


Previous Topic: TheIDE bug in layout designer?
Next Topic: Linux RectTracker problem
Goto Forum:
  


Current Time: Sun Apr 28 22:45:01 CEST 2024

Total time taken to generate the page: 0.03485 seconds