CSplitterWnd
-
I've created a splitted window. And I want my left part of the window to be not less than 150 pixels by X axis. How can I do this? With the best regards, Vitaly.
Use CSplitterWnd::SetColumnInfo/SetRowInfo. They have a parameter that controls the minimum pane size. Tomasz Sowinski -- http://www.shooltz.com
-
Use CSplitterWnd::SetColumnInfo/SetRowInfo. They have a parameter that controls the minimum pane size. Tomasz Sowinski -- http://www.shooltz.com
No, it isn't work the way I need. If I reduce the column width less than cxMin value - it's width will be set to 0. But I need it to be set to the cxMin. At this moment I'm trying to make a child class for CSplitterWnd and correct the width in RecalcLayout(). With the best regards, Vitaly.
-
No, it isn't work the way I need. If I reduce the column width less than cxMin value - it's width will be set to 0. But I need it to be set to the cxMin. At this moment I'm trying to make a child class for CSplitterWnd and correct the width in RecalcLayout(). With the best regards, Vitaly.
-
No, it isn't work the way I need. If I reduce the column width less than cxMin value - it's width will be set to 0. But I need it to be set to the cxMin. At this moment I'm trying to make a child class for CSplitterWnd and correct the width in RecalcLayout(). With the best regards, Vitaly.
I see - user can drag the splitter to hide a column. RecalcLayout looks very ugly - maybe it's better to hack into OnMouseMove? Tomasz Sowinski -- http://www.shooltz.com
-
I see - user can drag the splitter to hide a column. RecalcLayout looks very ugly - maybe it's better to hack into OnMouseMove? Tomasz Sowinski -- http://www.shooltz.com
-
Do you find this ugly?
void CVertSplitter::RecalcLayout() {
CSplitterWnd::RecalcLayout();
int cur, min;
GetColumnInfo(0, cur, min);
if (cur < min) {
SetColumnInfo(0, min, min);
CSplitterWnd::RecalcLayout();
}
}With the best regards, Vitaly.
Mea culpa. I didn't realize that RecalcLayout is virtual and you'll have to take the source of CSplitterWnd and make substantial changes. Cheers, Tomasz Sowinski -- http://www.shooltz.com