View Issue Details

IDProjectCategoryView StatusLast Update
0017931LazarusLCLpublic2010-11-24 00:30
ReporterKon GolovatzkiyAssigned ToJesus Reyes 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version0.9.29 (SVN)Product Build 
Target Version0.9.30Fixed in Version0.9.29 (SVN) 
Summary0017931: setting TListBox.ItemIndex does not work after TListBox.Items.Clear
DescriptionExample is attached. Win32 LCL.
Summary:
if do not call ListBox1.ItemIndex to update FItemIndex between Items.Clear and setting ItemIndex to the same value as it was before, then ItemIndex will not be changed. Fix is easy, see line 548 in customlistbox.inc:
  if AIndex=FItemIndex then
    exit;
while in the code of Items.Clear FItemIndex value will not be reset.

Either remove "if AIndex=FItemIndex then exit;" or reset FItemIndex value anywhere Items are changed.
TagsNo tags attached.
Fixed in Revision
LazTarget0.9.30
WidgetsetWin32/Win64
Attached Files

Relationships

related to 0017887 closedJesus Reyes Gtk: ItemIndex property does not select items in ListBox 

Activities

2010-11-14 14:32

 

test_listbox.zip (3,811 bytes)

Kon Golovatzkiy

2010-11-14 15:10

reporter   ~0043035

This is a recently added bug. In previous revisions no line
"if AIndex=FItemIndex then exit;" in procedure TCustomListBox.SetItemIndex.

August Klein

2010-11-14 23:39

reporter   ~0043051

Last edited: 2010-11-14 23:41

Related (or duplicated) to bug 0017887
All widgetset (Win, Gtk2, Qt) are affected, then.

August Klein

2010-11-19 02:20

reporter   ~0043210

Last edited: 2010-11-19 02:22

Most probably this issue has been fixed by Zeljan Rikalo in revision 28318.

Paul Ishenin

2010-11-19 07:32

manager   ~0043220

already fixed. please close if ok.

Kon Golovatzkiy

2010-11-24 00:30

reporter   ~0043446

Works in rev.28437

Issue History

Date Modified Username Field Change
2010-11-14 14:32 Kon Golovatzkiy New Issue
2010-11-14 14:32 Kon Golovatzkiy File Added: test_listbox.zip
2010-11-14 14:32 Kon Golovatzkiy Widgetset => Win32/Win64
2010-11-14 15:10 Kon Golovatzkiy Note Added: 0043035
2010-11-14 23:39 August Klein Note Added: 0043051
2010-11-14 23:41 August Klein Note Edited: 0043051
2010-11-16 12:48 Vincent Snijders Relationship added related to 0017887
2010-11-16 12:49 Vincent Snijders LazTarget => 0.9.30
2010-11-16 12:49 Vincent Snijders Assigned To => Jesus Reyes
2010-11-16 12:49 Vincent Snijders Status new => assigned
2010-11-16 12:49 Vincent Snijders Target Version => 0.9.30
2010-11-19 02:20 August Klein Note Added: 0043210
2010-11-19 02:22 August Klein Note Edited: 0043210
2010-11-19 07:32 Paul Ishenin Status assigned => resolved
2010-11-19 07:32 Paul Ishenin Fixed in Version => 0.9.29 (SVN)
2010-11-19 07:32 Paul Ishenin Resolution open => fixed
2010-11-19 07:32 Paul Ishenin Note Added: 0043220
2010-11-24 00:30 Kon Golovatzkiy Status resolved => closed
2010-11-24 00:30 Kon Golovatzkiy Note Added: 0043446