|
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
|