diff options
author | Graeme Geldenhuys <graemeg@gmail.com> | 2013-12-17 21:49:06 +0000 |
---|---|---|
committer | Graeme Geldenhuys <graemeg@gmail.com> | 2013-12-17 21:52:03 +0000 |
commit | c7a89b9159d66ace759f33bfe32ef2ccd58394cd (patch) | |
tree | 0727e6e43b438a8a166e1d96e5df98b0d8af8373 /src/gui | |
parent | c21ef25d76a355c5a6672864f3f7fbd96fba01f0 (diff) | |
download | fpGUI-c7a89b9159d66ace759f33bfe32ef2ccd58394cd.tar.xz |
listview: removed hard-coded control frame size values.
It now queries the style for the control frame size, and then calculates
the clip rectangle accordingly.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/fpg_listview.pas | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/gui/fpg_listview.pas b/src/gui/fpg_listview.pas index 889c425c..511295e0 100644 --- a/src/gui/fpg_listview.pas +++ b/src/gui/fpg_listview.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2013 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -1404,14 +1404,29 @@ end; procedure TfpgListView.HandlePaint; var ClipRect: TfpgRect; + rect: TRect; begin //if FScrollBarNeedsUpdate then UpdateScrollBarPositions; - fpgStyle.DrawControlFrame(Canvas, 0, 0, Width, Height); - - ClipRect.SetRect(2, 2, Width-4, Height-4); + Canvas.ClearClipRect; + ClipRect.SetRect(0, 0, Width, Height); + fpgStyle.DrawControlFrame(Canvas, ClipRect); + rect := fpgStyle.GetControlFrameBorders; + InflateRect(ClipRect, -rect.Left, -rect.Top); { assuming borders are even on opposite sides } Canvas.SetClipRect(ClipRect); + if Enabled then + begin +// if ReadOnly then +// Canvas.SetColor(clWindowBackground) +// else + Canvas.SetColor(FBackgroundColor); + end + else + Canvas.SetColor(clWindowBackground); + + Canvas.FillRectangle(ClipRect); + // This paints the small square remaining below the vscrollbar // and to the right of the hscrollbar if FVScrollBar.Visible and FHScrollBar.Visible then |