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
0003110 [JEDI VCL] 00 JVCL Components major always 2005-07-24 04:31 2005-08-16 08:16
Reporter anonymous View Status public  
Assigned To obones
Priority normal Resolution fixed  
Status resolved   Product Version 3.00
Summary 0003110: TJvgAskListBox Lose the Items.Objects Value
Description For the first time, when you add items to the TJvgAskListBox and assigns an Object for the item, you loose the object for the first items if you add more items than the heoght of the TJvgAskListBox, when its scroll its lose the firsts objects.
The problems seems to be in:

procedure TJvgAskListBox.RecalcHeights;
  I: Integer;
  R: TRect;
  if Items.Count = 0 then

  SendMessage(Handle, LB_GETITEMRECT, Items.Count - 1, LPARAM(@R));
  FSegment1Width := Word((R.Right - R.Left) - (FButtonWidth + 1) *
    (Buttons.Count) - 1);

//The problem its here
{ Items.BeginUpdate;
  for I := 0 to Items.Count - 1 do
    Items.Insert(I, Items.Strings[I]);
    Items.Delete(I + 1);

I have comented the ItemsUpdate and its seems to work fine.
Additional Information It is the code I have used to test it:

procedure TForm1.Button1Click(Sender: TObject);
var i: integer;
  for i:= 0 to maxi do
    AskList.Items.Objects[Asklist.Items.Add(IntToStr(i))] := TObject(i);

procedure TForm1.AskListClick(Sender: TObject);
var i: integer;
  for i:= 0 to maxi do
    Label1.Caption := IntToStr(i) + ':' + IntToStr(Integer(Asklist.Items.Objects[i]));
Tags No tags attached.
Attached Files

- Relationships

-  Notes
obones (administrator)
2005-08-16 08:16

This is now solved in CVS, using InsertObject instead of Insert.

- Issue History
Date Modified Username Field Change
2005-07-24 04:31 anonymous New Issue
2005-08-16 08:16 obones Status new => resolved
2005-08-16 08:16 obones Resolution open => fixed
2005-08-16 08:16 obones Assigned To => obones
2005-08-16 08:16 obones Note Added: 0007802

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