Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
LCL
»
TTReeView Dynamic popupmenu.
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
Rolling releases Lazarus[...
by
ALLIGATOR
[
Today
at 01:43:37 pm]
How to implement multiple...
by
bills
[
Today
at 01:26:29 pm]
AdvancedHTTPServer: A Go-...
by
CynicRus
[
Today
at 12:48:43 pm]
Adjacent rectangles not a...
by
VisualLab
[
Today
at 12:16:40 pm]
RPNCalc in Lazarus
by
jwdietrich
[
Today
at 12:13:43 pm]
Feature announcement: Fun...
by
cocce
[
Today
at 12:06:51 pm]
Is this Pascal Compiler t...
by
HKPhysicist
[
Today
at 11:11:59 am]
Question about optimizer ...
by
fcu
[
Today
at 11:11:28 am]
How to set the Excel cell...
by
wp
[
Today
at 11:05:34 am]
Maze Makers: Modified Cyl...
by
Boleeman
[
Today
at 08:51:29 am]
Olympic Rings (Interleave...
by
Boleeman
[
Today
at 04:28:24 am]
Unit decfloat
by
MathMan
[January 17, 2026, 08:29:41 pm]
Funny
by
Ten_Mile_Hike
[January 17, 2026, 08:18:39 pm]
New book on Object Pascal
by
Ten_Mile_Hike
[January 17, 2026, 07:34:06 pm]
New open source component...
by
salvadordf
[January 17, 2026, 06:26:56 pm]
Strings in Free Pascal: I...
by
Bart
[January 17, 2026, 05:33:17 pm]
Desenvolvimento visual pa...
by
sc10tech
[January 17, 2026, 05:17:58 pm]
Como compilar uma lib par...
by
sc10tech
[January 17, 2026, 05:05:14 pm]
The compiler fails to war...
by
AlexanderK
[January 17, 2026, 04:35:04 pm]
Fast Canvas Library V1.05...
by
Gigatron
[January 17, 2026, 02:34:26 pm]
CudaText editor (written ...
by
andersonscinfo
[January 17, 2026, 01:57:57 pm]
AVRPascal – free code edi...
by
ackarwow
[January 17, 2026, 10:57:09 am]
RTTIPropertyGrid expand
by
ig
[January 17, 2026, 09:11:09 am]
Embedded qss stylesheets ...
by
zeljko
[January 17, 2026, 09:05:42 am]
Seven Kings (inc)
by
speter
[January 17, 2026, 08:22:44 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: TTReeView Dynamic popupmenu. (Read 1244 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: 7490
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