Frame in a nestedSplitter window, good idea?
-Patrick
CaptainMorganRawks at gmail.com
Sun Aug 12 07:44:58 PDT 2007
I'm trying to create a window/frame/control that is within a
nestedSplitter window and if maximized should only expand to the size of
the nestedSplitter. Here's a visual of what's happening, it's created
OUTSIDE the nestedSplitter.... even though the parent window is the
nestedSplitter:
http://img401.imageshack.us/my.php?image=firstio8.png
Here's a view of seeing how it should NOT expand:
http://img393.imageshack.us/img393/971/thirdku9.jpg
And finally, aside from setting the size, it should be placed like so
and not expand beyond the nestedSplitter:
http://img512.imageshack.us/img512/5459/secondwi6.jpg
And here's the code as I've implemented it:
CreateSplitLayout() {
mainSplitter = new wxSplitterWindow(this);
// settings for left window
leftWindow = new wxScrolledWindow(mainSplitter);
leftWindow->SetBackgroundColour(*wxBLACK);
// settings for the righthand side column
rightWindow = new wxScrolledWindow(mainSplitter);
rightWindow->SetBackgroundColour(*wxWHITE);
nestedSplitter = new wxSplitterWindow(mainSplitter);
// settings for the top window
topLeftWindow = new wxScrolledWindow(nestedSplitter);
topLeftWindow->SetBackgroundColour(*wxBLACK);
// settings for the bottom window
bottomLeftWindow = new wxScrolledWindow(nestedSplitter);
bottomLeftWindow->SetBackgroundColour(*wxBLUE);
mainSplitter->SplitVertically(nestedSplitter, rightWindow, 700);
mainSplitter->SetSashGravity(1.0);
mainSplitter->SetMinimumPaneSize(50);
nestedSplitter->SplitHorizontally(topLeftWindow, bottomLeftWindow,
550);
nestedSplitter->SetSashGravity(1.0);
nestedSplitter->SetMinimumPaneSize(50);
newFrame = new wxFrame(nestedSplitter, wxID_ANY, _T("Game Window"),
wxDefaultPosition, wxSize(400, 200));
newFrame->Centre();
newFrame->Show(true);
}
Since it's a child of the nestedSplitter.. shouldn't it be placed within
the nestedSplitter by default? Is there a better way to do what I am
trying to do? Ie: control instead of a frame, window instead of a frame,
sizer first.. etc... What am I doing wrong?
Thanks for your time.
-Patrick
More information about the wx-users
mailing list