Recent

Author Topic: VirtualTreeView Hover over Node  (Read 212 times)

Weitentaaal

  • Full Member
  • ***
  • Posts: 172
VirtualTreeView Hover over Node
« on: April 21, 2021, 11:10:38 am »
Hello guys,

so i have a TreeView with some Nodes and i wanted to create an Event which gets fired when some1 Hovers over a Node.

Didn't find anything about an onhover event (maybe i could use on enter and onexit node). And after some1 hovers over a Node

a Text will get displayed.

is this possible ? when yes how ?
Lazarus: 2.0.6 x86_64-win64-win32/win64
FPC-Version: 3.0.4
Compiler Version: 3.2.0

GetMem

  • Hero Member
  • *****
  • Posts: 4017
Re: VirtualTreeView Hover over Node
« Reply #1 on: April 21, 2021, 01:31:43 pm »
Hi,

Quote
so i have a TreeView with some Nodes and i wanted to create an Event which gets fired when some1 Hovers over a Node.
Didn't find anything about an onhover event (maybe i could use on enter and onexit node). And after some1 hovers over a Node
a Text will get displayed.
is this possible ? when yes how ?
If I understood you correctly, you wish to show some kind of hint. For this you have the OnGetHint event.
Code: Pascal  [Select][+][-]
  1. procedure TForm1.VSTGetHint(Sender: TBaseVirtualTree;
  2.   Node: PVirtualNode; Column: TColumnIndex;
  3.   var LineBreakStyle: TVTTooltipLineBreakStyle; var HintText: String);
  4. begin
  5.   //..
  6. end;

You must set ShowHint to true and HintMode to hmHint.

Weitentaaal

  • Full Member
  • ***
  • Posts: 172
Re: VirtualTreeView Hover over Node
« Reply #2 on: April 21, 2021, 02:49:20 pm »
Perfekt Thanks  :)

Lazarus: 2.0.6 x86_64-win64-win32/win64
FPC-Version: 3.0.4
Compiler Version: 3.2.0

 

TinyPortal © 2005-2018