|
Igor, this is just what I've been after for my project!
I've been umming and arring about doing something similar for a while now (MDI isn't really suited for my application) and now I don't have to codeit all myself!
kudos to you!
I'm gonna play around with this for a while and check out the code, but from the screenie it looks like it'll be great.
|
|
|
|
|
ok, so after playing with it for a bit, i realise i need to be able to at do the following things
1) save layouts
2) restore layouts
3) switch between layouts
4) auto hiding facilities - *I* can wait for this one, but maybe my users can't
i guess saving a layout is a case of iterating through the dockable areas, making a note of what is where and what it's split with (and so on..), a bit tricky though
ability to get a pane's object type from a pane specific LPARAM or something is required too.
For example - to describing a layout such as this one...
+--------------+----+
| | |
|=5============| |
+-----+--------+ |
| |=10:11==| |
| | | |
|=1===| | |
+-----+ | |
| | | |
| | | |
| +--------| |
|=2===|=12=====| |
+-----+ | |
| | |=6==|
| +--------+----+
| | |
|=3:4=|=7:8:9=======|
+-----+-------------+
we need to check each docking area, see what it contains and how it's docked to the areas above/below or left/right of it (depending on wether it's vertical or horizontal, respectively) and if it contains a group of frames, and what those frames are and which one is active.
we also need to be able to retreive (and later set) the floating x,y,w,h values for each frame.
I'm going to start with the left area, (panes 1 thu 4) in the figure above.
left area (areas 1 to 4), split horizontally into 2 panes, docked below top area, docked with bottom area, splitter position is 33%
--> pane 1, (area 1) contains one frame
----> frame 1, (area 1) object is: info panel
--> pane 2, (areas 2 and 3:4) split horizontally into 2 panes, splitter position is 50%
----> pane 1, (area 2) contains one frame
------> frame 1, (area 2) object is: server list
----> pane 2, (area 3 & 4) grouped pane container
------> group contains two frames, active frame is the second frame.
--------> frame 1, (area 3) object is: global user list
--------> frame 2, (area 4) object is: friends list
top area (area 5), contains 1 frame, docked with left window edge, docked with right area
--> frame 1 (area 5) object is: channel monitor
right area (area 6), contains 1 frame, docked with top window edge, docked with bottom area
--> frame 1 (area 6) object is: some other view
bottom area (area 7 to 9), contains group pane container, docked with left area, docked with right windowedge
--> grouped pane container, group contains two frames, active frame is the first frame.
----> frame 1 (area 7) object is: transfer panel
----> frame 1 (area 8) object is: event log panel
----> frame 1 (area 9) object is: output panel
and so on...
restoring a layout currently looks like it might not be possible as i don't see functions like dockTo(), groupWith() and splitWith().
to restore the above layout, we would add the views in the same order, calling dockTo(), groupWith(), and splitWith()
dockto() would take a frame and dock it with another frame so that it appears in the same split pane with tabs below it. dockto() also needs a parameter so that you can decide to leave make the frame active or leave the old frame you're docking with active.
groupwith() would take a frame and then dock another frame to it.
splitWith() would take a new frame object and split the area of the frame you're docking to in half (or preferably, a percentage of the area as a parameter) and show the new frame object in the other pane, you must also be able to specify that the new pane appears above/left or below/right of the existing frame.
thinking about it, we'd probably need three createframe() functions too, one to create one in a docked area (left, right, etc), one to create one split with another frame, and one to create one grouped with another frame()
Additonally, it would be nice to have the floating windows appear as app windows, i.e. they would appear on the taskbar.
i think that saving and restoring layouts should be left to the application that uses the layout tools and not done like sergey's docking windows are done. why? 1) sergey's saving/loading routines sometimes caused crashes, requiring the user to remove registry keys before the app could be run again, 2) different apps require different layout saving methods. my app really wants to save and restore layouts to/from XML files and not the registry.
with the above two functions it should be easy enough for any coder to simply remember where things are positioned and put them back in the same place.
Ok, comments?
|
|
|
|
|
Thank you for the feedback.
Good luck with your project.
Sincerely,
Igor.
|
|
|
|
|
I have installed Visual .NET studio. I have some experiences with VS6.0, but I'm somehow new to .NET. I have downloaded the project and tried just to build ewth... Errors occured because plenty of header files are missing...
What have I missed?
Line that produces error is:
#include <atlddx.h>
Error is:
g:\check.it.out\c\docktabframe_demo\docktabframe_demo\DockTabFrameWork\stdafx.h(20): fatal error C1083: Cannot open include file: 'atlddx.h': No such file or directory
And also others include directives produce errors, of course. Should this header file be one of .NET installed files?
Tnx
|
|
|
|
|
As I used a great work done by Bjarke Viksoe and Daniel Bowen my project requires some additional files.
Here I described what there are.
You should find all these files in include folder in demo project.
Check here for some information you might need.
Sincerely,
Igor.
|
|
|
|
|
As I wrote... Rookie I am
I discovered that I need to install Platform SDK and WTL7.1. I did. Now I can compile WTL examples that are included with WTL7.1 package.
(BTW which are the minimum PSDK components I need to install to properly support WTL - I have installed PSDK core components (web install) - but I find it very big. Is it neccessary whole?)
OK... New problems.
I have installed core PSDK components (February'03) and WTL7.1.
What have I mistaken now!
Thank you for bearing me
jOc
------ Build started: Project: SplitPaneDemo, Configuration: Debug Win32 ------
Compiling...
stdafx.cpp
c:\wtl71\include\atlctrls.h(551) : error C2039: 'CString' : is not a member of 'WTL'
c:\wtl71\include\atlctrls.h(694) : see reference to class template instantiation 'WTL::CListBoxT<tbase>' being compiled
c:\wtl71\include\atlctrls.h(874) : error C2039: 'CString' : is not a member of 'WTL'
c:\wtl71\include\atlctrls.h(1044) : see reference to class template instantiation 'WTL::CComboBoxT<tbase>' being compiled
c:\wtl71\include\atlctrls.h(2742) : error C2039: 'CString' : is not a member of 'WTL'
c:\wtl71\include\atlctrls.h(3606) : see reference to class template instantiation 'WTL::CListViewCtrlT<tbase>' being compiled
c:\wtl71\include\atlctrls.h(3752) : error C2039: 'CString' : is not a member of 'WTL'
c:\wtl71\include\atlctrls.h(4240) : see reference to class template instantiation 'WTL::CTreeViewCtrlT<tbase>' being compiled
c:\wtl71\include\atlctrls.h(4290) : error C2039: 'CString' : is not a member of 'WTL'
c:\wtl71\include\atlctrls.h(4347) : see reference to class template instantiation 'WTL::CTreeItemT<tbase>' being compiled
c:\wtl71\include\atlctrls.h(4619) : error C2039: 'CString' : is not a member of 'WTL'
c:\wtl71\include\atlctrls.h(5572) : error C2039: 'CString' : is not a member of 'WTL'
c:\wtl71\include\atlctrls.h(5686) : see reference to class template instantiation 'WTL::CStatusBarCtrlT<tbase>' being compiled
c:\wtl71\include\atlctrls.h(6789) : error C2039: 'CString' : is not a member of 'WTL'
c:\wtl71\include\atlctrls.h(7394) : see reference to class template instantiation 'WTL::CRichEditCtrlT<tbase>' being compiled
c:\wtl71\include\atlctrls.h(874) : error C2039: 'CString' : is not a member of 'WTL'
c:\wtl71\include\atlctrls.h(8045) : see reference to class template instantiation 'WTL::CComboBoxT<tbase>' being compiled
with
[
TBase=ATL::CWindow
]
c:\wtl71\include\atlctrls.h(8061) : see reference to class template instantiation 'WTL::CComboBoxExT<tbase>' being compiled
c:\wtl71\include\atlddx.h(314) : error C2039: 'CString' : is not a member of 'WTL'
c:\wtl71\include\atlddx.h(620) : see reference to class template instantiation 'WTL::CWinDataExchange<t>' being compiled
c:\wtl71\include\atlctrls.h(2742) : error C2039: 'CString' : is not a member of 'WTL'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlwin.h(2736) : see reference to class template instantiation 'WTL::CListViewCtrlT<tbase>' being compiled
with
[
TBase=ATL::CWindow
]
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlwin.h(2925) : see reference to class template instantiation 'ATL::CWindowImplRoot<tbase>' being compiled
with
[
TBase=WTL::CListViewCtrl
]
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlwin.h(3110) : see reference to class template instantiation 'ATL::CWindowImplBaseT<tbase,twintraits>' being compiled
with
[
TBase=WTL::CListViewCtrl,
TWinTraits=WTL::CCheckListViewCtrlTraits
]
c:\wtl71\include\atlctrlx.h(587) : see reference to class template instantiation 'ATL::CWindowImpl<t,tbase,twintraits>' being compiled
with
[
T=WTL::CCheckListViewCtrl,
TBase=WTL::CListViewCtrl,
TWinTraits=WTL::CCheckListViewCtrlTraits
]
c:\wtl71\include\atlctrlx.h(684) : see reference to class template instantiation 'WTL::CCheckListViewCtrlImpl<t>' being compiled
with
[
T=WTL::CCheckListViewCtrl
]
c:\wtl71\include\atlctrls.h(5572) : error C2039: 'CString' : is not a member of 'WTL'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlwin.h(2736) : see reference to class template instantiation 'WTL::CStatusBarCtrlT<tbase>' being compiled
with
[
TBase=ATL::CWindow
]
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlwin.h(2925) : see reference to class template instantiation 'ATL::CWindowImplRoot<tbase>' being compiled
with
[
TBase=WTL::CStatusBarCtrl
]
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlwin.h(3110) : see reference to class template instantiation 'ATL::CWindowImplBaseT<tbase,twintraits>' being compiled
with
[
TBase=WTL::CStatusBarCtrl,
TWinTraits=ATL::CControlWinTraits
]
c:\wtl71\include\atlctrlx.h(1806) : see reference to class template instantiation 'ATL::CWindowImpl<t,tbase>' being compiled
with
[
T=WTL::CMultiPaneStatusBarCtrl,
TBase=WTL::CStatusBarCtrl
]
c:\wtl71\include\atlctrlx.h(2128) : see reference to class template instantiation 'WTL::CMultiPaneStatusBarCtrlImpl<t>' being compiled
with
[
T=WTL::CMultiPaneStatusBarCtrl
]
Build log was saved at "file://g:\check.it.out\c\splitpane_demo\SplitPaneDemo\Debug\BuildLog.htm"
SplitPaneDemo - 12 error(s), 0 warning(s)
---------------------- Done ----------------------
Build: 0 succeeded, 1 failed, 0 skipped
|
|
|
|
|
What the VS.NET version do you use?
It should be compiled fine with VS.NET 2003 (7.1).
May be this is the difference?
I use WTL 7.0 with small fixes.
Also I think Platform SDK is not necessary.
Sincerely,
Igor.
|
|
|
|
|
I'm confused...
http://www.codeproject.com/wtl/wtl4mfc1.asp#readme
You need the Platform SDK. You can't use WTL without it. You can use the online SDK Update site, or download the CAB files and run the setup locally. Be sure you use the utility to add the SDK include and lib directories to the VC search path. You can find this in the Visual Studio Registration folder in the Platform SDK program group.
You need WTL. Download version 7 from Microsoft. See the articles "Introduction to WTL - Part 1" and "Easy installation of WTL" for some tips on installing the files. Those articles are rather out-of-date now, but still contain some good info. One thing which I don't think is mentioned in those articles is how to tell VC to search the WTL include directory. In VC 6, click Tools|Options and go to the Directories tab. In the Show directories for combo box, select Include files. Then add a new entry that points to the directory where you put the WTL header files.
I have VS.NET 2003 - that is 7.1
|
|
|
|
|
In stdafx.h file, move the <atlstr.h> to the first include, like this:
...
#include <atlstr.h>
#include <atlbase.h>
#include <atlapp.h>
#include <atlcoll.h>
extern CAppModule _Module;
#include <atlcom.h>
#include <atlhost.h>
#include <atlwin.h>
#include <atlctl.h>
#include <atlwin.h>
#include <atltypes.h>
#include <atlsplit.h>
#include <atlframe.h>
#include <atlctrls.h>
#include <atldlgs.h>
#include <atlddx.h>
#include <atlgdi.h>
#include <atlctrls.h>
#include <atlctrlx.h>
#include <atlctrlw.h>
|
|
|
|
|
#define _WTL_NO_CSTRING
#include <atlstr.h>
|
|
|
|
|
Problems, problems
If I use your latest version of the code, I get this kind of problems...
Still don't know where the problem is.
Thanks for any clue,
jOc
First error, which I repaired (sure hope I did) by changing the order of includes:
Compiling...
stdafx.cpp
c:\wtl71\include\atlddx.h(19) : fatal error C1189: #error : atlddx.h requires atlapp.h to be included first
Build log was saved at "file://g:\check.it.out\c\docktabframe_demo\DockTabFrameWork\Debug\BuildLog.htm"
DockTabFrameWork - 1 error(s), 0 warning(s)
Then this:
------ Build started: Project: DockTabFrameWork, Configuration: Debug Win32 ------
Compiling...
stdafx.cpp
Compiling...
DockTabFrameWork.cpp
g:\check.it.out\c\docktabframe_demo\include\CustomTabCtrl.h(255) : error C2872: 'CString' : ambiguous symbol
could be 'c:\wtl71\include\atlmisc.h(698) : WTL::CString'
or 'c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlstr.h(975) : ATL::CString'
g:\check.it.out\c\docktabframe_demo\include\CustomTabCtrl.h(256) : error C2872: 'CString' : ambiguous symbol
could be 'c:\wtl71\include\atlmisc.h(698) : WTL::CString'
or 'c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlstr.h(975) : ATL::CString'
|
|
|
|
|
You are absolutely right.
To compile with WTL 7.1 the order of include files in stdafx.h has to be like this:
<br />
#include <atlbase.h><br />
#include <atlcoll.h><br />
#include <atlstr.h><br />
#include <atltypes.h><br />
#include <atlwin.h><br />
<br />
#include <atlapp.h><br />
<br />
extern CAppModule _Module;<br />
<br />
#include <atlddx.h><br />
#include <atlsplit.h><br />
#include <atlctrls.h><br />
#include <atlctrlx.h><br />
#include <atlctrlw.h><br />
#include <atlframe.h><br />
#include <atldlgs.h><br />
The common rule is the first include files are atl files then wtl files. I hope it won't be the problem later.
You can download the correct demo here.
Sorry for the mess.
Sincerely,
Igor.
|
|
|
|
|
Ok!
It does compile with WTL7.0
I will later try to compile it without Platform SDK. It would be nice if it is not necessary, because it does take quite some space (about 500 megs, when only PSDK core components are installed) - I only have 80gigs disk, and I am slowly running out of space.
Tnx
|
|
|
|
|
Good!
So seems like there are problems with WTL 7.1.
I'll check it later.
Thank you for your efforts.
Sincerely,
Igor.
|
|
|
|
|
very Good ,I like it.
Erist.com
www.erist.com
|
|
|
|
|
|
It is great, but now my project is written by VC6 and can not use it.
If you can write a version for VC6, it will be very big help for me. Thank you.
-Freehawk.
|
|
|
|
|
I am sorry.
I have't planned to make a special version for VC6.
Sincerely,
Igor.
|
|
|
|
|
Can I compile it with VC6 ? Or can you provide a vc6 project,Thanks .
|
|
|
|
|
No. The code uses some classes, e.g. CAtlMap, that can be compiled with VC7.
Sorry for that.
Sincerely,
Igor.
|
|
|
|
|
Not a big problem; Replacing the VC7 container classes with STL equivilents is a trifling task.
|
|
|
|
|
Hi, Thanks for your new year present
But I found a little bug.That is when there is one and only one main pane created, if you drag it's tab, there maybe something wrong in layout calculation,the window is gone .
I believe that it stay on somewhere but not on the screen. I only test the release executable demo,but not check the detail of the code.
Thank you again;)
|
|
|
|
|
Thank you for the report.
I couldn't reproduce what you wrote but I found another one.
When you try to drag "Client view list" tab the dragging rectangle is corrupted. Seems likt it's very similar to your description.
I missed initialization of ClientView::floatRect class member in the constructor.
I fixed it. You can download an updated version and try again.
Sincerely,
Igor.
|
|
|
|
|
I have fix the demo code and compiled with VS.NET 2003.It seems to works well now.
Thanks again!
I'm a giant because of my friends
|
|
|
|
|