- // 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("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");
- file_menu->Append(MDI_CHILD_QUIT, "&Close child", "Close this window");
- file_menu->Append(MDI_QUIT, "&Exit");
-
- wxMenu *option_menu = new wxMenu;
-
- // Dummy option
- option_menu->Append(MDI_REFRESH, "&Refresh picture");
-
- wxMenu *help_menu = new wxMenu;
- help_menu->Append(MDI_ABOUT, "&About");
-
- 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);
-
- 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;
-
- // Give it scrollbars
- canvas->SetScrollbars(20, 20, 50, 50);