Strange behaviour on TListView onChange event
Original Reporter info from Mantis: bpranoto
-
Reporter name: Bambang Pranoto
Original Reporter info from Mantis: bpranoto
- Reporter name: Bambang Pranoto
Description:
a ListView with style vsIcon and LargeImages
Clicking on currently non selected item:
* makes the clicked item selected
* the previous selected item becomes non selected.
However, if on OnChange event of the ListView we just access the selected property of the Item parameter, the behaviour changes. Clicking a non selected items still retained the previous selected item.
Steps to reproduce:
Compile and run the attachment:
We can see the weird behaviour if we tick the checkbox.
Additional information:
The OnChange procedure:
procedure TForm1.ListView1Change(Sender: TObject; Item: TListItem;
Change: TItemChange);
var
s : String;
begin
s := Item.Caption ;
if Self.CheckBox1.Checked then begin
if Item.Selected then begin
s := s + ' - selected';
end
else begin
s := s + ' - unselected';
end;
end;
Self.Memo1.Lines.Add( s );
Self.Memo1.SelStart:=Length( Self.Memo1.Text);
Self.Memo1.SelLength:=0;
end;
Mantis conversion info:
- Mantis ID: 31595
- OS: Ubuntu
- OS Build: 12.04
- Platform: Linux
- Version: 1.6.4
- Fixed in version: 1.9 (SVN)
- Fixed in revision: 54694 (#17a13c6d)
- Monitored by: » bpranoto (Bambang Pranoto)
- Target version: 1.8