Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
LCL
»
[SOLVED] Hand cursor on VirtualDrawTree
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
would multi threading hel...
by
speter
[
Today
at 05:29:22 am]
FPCupDeluxe unable to bui...
by
BradleySlavik
[
Today
at 04:06:30 am]
Strange Error when I use ...
by
TYDQ
[
Today
at 02:48:46 am]
Register global hotkey
by
cdbc
[
Today
at 12:24:59 am]
Perlin Map 3D
by
Boleeman
[
Today
at 12:04:05 am]
X11Libre, finally and for...
by
Fred vS
[January 21, 2026, 10:20:53 pm]
Difference in formatting ...
by
Bart
[January 21, 2026, 09:49:01 pm]
What's wrong with my appl...
by
bourbon
[January 21, 2026, 09:04:40 pm]
TRichMemo install shows "...
by
rvk
[January 21, 2026, 07:47:30 pm]
How to observe the value ...
by
nouzi
[January 21, 2026, 06:26:13 pm]
Anti "churning" in solita...
by
TBMan
[January 21, 2026, 04:30:05 pm]
Lazarus for Windows on aa...
by
msintle
[January 21, 2026, 03:11:13 pm]
Perlin Noise Map With BGR...
by
Boleeman
[January 21, 2026, 01:36:13 pm]
Strange Mail from memo.mi...
by
Thaddy
[January 21, 2026, 01:27:19 pm]
[Solved] Lazreport. Sorti...
by
Petrus Vorster
[January 21, 2026, 11:39:09 am]
Regarding the issue of de...
by
Martin_fr
[January 21, 2026, 11:16:29 am]
[Windows] UTF8 encoding w...
by
Thaddy
[January 21, 2026, 10:42:15 am]
Pleas help, Synapse / Ind...
by
patyit
[January 21, 2026, 10:25:29 am]
Default, Manual Initializ...
by
Okoba
[January 21, 2026, 09:17:22 am]
Cannot see unit text - ed...
by
lorenzo
[January 21, 2026, 04:05:13 am]
AdvancedHTTPServer: A Go-...
by
egsuh
[January 21, 2026, 01:44:33 am]
ThemeServices.OnThemeChan...
by
440bx
[January 21, 2026, 12:16:35 am]
Cross Compile for Dos on ...
by
PascalDragon
[January 20, 2026, 10:54:36 pm]
Feature announcement: Fun...
by
PascalDragon
[January 20, 2026, 09:50:39 pm]
Access violation during d...
by
PascalDragon
[January 20, 2026, 09:49:09 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED] Hand cursor on VirtualDrawTree (Read 788 times)
AsleyCruz
Full Member
Posts: 118
[SOLVED] Hand cursor on VirtualDrawTree
«
on:
April 21, 2023, 07:55:39 am »
Hi coders,
I am using the control VirtualDrawTree and would like to change the cursor to
crHandPoint on mouse over on a specified cell (not on whole control), column or node.
Please, help me with this task.
Thanks in advance.
«
Last Edit: April 21, 2023, 08:39:59 pm by AsleyCruz
»
Logged
Graphic & web designer
paweld
Hero Member
Posts: 1561
Re: Hand cursor on VirtualDrawTree
«
Reply #1 on:
April 21, 2023, 11:01:28 am »
Something like this:
Code: Pascal
[Select]
[+]
[-]
procedure
TForm1
.
vstMouseMove
(
Sender
:
TObject
;
Shift
:
TShiftState
;
X
,
Y
:
Integer
)
;
var
Node
:
PVirtualNode
;
Data
:
PData
;
begin
if
vst
.
Header
.
Columns
.
ColumnFromPosition
(
Point
(
X
,
Y
)
)
=
2
then
begin
Node
:
=
vst
.
HotNode
;
if
Node <>
nil
then
begin
Data
:
=
vst
.
GetNodeData
(
Node
)
;
if
Data
^
.
FSize
>
1024
*
1024
then
vst
.
Cursor
:
=
crNo
else
vst
.
Cursor
:
=
crHandPoint
;
end
else
vst
.
Cursor
:
=
crHandPoint
;
end
else
vst
.
Cursor
:
=
crDefault
;
end
;
Full sample in attachment
Logged
Best regards / Pozdrawiam
paweld
AsleyCruz
Full Member
Posts: 118
Re: Hand cursor on VirtualDrawTree
«
Reply #2 on:
April 21, 2023, 05:29:31 pm »
Quote from: paweld on April 21, 2023, 11:01:28 am
Something like this:
Thanks bro, worked like a charm.
One more question:
Is it possible to change the text color on mouse over on that column?
Well, hope it's possible. Thanks again
Logged
Graphic & web designer
paweld
Hero Member
Posts: 1561
Re: Hand cursor on VirtualDrawTree
«
Reply #3 on:
April 21, 2023, 07:27:35 pm »
Code: Pascal
[Select]
[+]
[-]
var
//...
HotColumnIdx
:
Integer
=
-
1
;
procedure
TForm1
.
vstDrawText
(
Sender
:
TBaseVirtualTree
;
TargetCanvas
:
TCanvas
;
Node
:
PVirtualNode
;
Column
:
TColumnIndex
;
const
CellText
:
String
;
const
CellRect
:
TRect
;
var
DefaultDraw
:
Boolean
)
;
var
HotNode
:
PVirtualNode
;
begin
if
(
HotColumnIdx
=
2
)
and
(
Column
=
2
)
then
begin
HotNode
:
=
vst
.
HotNode
;
if
(
HotNode <>
nil
)
and
(
Node
^
.
Index
=
Hotnode
^
.
Index
)
then
begin
TargetCanvas
.
Font
.
Color
:
=
clWhite
;
TargetCanvas
.
Font
.
Style
:
=
TargetCanvas
.
Font
.
Style
+
[
fsBold
]
;
TargetCanvas
.
Brush
.
Color
:
=
clBlack
;
end
;
end
;
end
;
procedure
TForm1
.
vstMouseMove
(
Sender
:
TObject
;
Shift
:
TShiftState
;
X
,
Y
:
Integer
)
;
var
Node
:
PVirtualNode
;
Data
:
PData
;
begin
HotColumnIdx
:
=
vst
.
Header
.
Columns
.
ColumnFromPosition
(
Point
(
X
,
Y
)
)
;
if
HotColumnIdx
=
2
then
begin
Node
:
=
vst
.
HotNode
;
if
Node <>
nil
then
begin
Data
:
=
vst
.
GetNodeData
(
Node
)
;
if
Data
^
.
FSize
>
1024
*
1024
then
vst
.
Cursor
:
=
crNo
else
vst
.
Cursor
:
=
crHandPoint
;
end
else
vst
.
Cursor
:
=
crHandPoint
;
end
else
vst
.
Cursor
:
=
crDefault
;
end
;
Logged
Best regards / Pozdrawiam
paweld
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
LCL
»
[SOLVED] Hand cursor on VirtualDrawTree
TinyPortal
© 2005-2018