#include "MDIClientView.h"
#include "MDIViewMenu.h"
class CExampleWindow : public BWindow
{
public:
CExampleWindow(BRect frame = BRect(50, 50, 750, 750));
virtual bool QuitRequested();
};
CExampleWindow::CExampleWindow(BRect frame) :
BWindow(frame, "MDI Example", B_DOCUMENT_WINDOW,
B_ASYNCHRONOUS_CONTROLS)
{
BMenuBar *menuBar = new BMenuBar(BRect(0,0,0,0), "MainMenuBar");
AddChild(menuBar);
SetKeyMenuBar(menuBar);
BMenu *fileSubMenu = new BMenu("File");
fileSubMenu->AddItem(new BMenuItem("Quit",
new BMessage(B_QUIT_REQUESTED), 'Q'));
menuBar->AddItem(fileSubMenu);
}
bool CExampleWindow::QuitRequested()
{
// exit application
be_app->PostMessage(B_QUIT_REQUESTED);
return true;
}