Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Changing the Location Of A Static Splitter Views (is it possible??)

Posted on 2000-04-04
4
Medium Priority
?
194 Views
Last Modified: 2013-11-20
My users want the ability to rotate or swap the views in a MDI splitter window. Views at the top have special responsibilities and this gives them the ability to drive the application.  So if the author view is at the top then it drives the selection of titles from the database and the same for the titles view.

Not being very experience with splitters, is it possible to relocate/swap views, within the window? without having to recreate everything. That is: 2 views are on the screen topview and bottomview I need to move the topview to the
bottom and the bottomview to the top.

0
Comment
Question by:andrestewart
  • 2
4 Comments
 
LVL 12

Accepted Solution

by:
migel earned 400 total points
ID: 2686483
Hi!
of course you can change splitter panes:
for example:
OnSwapPanes()
{
// assume that you have horz splitter with 2 panes
//
CWnd* pViewPane1 = m_wndHorzSplitter.GetPane(0,0);
CWnd* pViewPane2 = m_wndHorzSplitter.GetPane(1,0);
::SetWindowLong(pViewPane1->GetSafeHwnd(), GWL_ID, m_wndHorzSplitter.IdFromRowCol( 1, 0 );
::SetWindowLong(pViewPane2->GetSafeHwnd(), GWL_ID, m_wndHorzSplitter.IdFromRowCol( 0, 0 );
m_wndHorzSplitter.RecalcLayout();
}
0
 
LVL 9

Expert Comment

by:ShaunWilde
ID: 2686604
have a look at

http://www.codetools.com/splitter/usefulsplitter.asp

It has a ReplaceView function - which allows you to change any pane for a splitter - note this usually requires you to adhere strictly to the doc-view model where the data is stored in the doc and view is purely presentational.
0
 

Author Comment

by:andrestewart
ID: 2686940
Edited text of question.
0
 

Author Comment

by:andrestewart
ID: 2687022
works like a charm. All I had to do is tell my doc that
the views as been swaped, my doc set set some flags and the top view became top dog.


Thank you
Andre
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

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: 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.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

972 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