Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Troubles while restoring splitter panes
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Troubles while restoring splitter panes

 Post Reply Post Reply
Author
Message
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1210
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Topic: Troubles while restoring splitter panes
    Posted: 27 January 2008 at 5:23pm
Hi;
I'm using CXTPSplitterWnd to show panes in two columns. The user is able to show/hide the second column. To this point everything works fine!
Now I want to permanently store the current state of the splitter panes to disk. And after opening the same frame restore the state. This also works almost well.
The only problem I got is, when the second pane was hidden while closing the frame and after showing the frame again and switching the visibility of the second column, the pane always comes up with a x-size of 0. The first pane column is extended to the max client size.
 
I tried different approaches, but with no success. Currently my code for showing/hiding the second pane looks like this:
 
void CBIFrameWnd::OnToggleBatchDetails() {
   if (_splitterV2.GetHiddenColIndex()==1) {
     _splitterV2.ShowColumn();
     int cxCur, cxMin;
     _splitterV2.GetColumnInfo(1, cxCur, cxMin);
     if (cxCur==0) {
        RestoreBatchDetailPane();
     }
   }
   else
     _splitterV2.HideColumn(1);
}
 
void CBIFrameWnd::RestoreBatchDetailPane() {
int cx1, cx2, cxMin1, cxMin2, iHidden;
CXTRegistryManager rm;
CString strRegValue;
CString strItem;
 
   strRegValue=rm.GetProfileString(REG_BI_SECTION, REG_BI_SPLITTERV2, _T("600,0,100,0,-1"));
   if (_stscanf(strRegValue, _T("%d,%d,%d,%d,%d"), &cx1, &cxMin1, &cx2, &cxMin2,&iHidden)==5) {
     _splitterV2.SetColumnInfo(0, cx1, cxMin1);
     _splitterV2.SetColumnInfo(1, cx2, cxMin2);
     _splitterV2.RecalcLayout();
   }
}
 
Any ideas whats wrong?
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.063 seconds.