realbasic-nug
[Top] [All Lists]

Re: Best way to handle contextual menus

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: Re: Best way to handle contextual menus
From: Terry Ford <tmford@shaw.ca>
Date: Thu, 31 Jul 2008 17:37:50 -0700
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com
Delivered-to: listarchive@realsoftware.com
In-reply-to: <1350.207.5.249.46.1217549819.squirrel@mail.mcio.org>
References: <1350.207.5.249.46.1217549819.squirrel@mail.mcio.org>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com

On Jul 31, 2008, at 5:16 PM, Brian wrote:

I posted this question yesterday, but I never saw it come to the list, so
I am "re-asking"...

I have a number of edit fields in my application, all of which I would
like the user to be able to right click on and see the basic edit menu
options.

I understand how to do this, but as it stands right now I need to write a
snippet of code on every edit fields MouseClick event to handle this.

I'm curious if there is a "better" way to handle this as a default
behavior in my app.  I don't know much about custom controls, but it
sounded like that may be an option??

Or perhaps there is already a solution to this, as it seems like possibly
a fairly standard request?

If these editfields are similar, I would make a sub-class of editfield and place the code to call the contextual menu in that. If you need separate MouseDown codes in the instances, make an event definition and raise it in the sub-class. There are some good examples in the User's guide.

The MenuItem Class would do well for creating the contextual menu to call the edit menu options.

Terry


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>