Click here to Skip to main content
Click here to Skip to main content

A Flat Splitter Window

By , 30 Jan 2003
 
  • Download source files - 22 Kb
  • <!-- Link to demo file download -->
  • Download demo project - 10 Kb
  • Sample Image - FlatSplitter.gif

    Introduction

    This is a small class that replaces the default MFC splitter window CSplitterWnd with a splitter that has a small (flat) border. It's a very small class (only about 10 lines of code excluding all the standard MFC stuff), but i thought this might be useful for someone.

    Basically, you would use this splitter if you want a GUI like the one in the (newest) "Start->Find->Files or Folders" window. This effect can't be achieved with the standard splitter window, because it draws a WS_EX_CLIENTEDGE-like border.

    Usage

    This is very simple to use, just do whatever you would do with a normal splitter, but replace CSplitterWnd with CFlatSplitterWnd, and don't forget to #include "FlatSplitterWnd.h".

    Update & Credits

    This latest version now supports multiple CFlatSplitterWnd's inside of each other, like the demo app shows it. All of this thanks to Kris (http://krisoftware.w.interia.pl) - Cheers

    License

    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

    Marc Richarme
    Engineer Nokia
    Denmark Denmark
    My programming experience started a long time ago in
    QBasic (on a 25MHz 486).
    I'm now mainly using Java, C++, C, MFC, Perl and PHP, but have used quite a number of other languages as well for various projects.

    Sign Up to vote   Poor Excellent
    Add a reason or comment to your vote: x
    Votes of 3 or less require a comment

    Comments and Discussions

     
    Hint: For improved responsiveness ensure Javascript is enabled and choose 'Normal' from the Layout dropdown and hit 'Update'.
    You must Sign In to use this message board.
    Search this forum  
        Spacing  Noise  Layout  Per page   
    QuestionNokia is goiong down.aren't you afraidmemberldw1986hf12328-Mar-12 6:00 
    QuestionLayoutRolCol()memberZaihuan Yu26-Sep-08 19:53 
    GeneralThanks! Great example, very useful.memberyuban4-May-07 13:34 
    GeneralChane OrientationmemberAshok Jaiswal7-Apr-07 5:47 
    GeneralDecorated Splitter BarmemberJohn Simmons / outlaw programmer8-Sep-06 9:12 
    General&amp;#24456;&amp;#22909;&amp;#21568;memberlovexinqing30-May-03 6:52 
    GeneralRe: œkD™ÞmemberTsinghero3-Jun-03 20:23 
    QuestionHow to change the style of the splitter between each view.memberJack_Cai24-Apr-03 16:36 
    Generalgoodmemberzhongl15-Jul-02 14:38 
    QuestionMouse click?membermohanrajh4-May-02 17:23 
    Generalinside nested splittermemberJustin Matthews19-Mar-02 11:29 
    Hi, nice job with this code.
    I am trying to put the view inside a nester splitter and am having strange results. If CLeftView is created inside a nester splitter:
     
    from CFrameWnd::OnCreateClient()
    m_wndSplitter.CreateStatic(this,1,2)

    m_wndSplitterLeft.CreateStatic(&m_wndSplitter,2,1,WS_CHILD | WS_VISIBLE | WS_BORDER,m_wndSplitter.IdFromRowCol(0, 0));

    m_wndSplitterLeft.CreateView(0,0,RUNTIME_CLASS(CLeftView),CSize(rect.Width()/3,rect.Height()/2),pContext) );
     
    What ends up happening is nothing is displayed in the listview. I noticed that the OnSize() function is only called once during program start.
     
    Any ideas?
     
    Thanks,
    -justin

    GeneralRe: inside nested splittermemberBartosz Bien21-Jun-02 21:01 
    GeneralRe: inside nested splittermemberwilli27-Nov-02 1:50 
    GeneralRe: inside nested splittermembervinodkbyreddy17-Mar-04 19:54 
    GeneralRe: inside nested splittermemberWarChildWTS1-Sep-05 18:59 
    GeneralLimiting splitter bar movesmemberTBiker10-Dec-01 11:07 
    GeneralRe: Limiting splitter bar movesmemberMarc Richarme12-Dec-01 4:15 
    GeneralRe: Limiting splitter bar movesmemberTBiker12-Dec-01 4:51 
    GeneralRe: Limiting splitter bar movesmemberTBiker14-Dec-01 5:51 
    GeneralRe: Limiting splitter bar movesmemberxiang_yan26-Dec-10 16:41 
    GeneralCHtmlViewmemberPeder Alm19-Jun-01 2:05 
    GeneralRe: CHtmlViewmemberMarc Richarme23-Aug-01 14:39 
    GeneralRe: CHtmlViewmemberAnonymous11-Mar-02 19:26 
    GeneralRe: CHtmlViewmemberChiPlastique18-Aug-04 4:36 
    GeneralRe: CHtmlViewmemberxiang_yan26-Dec-10 16:14 
    QuestionOnDrawSplitter unnecessary?memberRon van Gelderen22-Apr-01 0:59 
    AnswerRe: OnDrawSplitter unnecessary?memberMarc Richarme23-Aug-01 14:43 
    GeneralRe: OnDrawSplitter unnecessary?memberKen Griggs11-Mar-02 7:11 
    GeneralRe: OnDrawSplitter unnecessary?memberLim, Jongho17-Mar-02 21:50 
    QuestionWhat does FLAT mean for you?memberAnonymous29-Jan-01 4:23 
    AnswerRe: What does FLAT mean for you?memberDavid Wulff29-Jan-01 5:27 
    GeneralRe: What does FLAT mean for you?memberAlexMarbus29-Jan-01 6:31 
    GeneralRe: What does FLAT mean for you?member*Marc Richarme*29-Jan-01 8:27 
    GeneralRe: What does FLAT mean for you?memberAlexMarbus29-Jan-01 11:25 
    GeneralRe: What does FLAT mean for you?memberMarc Richarme29-Jan-01 12:43 
    GeneralRe: What does FLAT mean for you?memberAnonymous30-Jan-01 8:43 
    GeneralRe: What does FLAT mean for you?memberMarc Richarme31-Jan-01 8:58 
    GeneralRe: What does FLAT mean for you?memberAnonymous30-Jan-01 8:44 
    GeneralRe: What does FLAT mean for you?memberxufeisjtu31-Mar-04 0:27 
    GeneralRe: What does FLAT mean for you?memberMarc Richarme31-Mar-04 4:13 
    AnswerRe: What does FLAT mean for you?memberyuban4-May-07 13:30 

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

    Permalink | Advertise | Privacy | Mobile
    Web02 | 2.6.130617.1 | Last Updated 31 Jan 2003
    Article Copyright 2001 by Marc Richarme
    Everything else Copyright © CodeProject, 1999-2013
    Terms of Use
    Layout: fixed | fluid