Recent

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

pcurtis

  • Hero Member
  • *****
  • Posts: 951
[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 20H2
Laz 2.2.0
FPC 3.2.2

jamie

  • Hero Member
  • *****
  • Posts: 6090
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

  • Hero Member
  • *****
  • Posts: 951
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 20H2
Laz 2.2.0
FPC 3.2.2

wp

  • Hero Member
  • *****
  • Posts: 11857
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

 

TinyPortal © 2005-2018