Solved

Drawing two splitters Correctly

Posted on 1998-07-14
4
168 Views
Last Modified: 2013-11-20
I'm going for a "Outlook" look.

I've got the mainframe (SDI) split verticly in to 2 views (left/right). The right view is split into 2 views (top/bottom). They form a 'T' lieing down. Where the splitters meet they do not touch, I mean there is a black border around each spliter so they do not meld nicely togetter. (Looks BAD!!)

Questions:
How do I get them to "meld" and become solid?
If I do my own painting how do I get the intersections coords where the spliters meet?

Thomas
0
Comment
Question by:SirThomas
  • 2
  • 2
4 Comments
 
LVL 1

Expert Comment

by:Andy_Keys
ID: 1319167
Post the code you use to create the splitters as that might help.
0
 

Author Comment

by:SirThomas
ID: 1319168
// Main Frame Creates Views 1 and 2
// ============================================================================
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{

      lpcs;
    pContext;

      // CG: The following block was added by the Split Bars component.
      {

    if (!m_wndSplitter.CreateStatic (this, 1, 2) ||
        !m_wndSplitter.CreateView (0, 0, RUNTIME_CLASS (CView1),CSize ( 100, 0), pContext) ||
        !m_wndSplitter.CreateView (0, 1, RUNTIME_CLASS (CView2),CSize (   0, 0), pContext))
            {
                  TRACE0("Failed to create split bar ");
                  return FALSE;    // failed to create
            }
            return TRUE;
      }
}

// View 2 creates a splitter which create 2 new views 3 and 4
// ============================================================================

int CView2::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
      if (CView::OnCreate(lpCreateStruct) == -1)
            return -1;

      // TODO: Add your specialized creation code here

      // The context information is passed on from the framework
      CCreateContext *pContext = (CCreateContext*)lpCreateStruct->lpCreateParams;

    if (!m_wndSplitter.CreateStatic (this, 2, 1) ||
        !m_wndSplitter.CreateView (0, 0, RUNTIME_CLASS (CView3),CSize ( 100, 0), pContext) ||
        !m_wndSplitter.CreateView (1, 0, RUNTIME_CLASS (CView4),CSize (   0, 0), pContext))
            {
                  TRACE0("Failed to create split bar ");
                  return FALSE;    // failed to create
            }


      return 0;
}

// ============================================================================
I would like to also say I've tried using frames inside each other. Instead of view 2 I create and Inside frame which creates the 2 views (3&4). This looks even worse. The 3D effect of the frames inside each other is way to much.

Hope this helps.
Thomas
0
 
LVL 1

Accepted Solution

by:
Andy_Keys earned 100 total points
ID: 1319169
If I'm correct then what you what is a final view that look like   |View2
      view1|-----
           |View3  
 if so the look at ViewEX MFC sample its show you how to split a pane into more subpanes. Fragment of code to do it follows
m_wndSplitter.CreateStatic(this, 1, 2)
m_wndSplitter2.CreateStatic(
            &m_wndSplitter,
            2, 1,
            WS_CHILD | WS_VISIBLE | WS_BORDER,
            m_wndSplitter.IdFromRowCol(0, 1))
You can then go on to create the views




0
 

Author Comment

by:SirThomas
ID: 1319170
Thank you very much :>

It work perfectly. I guess it's time to go through the examples that came with VC again.

Best Regards
Thomas
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now