Solved

EditBox in front of PopupMenu Item

Posted on 2011-09-15
13
721 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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 36

Expert Comment

by:Geert Gruwez
Comment Utility
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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 36

Expert Comment

by:Geert Gruwez
Comment Utility
oops, same idea Thommy, i didn't refresh
0
 

Author Comment

by:3axap
Comment Utility
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
Comment Utility
sample code anyone?
0
 
LVL 19

Expert Comment

by:Thommy
Comment Utility
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
Comment Utility
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
Comment Utility
Thank you Thommy.


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

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

743 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

17 Experts available now in Live!

Get 1:1 Help Now