From 2c8f21f867ed5b7e7ce9d6c9ef939f34e83a7213 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 14 Nov 2006 12:12:42 +0000 Subject: [PATCH] label the different gradient pictures clearly git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43408 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/drawing/drawing.cpp | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/samples/drawing/drawing.cpp b/samples/drawing/drawing.cpp index 31918e3f08..99b6b86dc3 100644 --- a/samples/drawing/drawing.cpp +++ b/samples/drawing/drawing.cpp @@ -1095,32 +1095,50 @@ void MyCanvas::DrawSplines(wxDC& dc) void MyCanvas::DrawGradients(wxDC& dc) { + static const int TEXT_HEIGHT = 15; + // LHS: linear - wxRect r(10, 10, 100, 100); + wxRect r(10, 10, 50, 50); + dc.DrawText(_T("wxRIGHT"), r.x, r.y); + r.Offset(0, TEXT_HEIGHT); dc.GradientFillLinear(r, *wxWHITE, *wxBLUE, wxRIGHT); - r.Offset(0, 110); + r.Offset(0, r.height + 10); + dc.DrawText(_T("wxLEFT"), r.x, r.y); + r.Offset(0, TEXT_HEIGHT); dc.GradientFillLinear(r, *wxWHITE, *wxBLUE, wxLEFT); - r.Offset(0, 110); + r.Offset(0, r.height + 10); + dc.DrawText(_T("wxDOWN"), r.x, r.y); + r.Offset(0, TEXT_HEIGHT); dc.GradientFillLinear(r, *wxWHITE, *wxBLUE, wxDOWN); - r.Offset(0, 110); + r.Offset(0, r.height + 10); + dc.DrawText(_T("wxUP"), r.x, r.y); + r.Offset(0, TEXT_HEIGHT); dc.GradientFillLinear(r, *wxWHITE, *wxBLUE, wxUP); // RHS: concentric - r = wxRect(200, 10, 100, 100); + r = wxRect(200, 10, 50, 50); + dc.DrawText(_T("Blue inside"), r.x, r.y); + r.Offset(0, TEXT_HEIGHT); dc.GradientFillConcentric(r, *wxBLUE, *wxWHITE); - r.Offset(0, 110); + r.Offset(0, r.height + 10); + dc.DrawText(_T("White inside"), r.x, r.y); + r.Offset(0, TEXT_HEIGHT); dc.GradientFillConcentric(r, *wxWHITE, *wxBLUE); - r.Offset(0, 110); + r.Offset(0, r.height + 10); + dc.DrawText(_T("Blue in top left corner"), r.x, r.y); + r.Offset(0, TEXT_HEIGHT); dc.GradientFillConcentric(r, *wxBLUE, *wxWHITE, wxPoint(0, 0)); - r.Offset(0, 110); - dc.GradientFillConcentric(r, *wxBLUE, *wxWHITE, wxPoint(100, 100)); + r.Offset(0, r.height + 10); + dc.DrawText(_T("Blue in bottom right corner"), r.x, r.y); + r.Offset(0, TEXT_HEIGHT); + dc.GradientFillConcentric(r, *wxBLUE, *wxWHITE, wxPoint(r.width, r.height)); } void MyCanvas::DrawRegions(wxDC& dc)