Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-09

Trunk broke TListBox behaviour

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

I just updated my copy of lazarus (unstable) to the latest Trunk revision. I noticed that with the menu item reshuffle, that my Editor Toolbar items are now all wrong. That shouldn't be a huge thing to fix, so clicked the Configure Toolbar button.

Now if I add a item to the ListBox (items that will appear on the toolbar), the "Move up" and "Move down" functionality of that ListBox is now broken. It works perfectly in Lazarus (stable).

Looking at the code (as shown below), I can't see anything wrong either. After all, moving items up or down in a listbox is a simple task. So it seems that in Trunk the TListbox Items.Exchange() is broken, or the ItemIndex property is broken.

procedure TEdtTbConfigForm.btnMoveUpClick(Sender: TObject);
begin
  if lbToolbar.ItemIndex = -1 then
    exit;
  if lbToolbar.ItemIndex > 0 then
  begin
    lbToolbar.Items.Exchange(lbToolbar.ItemIndex, lbToolbar.ItemIndex-1);
    lbToolbar.ItemIndex := lbToolbar.ItemIndex-1;
  end;
end;

My Lazarus (stable) is compiled with LCL-GTK2, and my Lazarus (unstable) is compiled with LCL-QT. Maybe it is a LCL-Qt with TListBox bug. I'll recompile my Lazarus (unstable) with LCL-GTK2 and report back.

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net

Reply by email

zeljko
to Graeme Geldenhuys
Graeme Geldenhuys wrote 32 lines
Hi, I just updated my copy of lazarus (unstable) to the latest Trunk revision. I noticed that with the menu item reshuffle, that my Editor Toolbar items are now all wrong. That shouldn't be a huge thing to fix, so clicked the Configure Toolbar button. Now if I add a item to the ListBox (items that will appear on the toolbar), the "Move up" and "Move down" functionality of that ListBox is now broken. It works perfectly in Lazarus (stable). Looking at the code (as shown below), I can't see anything wrong either. After all, moving items up or down in a listbox is a simple task. So it seems that in Trunk the TListbox Items.Exchange() is broken, or the ItemIndex property is broken. procedure TEdtTbConfigForm.btnMoveUpClick(Sender: TObject); begin if lbToolbar.ItemIndex = -1 then exit; if lbToolbar.ItemIndex > 0 then begin lbToolbar.Items.Exchange(lbToolbar.ItemIndex, lbToolbar.ItemIndex-1); lbToolbar.ItemIndex := lbToolbar.ItemIndex-1; end; end; My Lazarus (stable) is compiled with LCL-GTK2, and my Lazarus (unstable) is compiled with LCL-QT. Maybe it is a LCL-Qt with TListBox bug. I'll recompile my Lazarus (unstable) with LCL-GTK2 and report back.

Please open an issue about it and attach small example of problem.

zeljko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110908/edbd7891/attachment-0001.html>

Reply by email