From 411e018608ab3b82bee4f169da2e1d9e3954aa68 Mon Sep 17 00:00:00 2001 From: pierre Date: Fri, 24 May 2002 11:46:20 +0000 Subject: [PATCH] * fix some TDirList highlight errors --- fv/stddlg.pas | 11 +++++++---- fvision/stddlg.pas | 11 +++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/fv/stddlg.pas b/fv/stddlg.pas index 331e148a30..639b395953 100644 --- a/fv/stddlg.pas +++ b/fv/stddlg.pas @@ -1685,7 +1685,8 @@ end; function TDirListBox.IsSelected(Item: Sw_Integer): Boolean; begin - IsSelected := Item = Cur; +{ IsSelected := Item = Cur; } + IsSelected := Inherited IsSelected(Item); end; procedure TDirListBox.NewDirectory(var ADir: DirStr); @@ -1701,6 +1702,7 @@ var C, OldC: Char; S, Indent: String[80]; P: PString; + NewCur: Word; isFirst: Boolean; SR: SearchRec; I: Sw_Integer; @@ -1738,7 +1740,7 @@ begin else S := MiddleDir + OldC; AList^.Insert(NewDirEntry(S, OldC + ':' + DirSeparator)); end; - if C = GetCurDrive then Cur := AList^.Count; + if C = GetCurDrive then NewCur := AList^.Count; OldC := C; end; end; @@ -1776,7 +1778,7 @@ begin Indent := Indent + IndentSize; Dirct := Dirct + DirSeparator; end; - Cur := AList^.Count-1; + NewCur := AList^.Count-1; isFirst := True; NewDir := Dirct + '*.*'; FindFirst(NewDir, Directory, SR); @@ -1814,7 +1816,8 @@ begin end; end; NewList(AList); - FocusItem(Cur); + FocusItem(NewCur); + Cur:=NewCur; end; procedure TDirListBox.SetState(AState: Word; Enable: Boolean); diff --git a/fvision/stddlg.pas b/fvision/stddlg.pas index 331e148a30..639b395953 100644 --- a/fvision/stddlg.pas +++ b/fvision/stddlg.pas @@ -1685,7 +1685,8 @@ end; function TDirListBox.IsSelected(Item: Sw_Integer): Boolean; begin - IsSelected := Item = Cur; +{ IsSelected := Item = Cur; } + IsSelected := Inherited IsSelected(Item); end; procedure TDirListBox.NewDirectory(var ADir: DirStr); @@ -1701,6 +1702,7 @@ var C, OldC: Char; S, Indent: String[80]; P: PString; + NewCur: Word; isFirst: Boolean; SR: SearchRec; I: Sw_Integer; @@ -1738,7 +1740,7 @@ begin else S := MiddleDir + OldC; AList^.Insert(NewDirEntry(S, OldC + ':' + DirSeparator)); end; - if C = GetCurDrive then Cur := AList^.Count; + if C = GetCurDrive then NewCur := AList^.Count; OldC := C; end; end; @@ -1776,7 +1778,7 @@ begin Indent := Indent + IndentSize; Dirct := Dirct + DirSeparator; end; - Cur := AList^.Count-1; + NewCur := AList^.Count-1; isFirst := True; NewDir := Dirct + '*.*'; FindFirst(NewDir, Directory, SR); @@ -1814,7 +1816,8 @@ begin end; end; NewList(AList); - FocusItem(Cur); + FocusItem(NewCur); + Cur:=NewCur; end; procedure TDirListBox.SetState(AState: Word; Enable: Boolean);