BeMDI SDK |
2. Create a window and a menubar | 4. Add a MDI view menu | Tutorial Index |
Before we can display any MDI views in our window, we will need a MDI client view. The client view needs to be target of a BScrollView. Normally the scrollbars of the scroll view are hidden. But as soon the user moves a MDI view outside the visible client area the scrollbars are displayed and the user can scroll the client area.
CExampleWindow::CExampleWindow(...)
{
....
BRect clientRect(0, menuBar->Bounds().Height() + 1,
frame.Width()-B_V_SCROLL_BAR_WIDTH,
frame.Height()-B_H_SCROLL_BAR_HEIGHT);
CMDIClientView *client = new CMDIClientView(clientRect,
"ClientView");
BScrollView *scrollView = new BScrollView("MDIScroller", client,
B_FOLLOW_ALL, 0, true, true, B_NO_BORDER);
AddChild(scrollView);
}