Solved

Drawing two splitters Correctly

Posted on 1998-07-14
4
169 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Add content to output file 4 62
Macro to save highlighted rows as a separate file 5 41
Shell script to login to remote m/c and execute commands 10 78
EvenOdd challenge 10 89
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

911 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

16 Experts available now in Live!

Get 1:1 Help Now