X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c801d85f158c4cba50b588807daabdcbd0ed3853..a19102646ea35752a45285a71bf7f6451048a49b:/samples/mdi/mdi.cpp diff --git a/samples/mdi/mdi.cpp b/samples/mdi/mdi.cpp index 217d943ab0..588f0260bd 100644 --- a/samples/mdi/mdi.cpp +++ b/samples/mdi/mdi.cpp @@ -22,7 +22,11 @@ #endif #ifdef __WINDOWS__ +#ifdef __WIN95__ #include +#else +#include +#endif #endif #include "mdi.h" @@ -197,6 +201,13 @@ void MyCanvas::OnDraw(wxDC& dc) 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); } // This implements a tiny doodling program! Drag the mouse using @@ -293,13 +304,13 @@ bool MyChild::OnClose(void) #ifdef __WINDOWS__ -BEGIN_EVENT_TABLE(TestRibbon, wxToolBar95) +BEGIN_EVENT_TABLE(TestRibbon, wxToolBar) EVT_PAINT(TestRibbon::OnPaint) END_EVENT_TABLE() TestRibbon::TestRibbon(wxFrame *frame, int x, int y, int w, int h, long style, int direction, int RowsOrColumns): - wxToolBar95(frame, -1, wxPoint(x, y), wxSize(w, h), style, direction, RowsOrColumns) + wxToolBar(frame, -1, wxPoint(x, y), wxSize(w, h), style, direction, RowsOrColumns) { wxBitmap* bitmaps[8]; @@ -320,24 +331,24 @@ TestRibbon::TestRibbon(wxFrame *frame, int x, int y, int w, int h, int offX = 5; int currentX = 5; - AddTool(0, bitmaps[0], wxNullBitmap, FALSE, (float)currentX, -1, NULL, "New file"); + AddTool(0, *bitmaps[0], wxNullBitmap, FALSE, currentX, -1, NULL, "New file"); currentX += width + 5; - AddTool(1, bitmaps[1], wxNullBitmap, FALSE, (float)currentX, -1, NULL, "Open file"); + AddTool(1, *bitmaps[1], wxNullBitmap, FALSE, currentX, -1, NULL, "Open file"); currentX += width + 5; - AddTool(2, bitmaps[2], wxNullBitmap, FALSE, (float)currentX, -1, NULL, "Save file"); + AddTool(2, *bitmaps[2], wxNullBitmap, FALSE, currentX, -1, NULL, "Save file"); currentX += width + 5; AddSeparator(); - AddTool(3, bitmaps[3], wxNullBitmap, FALSE, (float)currentX, -1, NULL, "Copy"); + AddTool(3, *bitmaps[3], wxNullBitmap, FALSE, currentX, -1, NULL, "Copy"); currentX += width + 5; - AddTool(4, bitmaps[4], wxNullBitmap, FALSE, (float)currentX, -1, NULL, "Cut"); + AddTool(4, *bitmaps[4], wxNullBitmap, FALSE, currentX, -1, NULL, "Cut"); currentX += width + 5; - AddTool(5, bitmaps[5], wxNullBitmap, FALSE, (float)currentX, -1, NULL, "Paste"); + AddTool(5, *bitmaps[5], wxNullBitmap, FALSE, currentX, -1, NULL, "Paste"); currentX += width + 5; AddSeparator(); - AddTool(6, bitmaps[6], wxNullBitmap, FALSE, (float)currentX, -1, NULL, "Print"); + AddTool(6, *bitmaps[6], wxNullBitmap, FALSE, currentX, -1, NULL, "Print"); currentX += width + 5; AddSeparator(); - AddTool(7, bitmaps[7], wxNullBitmap, TRUE, currentX, -1, NULL, "Help"); + AddTool(7, *bitmaps[7], wxNullBitmap, TRUE, currentX, -1, NULL, "Help"); CreateTools(); @@ -367,14 +378,14 @@ void TestRibbon::OnMouseEnter(int toolIndex) void TestRibbon::OnPaint(wxPaintEvent& event) { - wxToolBar95::OnPaint(event); + wxToolBar::OnPaint(event); wxPaintDC dc(this); int w, h; GetSize(&w, &h); - dc.SetPen(wxBLACK_PEN); - dc.SetBrush(wxTRANSPARENT_BRUSH); + dc.SetPen(*wxBLACK_PEN); + dc.SetBrush(*wxTRANSPARENT_BRUSH); dc.DrawLine(0, h-1, w, h-1); }