tags:

views:

79

answers:

1

Hello all,

I'm using WTL to create a window containing many splitted panes. The following will be the result.

---------------------------
|     |         |         |
|     |         |         |
|     |         |         |
|     |--------------------
|     |      |            |
|     |      |            |
---------------------------

There will be 4 splitters, three vertical ones and a horizontal one.

I followed the great article : http://www.codeproject.com/KB/wtl/wtl4mfc7.aspx. But I only can add 3 splitters as below.

---------------------------
|     |         |         |
|     |         |         |
|     |         |         |
|     |--------------------
|     |                   |
|     |                   |
---------------------------

I tried a lot of ways but still cannot add the last one. Is is a bug of WTL? Can anybody help me?

Best regards, Zach@Shine

+2  A: 

What is your problem? Is it a compile error, a runtime ASSERT, something else?

I strongly suggest that you derive your CMainFrame from CSplitFrameWindowImpl<>.

--------------------------- 
|     |         |         | 
|     |   2TL   |  2TR    | 
|  1L |         |         | 
|     |-------------------- 
|     |  2BL |    2BR     | 
|     |      |            | 
--------------------------- 

The right pane (including all '2' panes) should derive from CSplitterWindowImpl<CPane2, false>, the right top pane (including all '2T' panes) should derive from CSplitterWindowImpl<CPane2T, true> as well as the right bottom one.

Each split pane should be created in the OnCreate() handler of it's parent and create it's children in it's own OnCreate().

cheers, AR

Alain Rist
Thanks for your reply. I got it work. But I still don't know what happend. By the way, do you know how to create a Panel which can contain several child controls?I've found CPaneContainer, but it only can contain one child.
Zach
We call that a non modal dialog :) Derive from ATL::CDialogImpl or WTL::CIndirectDialogImpl and from WTL::CDialogResize for sizing and positioning the controls when resized.
Alain Rist