Solved

EditBox in front of PopupMenu Item

Posted on 2011-09-15
13
723 Views
Last Modified: 2013-11-23
Is it possible to place EditBox in front of PopupMenu Item on rightclick immitating editable item?
If so, please give sample.
Application doesn't have visible form, menu popups on click on tray icon.
Delphi 7.
Thanks.
0
Comment
Question by:3axap
  • 5
  • 4
  • 2
13 Comments
 
LVL 19

Expert Comment

by:Thommy
ID: 36547438
You can try this...

Is it possible to implement TEdit into popup menu?
http://www.tek-tips.com/viewthread.cfm?qid=1301866
0
 
LVL 19

Expert Comment

by:Thommy
ID: 36547465
I think there's no chance modifying standard Delphi PopupMenu, because it's just an encapsulation of a standard Windows control.

What you can do is to create your own popup.
Create just a simple form with your desired elements which is activated on right-click and looks like/behaves like a normal popup menu...
0
 

Author Comment

by:3axap
ID: 36547515
Does it need to be be modified? It just need to stay open when rightclicked on item and that's doable. I think I need to get coordinates of selected item and place EditBox there. I did search for solution before asking here and played with toolbar2000 too. I'd like to use plain Delphi components.
I found this tip how to obtain coordinates http://www.delphidabbler.com/tips/117 But I'm not experienced enough to implement it.
0
 
LVL 19

Expert Comment

by:Thommy
ID: 36547562
If you want to place an TEdit over the menu item then you will have to modify the popup.

If you place you TEdit in its own form and activate this form on right-click on the popup menu item, then you can show this Edit form on the position of the menu item.
Is that the solution you want???

0
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 36547590
just add a menu item to the popup menu.
"Enter value".  When clicked this displays a form with a TEdit for you to enter a value
> Have you thought about a cancel and ok button in the TEdit of the menu too ?

Why make it so difficult ?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 36547592
oops, same idea Thommy, i didn't refresh
0
 

Author Comment

by:3axap
ID: 36547655
If you place you TEdit in its own form and activate this form on right-click on the popup menu item, then you can show this Edit form on the position of the menu item.
Is that the solution you want???
That's what I'd like to get.

Click outside EditBox or press Enter key will save changes and Esc cancel them.
0
 

Author Comment

by:3axap
ID: 36549282
sample code anyone?
0
 
LVL 19

Expert Comment

by:Thommy
ID: 36559130
This is an example of how to implement OnRightClick event for a Delphi TPopUpMenu

Unit RCPopUpMenu is from http://www.delphipages.com/forum/archive/index.php/t-180337.html

Also have a look at see http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_20308176.html

PopupMenuTest.zip
0
 
LVL 19

Accepted Solution

by:
Thommy earned 500 total points
ID: 36559157
The problem still is, that a popupmenu is automatically closed even after right-click!!!

It's not quite easy to change this standard behaviour...

How can I make a menu stay visible after it's clicked?
http://stackoverflow.com/questions/2766072/how-can-i-make-a-menu-stay-visible-after-its-clicked

How to Detect a TPopupMenu's OnClose (OnPopDown) Event
http://delphi.about.com/od/adptips2006/qt/popuplistex.htm
0
 

Author Closing Comment

by:3axap
ID: 36559235
Thank you Thommy.


Looks like it's much easier to mimic PopupMenu with own Form.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now