Sign in Join

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

Mailing lists / lazarus / 2011-03

Switch off curser in TListBox

6 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

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

Jürgen Hestermann

Is it possible to switch off the visible cursor in a TListBox? I didn't find an option for that.
I wanted the TListBox to act as a log window that shows current (and recent) activity.
But the selection color makes the cursor line quite unreadable and it also makes no
sense to make one line special to the others.

Reply by email

u-boot
to Jürgen Hestermann
whether you find an event that is thrown at the right time following
procedure works:
procedure ListboxSelectionRemove(AListBox: TListbox);
var
  i: Integer;
begin
  i:=0;
  while i<AListBox.Count do begin
      AListBox.Selected[i]:=false;
      inc(i);
  end;
end;
Show quoted text 13 lines
Is it possible to switch off the visible cursor in a TListBox? I didn't find an option for that. I wanted the TListBox to act as a log window that shows current (and recent) activity. But the selection color makes the cursor line quite unreadable and it also makes no sense to make one line special to the others. -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Andreas Schneider
to Jürgen Hestermann: Is it possible to switch off the visible cursor in a TListBox? I didn't find an option…
J?rgen Hestermann wrote 7 lines
Is it possible to switch off the visible cursor in a TListBox? I didn't find an option for that. I wanted the TListBox to act as a log window that shows current (and recent) activity. But the selection color makes the cursor line quite unreadable and it also makes no sense to make one line special to the others.

Just switch to OwnerDraw mode and draw the items by yourself. Then you can just ignore the "Selected" case.

Best Regards, Andreas

Reply by email

Jürgen Hestermann
to u-boot: whether you find an event that is thrown at the right time following procedure works:…
Show quoted text 12 lines
whether you find an event that is thrown at the right time following procedure works: procedure ListboxSelectionRemove(AListBox: TListbox); var i: Integer; begin i:=0; while i<AListBox.Count do begin AListBox.Selected[i]:=false; inc(i); end; end;

Thanks for this example. I was hoping for some configuration switch to simply switch off the cursor.
It seems I have to "reprogram" many of the LCL routines when doing only slighty special things.
I thought the LCL existed just to to avoid digging into such details. But okay, it seems noone ever thought about switching off cursors in tables or coloring cells.

Reply by email

William Oliveira Ferreira
to u-boot: whether you find an event that is thrown at the right time following procedure works:…

I wanna make a suggestion:

procedure ListboxSelectionRemove(AListBox: TListbox);
var
 i: Integer;
begin
 i:=0;
 AListBox.BeginUpdateBounds;;
 while i<AListBox.Count do begin
    AListBox.Selected[i]:=false;
    inc(i);
 end;
 AListBox.EndUpdateBounds;
end;

I think it'll gain some performance...
________________________________
William de Oliveira Ferreira
Bacharel em Sistemas de Informa??o

2011/3/6 u-boot

Show quoted text 37 lines
whether you find an event that is thrown at the right time following procedure works: procedure ListboxSelectionRemove(AListBox: TListbox); var i: Integer; begin i:=0; while i<AListBox.Count do begin AListBox.Selected[i]:=false; inc(i); end; end; J?rgen Hestermann schrieb: Is it possible to switch off the visible cursor in a TListBox? I didn't > find an option for that. > I wanted the TListBox to act as a log window that shows current (and > recent) activity. > But the selection color makes the cursor line quite unreadable and it also > makes no > sense to make one line special to the others. > > -- > _______________________________________________ > Lazarus mailing list > > http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus > -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

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

Reply by email

Hans-Peter Diettrich
to Jürgen Hestermann: Thanks for this example. I was hoping for some configuration switch to simply switch off…
It seems I have to "reprogram" many of the LCL routines when doing only slighty special things.

When platform widgets (TWinControl descendants) are involved, they dictate the way they work.

I thought the LCL existed just to to avoid digging into such details.

You'll have to understand the default operation of every complex control, before you can know where to hook in. Currently I'm dealing with OwnerData listviews, and the LCL wrapper is a real mess :-(

But okay, it seems noone ever thought about switching off cursors in tables or coloring cells.

Many people have been thinking about customizing controls, and each one has different ideas.

[Allen Leuten recht getan ist eine Kunst die niemand kann ;-]

DoDi

Reply by email