From 1cce04ca1225fdc2786dd0fa908314b6abc4caff Mon Sep 17 00:00:00 2001 From: Andrew Haines Date: Wed, 10 Nov 2010 19:17:16 -0500 Subject: Implemented some overlooked methods for Listview subitems. --- src/gui/fpg_listview.pas | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/gui/fpg_listview.pas b/src/gui/fpg_listview.pas index a4f6c1f2..ecc1a409 100644 --- a/src/gui/fpg_listview.pas +++ b/src/gui/fpg_listview.pas @@ -185,7 +185,7 @@ type TfpgListViewSubItems = class(TStrings) private - FList: TList; + FList: TFPList; FOnChange: TNotifyEvent; function GetImageIndex(ASubIndex: Integer): Integer; procedure SetImageIndex(ASubIndex: Integer; const AValue: Integer); @@ -196,10 +196,12 @@ type function GetCount: Integer; override; procedure Put(Index: Integer; const S: string); override; procedure PutObject(Index: Integer; AObject: TObject); override; - procedure Insert(Index: Integer; const S: string); override; public constructor Create; + destructor Destroy; override; procedure Delete(Index: Integer); override; + procedure Clear; override; + procedure Insert(Index: Integer; const S: string); override; property ImageIndex[ASubIndex: Integer]: Integer read GetImageIndex write SetImageIndex; property OnChange: TNotifyEvent read FOnChange write FOnChange; @@ -1567,9 +1569,10 @@ begin if lvppFocused in PaintPart then begin if lisSelected in ItemState then - Canvas.Color := not clSelection + Canvas.Color := TfpgColor(not clSelection) else Canvas.Color := clSelection; + Canvas.SetLineStyle(1, lsDot); Canvas.DrawRectangle(ItemRect); end; @@ -2040,7 +2043,14 @@ end; constructor TfpgListViewSubitems.Create; begin - FList:= TList.Create; + FList:= TFPList.Create; +end; + +destructor TfpgListViewSubItems.Destroy; +begin + Clear; + FList.Free; + inherited Destroy; end; procedure TfpgListViewSubitems.Delete(Index: Integer); @@ -2053,4 +2063,12 @@ begin FList.Delete(Index); end; +procedure TfpgListViewSubItems.Clear; +var + i: LongInt; +begin + for i := FList.Count downto 0 do + Delete(i); +end; + end. -- cgit v1.2.3-70-g09d2