View Issue Details

IDProjectCategoryView StatusLast Update
0003110JEDI VCL00 JVCL Componentspublic2005-08-16 08:16
ReporteranonymousAssigned Toobones 
Status resolvedResolutionfixed 
Product Version3.00 
Target VersionFixed in Version3.10 
Summary0003110: TJvgAskListBox Lose the Items.Objects Value
DescriptionFor 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 InformationIt 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]));
TagsNo tags attached.



2005-08-16 08:16

administrator   ~0007802

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