![]() |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
|
![]() |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Once upon a time people were using a quaint programming language called C++ (anyone?) to develop windows applications. Arguably a poor grasp of windows internals and a low level language like C++ can be a deadly combination leading to crash happy, buggy code. That's why kids nowadays turn to glorified visual basic .NET that is generally idiot proof but unfathomable; where you get all sorts of bolt on libraries for the coolest UI elements like docking toolbars for free. There are many docking toolbar frameworks for C++ too, some free (the latest MFC comes with all bells and whistles, including docking and ribbon toolbars). The particular framework I work on, WTL, doesn't have docking toolbars. There is a library by Sergey Klimov that many people use in WTL. Personally I find it distasteful — immediately when I saw links to STL and Boost, I knew it wasn't for me, without even bothering to examine the monstrous 250KB code base. The idea sticking to an old school library like WTL is to be in full awareness of what's going on under the bonnet, all the way to the CPU metal. What's the point relinquishing the absolute control to an incomprehensible, possibly buggy external library for the mere pittance of getting docking toolbars? The purist in oneself will rebel. However it is kind of lame that the old 2xExplorer had docking toolbars 10 years ago and the supposedly powerful xplorer˛ is stuck with splitters!
I will not get into a lengthy explanation of what's going on, the source code is there for all interested parties to see. To get docking panes in your WTL project you only need a single header file atldock.h and set your frame's client window to an instance of the docking manager CDockingWindow class. For more details see how things are plumbed together in the demo project's mainfrm.h file. The list of improvements:
There is room for improvement, and you will surely notice the wealth of ATLASSERT which is my trademark for hastily assembled (but somehow robust :) code. Still you get a no-nonsense docking framework with panes that you can drag-rearrange to taste in the four corners of the window (or have them floating). If you discover any bugs please let me know. Long live WTL, now with extra bon-bons!
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
© 2002—2011 Nikos Bozinis, all rights reserved |