Rob Cameron wrote:
> The OnClick handler would work fine -  but AFAIK the right  mouse button 
> can't generate the OnClick event, so I can't use the "left button to 
> select and edit, right-button to open the dialog" approach. 
> 
> I had tried using the OnMouseUp event handler before, but then a 
> right-click in the TEdit brings up the standard context menu for the 
> *TEdit* control (Undo | Cut | Copy | Paste etc) before the OpenDialog 
> appears, instead of the context menu for the dialog after it appears.

Then maybe right-clicking the edit box isn't the best way to activate 
the dialog. People are accustomed to right-clicking things nowadays, and 
they generally expect to be given a menu, not a dialog box, especially 
when they've learned that right-clicking an edit box shows the edit 
context menu to allow for cutting, copying, and pasting.

You could add a command to the menu that activates the dialog.

The menu you get is provided by the OS, not by Delphi. To use a 
different menu, you need to re-create the current menu by assigning the 
TEdit.PopupMenu property. Implementing the menu is very easy if you use 
a TActionList and take advantage of Delphi's standard actions.

You could also add keyboard commands, either using the Ctrl key or using 
a function key.

-- 
Rob
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to