Click here to Skip to main content
13,291,503 members (69,448 online)
Click here to Skip to main content
Add your own
alternative version


34 bookmarked
Posted 26 Apr 2001

Extended Splitter Window class

, 26 Apr 2001
Rate this:
Please Sign up or sign in to vote.
An extended splitter window class that makes creating 'T' style layouts simple.

Sample Image - CExSplitter3Wnd.jpg


I needed a 3 window splitter that will split the window in a "T" shape as opposed to 3 columns or 3 rows. This CExSplitter3Wnd class will allow you to create a 3 window splitter according to a pre-defined layout. Below are the patterns that are defined. Note that you can add any layout you wish:

Note that PATTERN_5 and PATTERN_6 are created the usual way. The other 4 patterns show the extended style.

To create one of those patterns:

  1. Override the OnCreateClient function in your SDI MainFrame.
  2. Construct a new CExSplitter3Wnd object
  3. Set style and initial view sizes
  4. Call the set pattern function with the following parameters :
    • CWnd* pParent
    • SPLIT_PATTERN SplitPattern
    • CRuntimeClass* pFirstView
    • CRuntimeClass* pSecView
    • CRuntimeClass* pThirdView
    • CCreateContext* pContext

SPLIT_PATTERN is an enum defined:

typedef enum 
    PATTERN_1 ,
    PATTERN_2 ,
    PATTERN_3 ,
    PATTERN_4 ,
    PATTERN_5 ,
    PATTERN_6 ,



BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
    // TODO: Add your specialized code here and/or call the base class

    m_pTopWndSplitter  = new CExSplitter3Wnd;

    m_pTopWndSplitter->SetStyle(WS_CHILD | WS_VISIBLE | WS_BORDER);
    return TRUE;

You can retrieve the different view sizes by calling one of the dimension functions. Each view (first, second, third) has its own function:

void GetFirsWndDim(int* nCurrDim,int* nMinDim);
void GetSecWndDim(int* nCurrDim,int* nMinDim);
void GetThirdWndDim(int* nCurrDim,int* nMinDim);


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Israel Israel
C++ Developer

You may also be interested in...

Comments and Discussions

Generalsplit window sizing Pin
kittunair14-May-05 1:14
memberkittunair14-May-05 1:14 
GeneralFix Splitter 3rd Pane Pin
vikram_mfc17-May-04 0:02
membervikram_mfc17-May-04 0:02 
Questionhow to create controls in the splitterwindows Pin
Priya Su9-May-04 21:05
memberPriya Su9-May-04 21:05 
AnswerRe: how to create controls in the splitterwindows Pin
vikram_mfc17-May-04 0:35
membervikram_mfc17-May-04 0:35 
GeneralThanks! Pin
Spectrum_12-Oct-03 23:39
memberSpectrum_12-Oct-03 23:39 
QuestionHow to do this case? Pin
ericlts2-Apr-03 15:39
memberericlts2-Apr-03 15:39 
Generalsplitting and un-splitting Pin
rawblark2-Jul-02 5:47
memberrawblark2-Jul-02 5:47 
QuestionDisplaying non-split window as well split window? Pin
mohanrajh4-May-02 18:34
membermohanrajh4-May-02 18:34 
tfrazao13-Mar-02 7:04
membertfrazao13-Mar-02 7:04 
GeneralGood Job ;-) Pin
lamback5-Mar-02 17:24
memberlamback5-Mar-02 17:24 
QuestionHow to transfer datas between views in Spliter window Pin
sen29-Jan-02 1:10
membersen29-Jan-02 1:10 
AnswerRe: How to transfer datas between views in Spliter window Pin
Wan Ling Li5-Apr-04 4:59
memberWan Ling Li5-Apr-04 4:59 
QuestionHow to switch views in the third pan Pin
Julia113-Dec-01 9:11
memberJulia113-Dec-01 9:11 
GeneralMore Splits Pin
S.E.McKelvy11-Jul-01 12:03
memberS.E.McKelvy11-Jul-01 12:03 
GeneralRe: More Splits Pin
John P. Curtis30-Jan-02 18:47
memberJohn P. Curtis30-Jan-02 18:47 
GeneralNot extensible Pin
Datacrime30-Apr-01 4:51
memberDatacrime30-Apr-01 4:51 
GeneralRe: Not extensible Pin
Anonymous3-Jun-01 5:42
memberAnonymous3-Jun-01 5:42 
GeneralNot necessary Pin
Anonymous29-Apr-01 1:09
memberAnonymous29-Apr-01 1:09 
GeneralRe: Not necessary Pin
ran wainstein29-Apr-01 9:42
memberran wainstein29-Apr-01 9:42 
GeneralRe: Not necessary Pin
Anonymous3-Jun-01 5:46
memberAnonymous3-Jun-01 5:46 
GeneralRe: Not necessary Pin
sanvm10-Aug-03 22:03
membersanvm10-Aug-03 22:03 
GeneralRe: Not necessary Pin
hewat13-Nov-03 4:43
memberhewat13-Nov-03 4:43 
GeneralMemory leaks Pin
Moz27-Apr-01 7:53
memberMoz27-Apr-01 7:53 
GeneralRe: Memory leaks Pin
Anonymous3-Jun-01 5:49
memberAnonymous3-Jun-01 5:49 
GeneralRe: Memory leaks Pin
lio18-Feb-02 8:02
memberlio18-Feb-02 8:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.171207.1 | Last Updated 27 Apr 2001
Article Copyright 2001 by Ran
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid