Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0003051 [JEDI VCL] 00 JVCL Components major always 2005-06-23 06:07 2005-08-09 08:45
Reporter laplace View Status public  
Assigned To obones
Priority normal Resolution fixed  
Status resolved   Product Version 3.00
Summary 0003051: Index out of bound on clicking on embty list box
Description For any jvCustomListBox descendant, when setting DragMode to dmAutomatic and clicking on the list while embty, it produces the error "List out of bound List(0)".
I've traced the error and found that the cause of the problem that when embty, ListIndex still hold 0, while it should hold -1.

My fast solution is to change the DefaultStartDrag of TjvCustomListBox to be as following:

procedure TJvCustomListBox.DefaultStartDrag(var DragObject: TDragObject);
  If Items.Count = 0 Then //Ahmed Fouad 23/06/05 3:15:38 PM Solve problem with embty list
    ItemIndex := -1;
  FDragIndex := ItemIndex;
  if not IsProviderSelected and (FDragIndex >= 0) then
Additional Information
Tags No tags attached.
Attached Files ? file icon JvListBox.pas [^] (64,094 bytes) 2005-06-23 06:07
? file icon TestJVClListBox.zzz [^] (274,017 bytes) 2005-06-26 02:19

- Relationships

-  Notes
obones (administrator)
2005-06-23 11:08

I've just dropped a TJvListBox on an empty form, and I could not reproduce this problem.
Please create a sample application, zip up the sources, and attach it to the issue.
laplace (reporter)
2005-06-23 11:20

Sorry about that,
i forgot one detail, set MultiSelect to True

the scenario is , drop any jvListBox on a form, set DragMode to dmAutomatic and set MultiSelect to True.
run and just click on it, it will produce the error
obones (administrator)
2005-06-23 12:29

Nope, not even with this.
I'm using Delphi 6 here, which version do you use?
anonymous (viewer)
2005-06-26 02:21

The problem produces on Delphi 7, i've tested it on Delphi 5 and it doesn't show.

i've sent a file with the source and the executable, just rename the extension to .zip
obones (administrator)
2005-06-27 00:36

Well, I've just tested with the Delphi 7 here, yes, ItemIndex is 0, but that's windows returning this, not us (see TCustomListBox.GetItemIndex)
Anyway, I just compiled your application, I don't have a single problem with the application. Sure, the exe you provided does display the problem, but I suspect an issue with your setup, something specific to your operating system and/or version of Delphi. Have you applied all the patches?
obones (administrator)
2005-08-09 08:45

Well, no answers in more than a month, this is considered fixed.

- Issue History
Date Modified Username Field Change
2005-06-23 06:07 laplace New Issue
2005-06-23 06:07 laplace File Added: JvListBox.pas
2005-06-23 11:08 obones Note Added: 0007484
2005-06-23 11:08 obones Status new => feedback
2005-06-23 11:20 laplace Note Added: 0007485
2005-06-23 12:29 obones Note Added: 0007486
2005-06-26 02:19 anonymous File Added: TestJVClListBox.zzz
2005-06-26 02:21 anonymous Note Added: 0007491
2005-06-27 00:36 obones Note Added: 0007496
2005-08-09 08:45 obones Status feedback => resolved
2005-08-09 08:45 obones Resolution open => fixed
2005-08-09 08:45 obones Assigned To => obones
2005-08-09 08:45 obones Note Added: 0007748

Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker