From: Olivier S. <ob...@us...> - 2005-08-03 14:36:16
|
Update of /cvsroot/jvcl/dev/JVCL3/run In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3575/dev/JVCL3/run Modified Files: JvListView.pas Log Message: Mantis 3022: AutoSelect = True prevents selecting another item than the first when returning focus to the list. Index: JvListView.pas =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/run/JvListView.pas,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** JvListView.pas 29 Jul 2005 09:50:25 -0000 1.53 --- JvListView.pas 3 Aug 2005 14:36:06 -0000 1.54 *************** *** 1333,1340 **** procedure TJvListView.SetFocus; begin inherited SetFocus; if AutoSelect and (Selected = nil) and (Items.Count > 0) then ! PostMessage(Handle, WM_AUTOSELECT, Integer(Items[0]), 1); end; --- 1333,1347 ---- procedure TJvListView.SetFocus; + var + index : Integer; begin inherited SetFocus; + + index := 0; + if Assigned(ItemFocused) then + index := ItemIndex; + if AutoSelect and (Selected = nil) and (Items.Count > 0) then ! PostMessage(Handle, WM_AUTOSELECT, Integer(Items[index]), 1); end; |