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;
var
  I: Integer;
  R: TRect;
begin
  if Items.Count = 0 then
    Exit;

  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
  begin
    Items.Insert(I, Items.Strings[I]);
    Items.Delete(I + 1);
  end;
  Items.EndUpdate;}
end;

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;
begin
  Asklist.Items.Clear;
  for i:= 0 to maxi do
  begin
    AskList.Items.Objects[Asklist.Items.Add(IntToStr(i))] := TObject(i);
  end;
end;

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

- Relationships

-  Notes
(0007802)
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