+void MyFrame::OnSize(wxSizeEvent& WXUNUSED(event) )
+{
+ int w, h;
+ GetClientSize(&w, &h);
+
+ textWindow->SetSize(0, 0, 200, h);
+ GetClientWindow()->SetSize(200, 0, w - 200, h);
+}
+
+void MyFrame::InitToolBar(wxToolBar* toolBar)
+{
+ wxBitmap* bitmaps[8];
+
+#ifdef __WXMSW__
+ bitmaps[0] = new wxBitmap("icon1", wxBITMAP_TYPE_RESOURCE);
+ bitmaps[1] = new wxBitmap("icon2", wxBITMAP_TYPE_RESOURCE);
+ bitmaps[2] = new wxBitmap("icon3", wxBITMAP_TYPE_RESOURCE);
+ bitmaps[3] = new wxBitmap("icon4", wxBITMAP_TYPE_RESOURCE);
+ bitmaps[4] = new wxBitmap("icon5", wxBITMAP_TYPE_RESOURCE);
+ bitmaps[5] = new wxBitmap("icon6", wxBITMAP_TYPE_RESOURCE);
+ bitmaps[6] = new wxBitmap("icon7", wxBITMAP_TYPE_RESOURCE);
+ bitmaps[7] = new wxBitmap("icon8", wxBITMAP_TYPE_RESOURCE);
+#else
+ 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 );
+#endif
+
+#ifdef __WXMSW__
+ int width = 24;
+#else
+ int width = 16;
+#endif
+ int currentX = 5;
+
+ toolBar->AddTool( MDI_NEW_WINDOW, *(bitmaps[0]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "New file");
+ currentX += width + 5;
+ toolBar->AddTool(1, *bitmaps[1], wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Open file");
+ currentX += width + 5;
+ toolBar->AddTool(2, *bitmaps[2], wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Save file");
+ currentX += width + 5;
+ toolBar->AddSeparator();
+ toolBar->AddTool(3, *bitmaps[3], wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Copy");
+ currentX += width + 5;
+ toolBar->AddTool(4, *bitmaps[4], wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Cut");
+ currentX += width + 5;
+ toolBar->AddTool(5, *bitmaps[5], wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Paste");
+ currentX += width + 5;
+ toolBar->AddSeparator();
+ toolBar->AddTool(6, *bitmaps[6], wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Print");
+ currentX += width + 5;
+ toolBar->AddSeparator();
+ toolBar->AddTool(7, *bitmaps[7], wxNullBitmap, TRUE, currentX, -1, (wxObject *) NULL, "Help");
+
+ toolBar->Realize();
+
+ int i;
+ for (i = 0; i < 8; i++)
+ delete bitmaps[i];
+}
+
+// ---------------------------------------------------------------------------
+// MyCanvas
+// ---------------------------------------------------------------------------