From 75da40a254a6d3c44b6d6fec6c4b0c7a96555acc Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Fri, 1 Oct 2010 12:31:12 +0200 Subject: fpg_colorwheel: Improved the look of components while on Designer Form. For speed reasons we paint a basic look of the components while busy in UI Designer. --- src/gui/fpg_colorwheel.pas | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/gui/fpg_colorwheel.pas b/src/gui/fpg_colorwheel.pas index 43ebb8a9..22ab15cc 100644 --- a/src/gui/fpg_colorwheel.pas +++ b/src/gui/fpg_colorwheel.pas @@ -197,12 +197,16 @@ procedure TfpgColorWheel.HandlePaint; // but draw an outline Canvas.SetLineStyle(1, lsDash); Canvas.DrawRectangle(GetClientRect); + Canvas.SetLineStyle(1, lsSolid); + Canvas.Color := clUIDesignerGreen; + Canvas.FillArc(FMarginWidth, FMarginWidth, DrawWidth, DrawHeight, 0, 360); Canvas.Color := clHilite1; - Canvas.DrawArc(Width div 2, Height div 2, DrawWidth div 2 + 1, - DrawHeight div 2 + 1, 45, 180); + Canvas.DrawArc(FMarginWidth, FMarginWidth, DrawWidth, DrawHeight, 45, 180); Canvas.Color := clShadow1; - Canvas.DrawArc(Width div 2, Height div 2, DrawWidth div 2 + 1, - DrawHeight div 2 + 1, 225, 180); + Canvas.DrawArc(FMarginWidth, FMarginWidth, DrawWidth, DrawHeight, 225, 180); + Canvas.TextColor := clShadow1; + Canvas.DrawText(5, 5, Name + ': ' + ClassName); + DrawCursor; Exit; //==> end; @@ -427,13 +431,19 @@ procedure TfpgValueBar.HandlePaint; begin // when designing just draw // a rectangle to indicate + Canvas.Color := clBlack; Canvas.SetLineStyle(1, lsDash); Canvas.DrawRectangle(GetClientRect); if (Width < MarginWidth * 2) or (Height < MarginWidth * 2) then Exit; //==> r := GetClientRect; - InflateRect(r, FMarginWidth, FMarginWidth); + InflateRect(r, -FMarginWidth, -FMarginWidth); + Canvas.Color := clShadow1; + Canvas.SetLineStyle(1, lsSolid); Canvas.DrawRectangle(r); + Canvas.TextColor := clShadow1; + Canvas.DrawText(5, 5, Width, Height, Name + ': ' + ClassName, TextFlagsDflt + [txtWrap]); + DrawCursor; exit; end; -- cgit v1.2.3-54-g00ecf