- dc.SetFont(*wxSWISS_FONT);
- dc.SetPen(*wxGREEN_PEN);
- dc.DrawLine(0, 0, 200, 200);
- dc.DrawLine(200, 0, 0, 200);
-
- dc.SetBrush(*wxCYAN_BRUSH);
- dc.SetPen(*wxRED_PEN);
- dc.DrawRectangle(100, 100, 100, 50);
- dc.DrawRoundedRectangle(150, 150, 100, 50, 20);
-
- dc.DrawEllipse(250, 250, 100, 50);
- dc.DrawSpline(50, 200, 50, 100, 200, 10);
- dc.DrawLine(50, 230, 200, 230);
- dc.DrawText("This is a test string", 50, 230);
-
- wxPoint points[3];
- points[0].x = 200; points[0].y = 300;
- points[1].x = 100; points[1].y = 400;
- points[2].x = 300; points[2].y = 400;
-
- dc.DrawPolygon(3, points);
+ 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];