Mark,
To add a splitter you need to do the following:
1. Create in window constructor.
myWindow::myWindow(ZApp* inApp)
: ZWindow(inApp, sCreateOSWindow(inApp))
..snip..
fSplitter1 = ZUIFactory::sGet()->Make_Splitter( fToolbarPane, this );
fSplitter1->GetPanes( fPanel1Pane, fPanel2Pane );
fSplitter1->AddResponder(this);
..snip..
2. Make sure you size properly using the GetPaneSize method.
bool myWindow::GetPaneSize(ZSubPane* inPane, ZPoint& outSize)
..snip..
if( inPane == fSplitter1 )
{
outSize = fToolbarPane->GetSize();
outSize -= fToolbarPane->GetToolbarOffset();
}
3. Make sure you set the location properly using the GetPaneLocation method.
bool myWindow::GetPaneLocation(ZSubPane* inPane, ZPoint& outLocation)
..snip..
if( inPane == fSplitter1 )
{
outLocation = fToolbarPane->GetToolbarOffset();
}
4. Make sure you support the pane properties using the GetPaneAttribute
method.
bool myWindow::GetPaneAttribute(ZSubPane* inPane, const string& inAttribute,
void* inParam, void* outResult)
..snip..
if( inPane == fSplitter1 )
{
if( inAttribute == "ZUISplitter::Orientation" )
{
(*(bool*)outResult) = false;
return( true );
}
else
if( inAttribute == "ZUISplitter::SizePane1" )
{
(*(ZCoord*)outResult) = fPanel1PaneSize;
return( true );
}
}
5. Make sure you support the SplitterChanged method.
void myWindow::SplitterChanged(ZUISplitter* inSplitter, ZCoord
inNewPane1Size, ZCoord inNewPane2Size)
..snip..
if( inSplitter == fSplitter1 )
{
inSplitter->FramePreChange();
fPanel1PaneSize = inNewPane1Size;
inSplitter->FramePostChange();
}
Hope this helps.
Mark Wrenn
|