- // Make another frame, containing a canvas
- MyChild *subframe = new MyChild(frame, "Canvas Frame",
- wxPoint(-1, -1), wxSize(-1, -1),
- wxDEFAULT_FRAME_STYLE);
-
- wxString title;
- title.Printf(_T("Canvas Frame %d"), ++gs_nFrames);
-
- subframe->SetTitle(title);
-
- // Give it an icon
-#ifdef __WXMSW__
- subframe->SetIcon(wxIcon("chrt_icn"));
-#else
- subframe->SetIcon(wxIcon( mondrian_xpm ));
-#endif
-
- // Make a menubar
- wxMenu *file_menu = new wxMenu;
-
- file_menu->Append(MDI_NEW_WINDOW, "&New window\tCtrl-N");
- file_menu->Append(MDI_CHILD_QUIT, "&Close child", "Close this window");
- file_menu->Append(MDI_QUIT, "&Exit\tAlt-X");
-
- wxMenu *option_menu = new wxMenu;
-
- option_menu->Append(MDI_REFRESH, "&Refresh picture\tF5");
- option_menu->Append(MDI_CHANGE_TITLE, "Change &title...\tCtrl-T");
-
- wxMenu *help_menu = new wxMenu;
- help_menu->Append(MDI_ABOUT, "&About\tF1");
-
- wxMenuBar *menu_bar = new wxMenuBar;
-
- menu_bar->Append(file_menu, "&File");
- menu_bar->Append(option_menu, "&Options");
- menu_bar->Append(help_menu, "&Help");
-
- // Associate the menu bar with the frame
- subframe->SetMenuBar(menu_bar);
-
- subframe->CreateStatusBar();
- subframe->SetStatusText(title);
-
- int width, height;
- subframe->GetClientSize(&width, &height);
- MyCanvas *canvas = new MyCanvas(subframe, wxPoint(0, 0), wxSize(width, height));
- canvas->SetCursor(wxCursor(wxCURSOR_PENCIL));
- subframe->canvas = canvas;