From d6c76fb72a83a593a74a62b8d40b2b51546ec13c Mon Sep 17 00:00:00 2001 From: graemeg Date: Tue, 25 Mar 2008 13:25:19 +0000 Subject: * Added some new skeleton documentation for newly added units. * Updated the gui_hyperlink documentation. * Updated documentation scripts. * Fixed the painting bug in gui_basegrid where the top-right and bottom-left text or images paint over the control frame. --- src/gui/gui_basegrid.pas | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/gui/gui_basegrid.pas b/src/gui/gui_basegrid.pas index c4457814..558c0c70 100644 --- a/src/gui/gui_basegrid.pas +++ b/src/gui/gui_basegrid.pas @@ -95,6 +95,7 @@ type procedure SetShowHeader(const AValue: boolean); function VisibleLines: integer; function VisibleWidth: integer; + function VisibleHeight: integer; procedure SetFirstRow(const AValue: integer); protected procedure UpdateScrollBars; virtual; @@ -333,7 +334,7 @@ begin Canvas.DrawButtonFace(ARect, [btnIsEmbedded]); r := ARect; InflateRect(r, -2, -2); - Canvas.SetClipRect(r); // text cannot oversheet header border + Canvas.AddClipRect(r); // text may not overshoot header border (* // drawing grid lines Canvas.SetColor(clGridLines); @@ -448,7 +449,18 @@ begin sw := FVScrollBar.Width-1 else sw := 0; - Result := Width - FMargin*2 - sw; + Result := Width - (FMargin*2) - sw; +end; + +function TfpgBaseGrid.VisibleHeight: integer; +var + sw: integer; +begin + if FHScrollBar.Visible then + sw := FHScrollBar.Height-1 + else + sw := 0; + Result := Height - (FMargin*2) - sw; end; procedure TfpgBaseGrid.SetFirstRow(const AValue: integer); @@ -554,8 +566,8 @@ begin Canvas.SetClipRect(r); Canvas.SetColor(FBackgroundColor); Canvas.FillRectangle(r); - - clipr.SetRect(FMargin, FMargin, VisibleWidth, Height-(2*FMargin)); + + clipr.SetRect(FMargin, FMargin, VisibleWidth, VisibleHeight); r := clipr; if (ColumnCount > 0) and ShowHeader then @@ -662,7 +674,6 @@ begin FHScrollBar.Height); end; - Canvas.EndDraw; end; -- cgit v1.2.3-70-g09d2