+void MyFrame::OnSize(wxSizeEvent&
+ #ifdef __WXUNIVERSAL__
+ event
+ #else
+ WXUNUSED(event)
+ #endif
+ )
+{
+ int w, h;
+ GetClientSize(&w, &h);
+
+ textWindow->SetSize(0, 0, 200, h);
+ GetClientWindow()->SetSize(200, 0, w - 200, h);
+
+ // FIXME: On wxX11, we need the MDI frame to process this
+ // event, but on other platforms this should not
+ // be done.
+#ifdef __WXUNIVERSAL__
+ event.Skip();
+#endif
+}
+
+#if wxUSE_TOOLBAR
+void MyFrame::InitToolBar(wxToolBar* toolBar)
+{
+ wxBitmap* bitmaps[8];
+
+ bitmaps[0] = new wxBitmap( new_xpm );
+ bitmaps[1] = new wxBitmap( open_xpm );
+ bitmaps[2] = new wxBitmap( save_xpm );
+ bitmaps[3] = new wxBitmap( copy_xpm );
+ bitmaps[4] = new wxBitmap( cut_xpm );
+ bitmaps[5] = new wxBitmap( paste_xpm );
+ bitmaps[6] = new wxBitmap( print_xpm );
+ bitmaps[7] = new wxBitmap( help_xpm );
+
+ int width = 24;
+ int currentX = 5;
+
+ toolBar->AddTool( MDI_NEW_WINDOW, *(bitmaps[0]), wxNullBitmap, false, currentX, wxDefaultCoord, (wxObject *) NULL, _T("New file"));
+ currentX += width + 5;
+ toolBar->AddTool(1, *bitmaps[1], wxNullBitmap, false, currentX, wxDefaultCoord, (wxObject *) NULL, _T("Open file"));
+ currentX += width + 5;
+ toolBar->AddTool(2, *bitmaps[2], wxNullBitmap, false, currentX, wxDefaultCoord, (wxObject *) NULL, _T("Save file"));
+ currentX += width + 5;
+ toolBar->AddSeparator();
+ toolBar->AddTool(3, *bitmaps[3], wxNullBitmap, false, currentX, wxDefaultCoord, (wxObject *) NULL, _T("Copy"));
+ currentX += width + 5;
+ toolBar->AddTool(4, *bitmaps[4], wxNullBitmap, false, currentX, wxDefaultCoord, (wxObject *) NULL, _T("Cut"));
+ currentX += width + 5;
+ toolBar->AddTool(5, *bitmaps[5], wxNullBitmap, false, currentX, wxDefaultCoord, (wxObject *) NULL, _T("Paste"));
+ currentX += width + 5;
+ toolBar->AddSeparator();
+ toolBar->AddTool(6, *bitmaps[6], wxNullBitmap, false, currentX, wxDefaultCoord, (wxObject *) NULL, _T("Print"));
+ currentX += width + 5;
+ toolBar->AddSeparator();
+ toolBar->AddTool( MDI_ABOUT, *bitmaps[7], wxNullBitmap, true, currentX, wxDefaultCoord, (wxObject *) NULL, _T("Help"));
+
+ toolBar->Realize();
+
+ int i;
+ for (i = 0; i < 8; i++)
+ delete bitmaps[i];
+}
+#endif // wxUSE_TOOLBAR
+
+// ---------------------------------------------------------------------------
+// MyCanvas
+// ---------------------------------------------------------------------------