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++)
DockCtrl (A dockable window widget for U++) [message #11482] Sat, 15 September 2007 16:48 Go to next message
Oblivion is currently offline  Oblivion
Messages: 1093
Registered: August 2007
Senior Contributor
Hi,

I've been using the u++ for almost two months, and got very fond of it. I am currently working on a dockctrl widget which would act as a dockable window (like those you find in the VS). Although currently it is under heavy development, I would like to share my dockctrl project's progress here.

Edit: Message Body and history removed.

ChangeLog: (Only the newest version. You can find full changelog in the DockCtrl SVN repository)

0.52
	> public release name DockCtrl DEV803b.1
	--------------------------------------------------------------------------------------------
3/21/2008
	+ added full serialization support.
	+ added default/custom layout support.
	* DockableCtrl class reworked (now it is more abstract); 
	* TabWindow class reworked (no longer uses PaneSplitter() class to control child widgets).
	* DockCtrl class renamed to DockBase class and added a more generic DockCtrl class.
	* DockBase class derives from TopWindow. 
	+ added	InitDockCtrl() method for widget initialization.
	+ added InitCustomLayouts() method for planned "predefined" layout support.
	+ added Tabify() method (with 1 overload) to simplify widget tabbing.
	+ added DockFloat() method to DockableCtrl class.
	+ added ShowDragBarButtons() method to DockWindow class.
	+ added ForbidDragAndDrop()/PermitDragAndDrop() methods to DockableCtrl base widget class.
	  dnd behaviour of each DockableCtrl derived widget can be controlled using this method pair. 
	+ added layout group to the settings window.
	+ added HotKey support for Settings window (default is CTRL + HOME).
	+ added methods to control forbid/permit on window sides.
	- numerous bugfixes, and improvements.

3/22/2008
	+ double clicking on a dragbar of a authidden dockwindow will cause it go into docked state.
	+ added "stdsize" variable to the PaneFrame class.
	+ added ShowXXXXPane() (X:left/top/right/bottom) public methods to the Dockbase class. 

0.52
	> public release name DockCtrl DEV803b.2
	--------------------------------------------------------------------------------------------

3/27/2008
	+ added widget grouping (both predefined/default and user) support. 
	+ added WidgetGroup() method and defined "%" operator for widget grouping.
	+ added group manager to the settings window.
	* tab window creation/managment mechanism changed.
	
	 


To Do:
------------------------------------------
- add a self-explanatory "Complex Dockable Framework" example to the package.

- add drag-n-drop animations.
- add DockBar class -- a dockable Toolbar for DockCtrl framework
- write documentation.
- fix possible major, and minor bugs.
- cleaning up the code.
- bla, bla...


index.php?t=getfile&id=1115&private=0

Any suggestions, bug reports and constructive criticism are always welcome.

You can find the source code of the DockCtrl framework example here or the latest build in the the U++ SVN/Bazaar folder.



Regards.



[Updated on: Fri, 28 March 2008 11:47]

Report message to a moderator

Re: DockCtrl (A dockable window widget for U++) [message #11484 is a reply to message #11482] Sat, 15 September 2007 16:58 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Promising.

Mirek
Re: DockCtrl (A dockable window widget for U++) [message #11485 is a reply to message #11482] Sat, 15 September 2007 17:39 Go to previous messageGo to next message
mezise is currently offline  mezise
Messages: 54
Registered: April 2006
Member
Screenshots look promising Smile

Personally I vote for expanding docking system to Perspectives idea of Eclipse IDE.

http://www.eclipse.org/articles/using-perspectives/Perspecti veArticle.html
http://aptana.com/docs/index.php/About_the_Eclipse_Workbench

Perspectives together with:
- Editors area
- Views areas
- Tabs that may be in Maximize, Fast View, Detached modes
are very convenient and efficient.

I love these features of Eclipse.

Michal
Re: DockCtrl (A dockable window widget for U++) [message #11486 is a reply to message #11485] Sat, 15 September 2007 18:25 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1093
Registered: August 2007
Senior Contributor
Thank you Smile

Well, it shouldn't be so difficult to implement some features of the "perspectives" of the Eclipse. In fact, I was considering to adopt some of the features of it, when I first started this DockCtrl project. Some of them are easy to adopt due to the flexible framework of the U++. But others will be extremely difficult to implement, for the "perspectives" is AFAIK not a widget Smile It is some sort of a mature, layout/GUI framework. So, It is well beyond the scope of this project (for a while, at least). The scope of this project to provide some flexible and reusable GUI widget). Sure, the dockctrl will be and (already is) customizable.
And if you could be more specific instead of suggesting me to implement a whole framework Very Happy , I will add it to my TODO list, if it is not beyond my coding limits. Smile

regards.


[Updated on: Sat, 15 September 2007 18:36]

Report message to a moderator

Re: DockCtrl (A dockable window widget for U++) [message #11487 is a reply to message #11482] Sat, 15 September 2007 18:48 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

Quote:

As I stated above, it is still in alpha state, so at this point i cannot provide you with the working example (the reason is, besides it being under heavy development, the source code is very messy; thus needs refactoring and cleanup).

Excellent job! Could you post here executable (win32) version?
Re: DockCtrl (A dockable window widget for U++) [message #11584 is a reply to message #11487] Tue, 18 September 2007 14:01 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1093
Registered: August 2007
Senior Contributor
unodgs wrote on Sat, 15 September 2007 19:48

Quote:

As I stated above, it is still in alpha state, so at this point i cannot provide you with the working example (the reason is, besides it being under heavy development, the source code is very messy; thus needs refactoring and cleanup).

Excellent job! Could you post here executable (win32) version?


Thank you Smile and of course I can post it.
And I'm sorry for the delay I've been very busy. But please keep in mind that this example is only a sort of "proof-of-concept" of that it is possible to implement this type of control without using any external lib. It depends %100 on U++ widgets. So that it is more a "widget container" than a widget. Good news is it will probably take a month or so to implement a full featured dockctrl.

By the way, there was a bug in smooth slide function of hide/autohide option which caused dockctrl to crash (due to my awful coding stlye Embarassed ) I've spotted it but had no time to fix it, so I disabled hide/autohide feature. I will fix it probably in a week.

Edit: executable changed. Found 2 bugs and fixed.
Edit: executable moved to the first post.


[Updated on: Tue, 18 September 2007 21:06]

Report message to a moderator

Re: DockCtrl (A dockable window widget for U++) [message #11585 is a reply to message #11584] Tue, 18 September 2007 14:31 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

Wow! Very nice! Only drag and drop is missing and docking to tab control but you need Mirek's cooperation here. As for DnD please download Qt 4.3.1 and see similar example. I like very much what they did. Anyway, keep going!
Re: DockCtrl (A dockable window widget for U++) [message #11594 is a reply to message #11585] Tue, 18 September 2007 20:35 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

I was wrong about tabctrl widget. It should not be tauched. Instead your DockCtrl should be able to draw tabs if one pane is put over second (sorry if this is not in english Wink) and be also able to draw those tabs at bottom (maybe from the left and right side too). Anyway your control should do all that things itself.
Re: DockCtrl (A dockable window widget for U++) [message #11595 is a reply to message #11594] Tue, 18 September 2007 20:40 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

I also copied mainwidnow.exe example from qt on upp public ftp. Look for upp/public/!mainwindow!.7z Of course you don't have to follow their way. I only wanted to show you one complete solution.
Re: DockCtrl (A dockable window widget for U++) [message #11599 is a reply to message #11595] Tue, 18 September 2007 21:05 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1093
Registered: August 2007
Senior Contributor
unodgs wrote on Tue, 18 September 2007 21:40

I also copied mainwidnow.exe example from qt on upp public ftp. Look for upp/public/!mainwindow!.7z Of course you don't have to follow their way. I only wanted to show you one complete solution.


Ok, I will look for it and will examine the qt example for sure. As I said before, I am open to all suggestions. Smile
Also, I will probably update this small demo-like example per-week. You will be able find the updated exe in my first post. Thank you for your help and feedbacks.



Re: DockCtrl (A dockable window widget for U++) [message #11620 is a reply to message #11594] Wed, 19 September 2007 13:04 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1093
Registered: August 2007
Senior Contributor
unodgs wrote on Tue, 18 September 2007 21:35

I was wrong about tabctrl widget. It should not be tauched. Instead your DockCtrl should be able to draw tabs if one pane is put over second (sorry if this is not in english Wink) and be also able to draw those tabs at bottom (maybe from the left and right side too). Anyway your control should do all that things itself.


I've examined the qt's dockwidget and understood what you mean with the tabbed docks. In my opinion, it shouldn't be very difficult to implement such a feature. And I have a good news:

Last night I've cleaned up (and translated to english) the code and redesigned the DockCtrl core classes. Now every dockctrl "client" (conceptually, DockCtrl is some sort of a "server") is derived from a base class called DockableCtrl. So the DockCtrl is much more flexible and is possible from now on to add/create new dockable widgets like dockbars (which are similar to windows ReBars), or others. Once I complete the DockWindow implementation, I will go for a DockBar (actually it is piece of a cake to implement one, thank to U++ and all you developers). If everything goes well, I may be able to publish the source code in a month or so.


[Updated on: Wed, 19 September 2007 13:05]

Report message to a moderator

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

Oblivion wrote on Wed, 19 September 2007 07:04


Last night I've cleaned up (and translated to english) the code and redesigned the DockCtrl core classes. Now every dockctrl "client" (conceptually, DockCtrl is some sort of a "server") is derived from a base class called DockableCtrl. So the DockCtrl is much more flexible and is possible from now on to add/create new dockable widgets like dockbars (which are similar to windows ReBars), or others. Once I complete the DockWindow implementation, I will go for a DockBar (actually it is piece of a cake to implement one, thank to U++ and all you developers). If everything goes well, I may be able to publish the source code in a month or so.

Wonderful! I'm sure we will use it for theide as soon as you finish it (maybe some little fixes (if any) would have to be done by us(us = Mirek Wink ). Personaly I can't wait to see it in action Smile
Re: DockCtrl (A dockable window widget for U++) [message #11810 is a reply to message #11482] Wed, 26 September 2007 14:57 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1093
Registered: August 2007
Senior Contributor
Ok, from now on DockCtrl has its very basic DnD mechanism (no position/placement awareness added yet). I've posted the new version of the example exe. You can test it Smile

I am trying to implement two types of DnD mechanism. First one uses a sort of tracker rectangle (which is, at the moment for testing-purpose only (so please don't get dissapointed by it's ugliness, it will be refined as well Very Happy ). It works fine. Second "will" use solid window dragging (as in QT). But the problem is solid window draging needs a neat trick which will involve win32 API functions, so I will need some assistance about X11 equivalents. In fact, DockCtrl already uses some win32 API calls, so I need help Crying or Very Sad . Here are the code snippets which need to be implemented in X11:
(don't get confused about the other methods, I only need X11 API calls)

//====================================================
#ifdef PLATFORM_WIN32
LRESULT DockWindow::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
UINT defmsg = TopWindow::WindowProc(message, wParam, lParam);

if(IsFloating())
{
if(message == WM_MOVING)
{
POINT pos; GetCursorPos(&pos);
DockCtrlMessage(DMSG_DRAGGING, Point(pos.x, pos.y));
}
if(defmsg == HTCAPTION)
{
if(DnDHasTarget())
{
Dock(DndGetTarget(), State(), Placement(), Position());
Refresh();
DnDTargetORange();
}

}
}

return defmsg;
}
#endif
//==========================================================

Rect DockableCtrl::GetWindowRect(TopWindow& window, Rect& r)
{
#ifdef PLATFORM_WIN32

Rect wrect = r;
::AdjustWindowRect(wrect, window.GetStyle(), false); //Win32 call
return wrect;

#endif

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

Any suggestions, help and code are welcome Smile

Regards


[Updated on: Wed, 26 September 2007 15:34]

Report message to a moderator

Re: DockCtrl (A dockable window widget for U++) [message #11827 is a reply to message #11810] Wed, 26 September 2007 21:49 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

Hi! Glad to see DnD! Agree that xor rectangle is ugly and what's more - under vista it moves very slow. But as you pointed it's only to test. My advice is - finish it with native api if you need. Then we try to extend upp interface in a proper way.
Re: DockCtrl (A dockable window widget for U++) [message #11828 is a reply to message #11827] Wed, 26 September 2007 22:20 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1093
Registered: August 2007
Senior Contributor
unodgs wrote on Wed, 26 September 2007 22:49

Hi! Glad to see DnD! Agree that xor rectangle is ugly and what's more - under vista it moves very slow. But as you pointed it's only to test. My advice is - finish it with native api if you need. Then we try to extend upp interface in a proper way.


Hmm, interesting. I tested the example on Win98se (notebook), /XP(SP2) and Vista Basic (desktop) and it worked fine. Do you use Aero? Maybe it could be the reason or there may be a driver issue??. Anyway, it will be removed when I find a solution to the solid window dragging (I already implemented but then disabled it because there were too much flickering).

Regards


[Updated on: Wed, 26 September 2007 22:28]

Report message to a moderator

Re: DockCtrl (A dockable window widget for U++) [message #11855 is a reply to message #11828] Fri, 28 September 2007 12:58 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

Quote:

Hmm, interesting. I tested the example on Win98se (notebook), /XP(SP2) and Vista Basic (desktop) and it worked fine. Do you use Aero? Maybe it could be the reason or there may be a driver issue??. Anyway, it will be removed when I find a solution to the solid window dragging (I already implemented but then disabled it because there were too much flickering).

Yes, I used Aero. I check on xp and everything was OK. I was thinking about flickering as we should support both visual styles of dragging windows (full and broder only). You must use "smarter" way of painting rectangle. I'll try to investigate in this topic. Or you can make a rectangle thiner (it can be even one pixel width).
Re: DockCtrl (A dockable window widget for U++) [message #11856 is a reply to message #11810] Fri, 28 September 2007 15:16 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Oblivion wrote on Wed, 26 September 2007 08:57


Rect DockableCtrl::GetWindowRect(TopWindow& window, Rect& r)
{
#ifdef PLATFORM_WIN32

Rect wrect = r;
::AdjustWindowRect(wrect, window.GetStyle(), false); //Win32 call
return wrect;

#endif



BTW, are you aware that in U++, rect of window excludes "decorations"? Smile
Re: DockCtrl (A dockable window widget for U++) [message #11857 is a reply to message #11827] Fri, 28 September 2007 15:18 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
unodgs wrote on Wed, 26 September 2007 15:49

Hi! Glad to see DnD! Agree that xor rectangle is ugly and what's more - under vista it moves very slow. But as you pointed it's only to test. My advice is - finish it with native api if you need. Then we try to extend upp interface in a proper way.


Interesting, what xor rectangle?

BTW, are you aware about

void DrawDragRect(Draw& w, const Rect& _rect1, const Rect& _rect2, const Rect& _clip, int n, Color color, uint64 pattern)


At least, that solves the flickering problem...
Re: DockCtrl (A dockable window widget for U++) [message #11859 is a reply to message #11857] Fri, 28 September 2007 16:00 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

Quote:

Interesting, what xor rectangle?

Xor works perfectly if border of rectangle is 1 pixel width. If it is more than 1 pixel and you move rectnagle by 1 pixel for example rectangle must flicker - overlaping border parts are deleted and then repainted in the same position.
Re: DockCtrl (A dockable window widget for U++) [message #11861 is a reply to message #11859] Fri, 28 September 2007 16:49 Go to previous messageGo to previous message
Oblivion is currently offline  Oblivion
Messages: 1093
Registered: August 2007
Senior Contributor
Well, tracker (xor) rectangle implementation is suspended for a while. Good news is, I've managed to add solid-window dragging on win32. (As usual, I've uploaded it; you can find it on the first post) It works fine on my OS configurations (win98/XP(sp2)/Vista basic), except for Win98. AFAIK W98 doesn't support solid window moving by default; it uses standard tracker rectangle of the system. bad news is that I've managed solid dragging by using win32 api. So it is win32 spesific. But it is nested in #ifdef/endif preprocessor commands and is not very lenghty (at most, 100 lines of code), so it should be easy to implement it in X11 (or I hope so Sad )


The main problem I've encoutered was to implement a workaround for famous windows "feature:" WM_NCLBUTTONUP. IT is explicitly stated in the MSDN that this message is sent to the window after left button released. But guess what, this is definitely wrong on XP or greater! Usual microsoft behaviour: "It's not a bug, it's a feature!"...
So I had to implement an aplication wide mouse hook.

By the way, Mirek why isn't there any "non-client area" event handler on U++? I couldn't find any. Did I miss something? Imho, at least the Topwindow class should have protected virtual methods for these messages. And as for the U++ documentation... Well, U++ is like an Iceberg, almost everything is gone undocumented. Don't get me wrong, The actual U++ code is impressing; but lack of documentation really slows down the process, and maybe that is why some people think that it is only a gui widget collection (well, it is definitely not!) Smile


[Updated on: Fri, 28 September 2007 17:44]

Report message to a moderator

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


Current Time: Mon Apr 29 01:11:00 CEST 2024

Total time taken to generate the page: 0.08071 seconds