Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
LCL
»
TTReeView Dynamic popupmenu.
Free Pascal
Website
Downloads
Wiki
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Bugtracker
IRC channel
Latest SVN
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Equivalent to stacking va...
by
nanobit
[
Today
at 08:12:47 am]
Lazarus swears FileExists...
by
dbannon
[
Today
at 07:06:20 am]
Compiling Linux project t...
by
dbannon
[
Today
at 06:55:51 am]
TResampleFilter rfBestQua...
by
del
[
Today
at 06:46:54 am]
[SOLVED] Rest DW not mat...
by
Gustavo 'Gus' Carreno
[
Today
at 06:46:47 am]
[SOLVED] Is BGRABitmap th...
by
pcurtis
[
Today
at 06:28:21 am]
Bouncing balls with Phong...
by
Roland57
[
Today
at 06:19:40 am]
TObject.Free can cause SI...
by
woyy yys
[
Today
at 05:41:48 am]
Tabs in Source Editor
by
trev
[
Today
at 04:46:40 am]
Sand Demo
by
lainz
[
Today
at 04:19:53 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: TTReeView Dynamic popupmenu. (Read 532 times)
sergioantonio2013
New Member
Posts: 22
TTReeView Dynamic popupmenu.
«
on:
September 24, 2019, 10:42:50 pm »
I want to have different menus popup depending on what item you right click on the TTReeView.
any idea, how this can be done, the easy way if there is one.
Logged
jamie
Hero Member
Posts: 4348
Re: TTReeView Dynamic popupmenu.
«
Reply #1 on:
September 25, 2019, 12:26:57 am »
assuming you are having issues how to determine which node you are clicking on?
Code: Pascal
[Select]
[+]
[-]
procedure
TForm1
.
TreeView1MouseDown
(
Sender
:
TObject
;
Button
:
TMouseButton
;
Shift
:
TShiftState
;
X
,
Y
:
Integer
)
;
Var
N
:
TTreeNode
;
begin
If
Sender is TtreeView
Then
With
TTreeView
(
Sender
)
do
Begin
N
:
=
GetNodeAt
(
X
,
Y
)
;
if
(
N <>
Nil
)
and
(
ssRight
in
Shift
)
then
Begin
Form1
.
Caption
:
=
N
.
Text
;
{ Call a PopUp Here using a Case to determine which one to call }
{ Or Use the N.DATA pointer to point to a record containing info about it }
{ The Record can hold the Instance for the Menu }
end
;
end
;
end
;
Hope that helps you get started.
Logged
The only true wisdom is knowing you know nothing
sergioantonio2013
New Member
Posts: 22
Re: TTReeView Dynamic popupmenu.
«
Reply #2 on:
September 25, 2019, 01:46:26 pm »
Thanks that worked.
«
Last Edit: September 25, 2019, 02:07:32 pm by sergioantonio2013
»
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
LCL
»
TTReeView Dynamic popupmenu.
TinyPortal
© 2005-2018