Recent

Author Topic: [SOLVED] JvHTListbox  (Read 478 times)

pcurtis

  • Sr. Member
  • ****
  • Posts: 430
[SOLVED] JvHTListbox
« on: November 22, 2020, 07:09:45 pm »
Hi All,
I am having a problem with JvHTListbox. When I fill the listbox with

Code: Pascal  [Select][+][-]
  1. procedure TForm1.FormCreate(Sender: TObject);
  2. var
  3.   iTEMP : integer;
  4. begin
  5.   for iTEMP := 0 to 9 do
  6.     JvHTListBox1.Items.Add('<a href="abcdef">abcdef</a>');
  7. end;
  8.  

Every is fine until I start to move the mouse over the entries.
When I hover over an entry it changes colour.
If I move to another entry the previous entry still stays selected.
Is this a bug?
Any ideas?
« Last Edit: November 23, 2020, 06:17:22 am by pcurtis »
Windows 10 / Linux Mint 20
Laz 2.10.0
FPC 3.2.0

jamie

  • Hero Member
  • *****
  • Posts: 4195
Re: JvHTListbox
« Reply #1 on: November 23, 2020, 02:13:15 am »
Does the control have multiselect ?

I don't have those controls installed but it looks like they had some issues with colors..?

Maybe you could enable the OnMouseMove event for the control and call the repaint for the control

jvListBox1.Repaint..

Do that inside the mousemove event ..
The only true wisdom is knowing you know nothing

pcurtis

  • Sr. Member
  • ****
  • Posts: 430
Re: JvHTListbox
« Reply #2 on: November 23, 2020, 06:16:22 am »
Thanks Jamie for the suggestion. Repaint works.

Even so I will remove the components and custom draw a listbox in case something else bites.
Windows 10 / Linux Mint 20
Laz 2.10.0
FPC 3.2.0

wp

  • Hero Member
  • *****
  • Posts: 8108
Re: [SOLVED] JvHTListbox
« Reply #3 on: November 23, 2020, 03:14:34 pm »
Fixed in jvcllaz trunk. If you use the release version you can patch your version easily:
  • Open unit JvJVCLUtils (in folder run/jvcore of your jvcl installation) and find the procedure HTMLDrawTextEx
  • It contains a nested procedure Draw(...) with a block if IsLink and not MouseOnLink.
  • In this block remove the line Canvas.Font.Color := clRed; // hover link.
  • Recompile the package and the project
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

 

TinyPortal © 2005-2018