Solved

EditBox in front of PopupMenu Item

Posted on 2011-09-15
13
724 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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
 
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

774 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