|
|
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 #14275 is a reply to message #14271] |
Thu, 21 February 2008 15:04   |
|
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   |
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 #14296 is a reply to message #14275] |
Thu, 21 February 2008 20:27   |
Oblivion
Messages: 1206 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 (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 
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 ?
Github page: https://github.com/ismail-yilmaz
upp-components: https://github.com/ismail-yilmaz/upp-components
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
[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   |
|
Oblivion wrote on Thu, 21 February 2008 14:27 |
Why are you so obsessed with the draggable tabs (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 
|
I know why! I know why I thought qt has dragable tabs 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   |
|
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   |
Oblivion
Messages: 1206 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 . 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 ) and updated the Example exe and SVN 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.
Github page: https://github.com/ismail-yilmaz
upp-components: https://github.com/ismail-yilmaz/upp-components
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
[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   |
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 
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:

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 859 times)
-
Attachment: DockTest.zip
(Size: 568.33KB, Downloaded 304 times)
[Updated on: Fri, 22 February 2008 14:38] Report message to a moderator
|
|
|
|
Re: DockCtrl (A dockable window widget for U++) [message #14324 is a reply to message #14321] |
Fri, 22 February 2008 15:20   |
|
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 
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 
Quote: |
I'm also trying out a new drag highlight:

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 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   |
|
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 #14328 is a reply to message #14324] |
Fri, 22 February 2008 15:48   |
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   |
Oblivion
Messages: 1206 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 (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 ) 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).
Github page: https://github.com/ismail-yilmaz
upp-components: https://github.com/ismail-yilmaz/upp-components
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
[Updated on: Fri, 22 February 2008 16:17] Report message to a moderator
|
|
|
|
Goto Forum:
Current Time: Mon May 12 08:02:57 CEST 2025
Total time taken to generate the page: 0.03528 seconds
|
|
|