|
|
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 #12004 is a reply to message #11482] |
Sun, 07 October 2007 18:58 |
Oblivion
Messages: 1094 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())
(probably there are more difficulties that I will encounter, but it's neither TheIDE's nor DockCtrl's fault).
Regards
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: 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 |
Oblivion
Messages: 1094 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.
Any feedback, suggestions, hints and constructive criticism are welcome.
Regards.
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
|
|
|
Re: DockCtrl (A dockable window widget for U++) [message #12155 is a reply to message #12154] |
Sat, 13 October 2007 17:10 |
|
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 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 .
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 |
|
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 |
Oblivion
Messages: 1094 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."
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)).
|
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.
regards
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: 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 |
Oblivion
Messages: 1094 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.
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
|
|
|
|
|
Re: DockCtrl (A dockable window widget for U++) [message #12660 is a reply to message #12619] |
Mon, 12 November 2007 15:40 |
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
James
[Updated on: Mon, 12 November 2007 15:52] Report message to a moderator
|
|
|
|
|
|
Re: DockCtrl (A dockable window widget for U++) [message #12721 is a reply to message #12719] |
Wed, 14 November 2007 09:10 |
|
I see we have two competiting solutions Great 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 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 |
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
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
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 |
|
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 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 ). 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 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 (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 |
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
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 271 times)
|
|
|
Re: DockCtrl (A dockable window widget for U++) [message #12742 is a reply to message #12726] |
Wed, 14 November 2007 17:08 |
Oblivion
Messages: 1094 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
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++.
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?
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
|
|
|
|
Goto Forum:
Current Time: Sat Jun 08 09:12:31 CEST 2024
Total time taken to generate the page: 0.02169 seconds
|
|
|