- MyChild *subframe = new MyChild(NULL, "Canvas Frame", wxPoint(10, 10), wxSize(300, 300),
- wxDEFAULT_FRAME_STYLE);
-
- subframe->SetTitle("wxWindows canvas frame");
-
- // Give it a status line
- subframe->CreateStatusBar();
-
- // Make a menubar
- wxMenu *file_menu = new wxMenu;
-
- file_menu->Append(HELLO_NEW, "&New MFC Window");
- file_menu->Append(HELLO_QUIT, "&Close");
-
- wxMenuBar *menu_bar = new wxMenuBar;
-
- menu_bar->Append(file_menu, "&File");
-
- // 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, 4, 4);
-
- subframe->Show(TRUE);
- // Return the main frame window
- return subframe;
+ MyChild *subframe = new MyChild(NULL, "Canvas Frame", wxPoint(10, 10), wxSize(300, 300),
+ wxDEFAULT_FRAME_STYLE);
+
+ subframe->SetTitle("wxWindows canvas frame");
+
+ // Give it a status line
+ subframe->CreateStatusBar();
+
+ // Make a menubar
+ wxMenu *file_menu = new wxMenu;
+
+ file_menu->Append(HELLO_NEW, "&New MFC Window");
+ file_menu->Append(HELLO_QUIT, "&Close");
+
+ wxMenuBar *menu_bar = new wxMenuBar;
+
+ menu_bar->Append(file_menu, "&File");
+
+ // 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;
+ subframe->Show(TRUE);
+
+ // Return the main frame window
+ return subframe;