Hi Tim,
Yes, I see. Thanks.
What I was trying to do is show the popupmenu on the window but
display a ContextMenu when the user clicks on the popupmenu. I think
I have to change my idea as it seems to be a bug in that the
ConstructContextMenu doesn't get fired on a popupmenu, even though it
is in the list of available events.
The ConstructContextMenu code goes into the control (ie., EditField) that
you want the popup associated with. Not the popup menu itself. With
ConstructContextMenu and ContextMenuAction, you don't need a popup menu
control at all, the menu, "base" is provided for you, and popped up for you.
Note that your code would work fine in a MouseDown event, though. Just dim
base yourself.
Tim
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Dr
Gerard Hammond
Sent: Saturday, October 14, 2006 4:30 AM
To: REALbasic-DR NUG
Subject: ConstructContextMenu and Popup
Hi,
I need a popupmenu that displays both enabled and disabled rows.
Various NUG threads say that this is impossible with the built-in
popup menu, so I am trying to do this with a contextual menu.
Unfortunately I can't seem to get the simplest ConstructContextMenu
of a popup menu to fire at all.
What am I doing wrong?
PPC IDE 2006R4 on OS X
Here is the ConstructContextualMenu code (from the only Popupmenu
control, on the only window, in a new default project).
Function ConstructContextualMenu(base as MenuItem, x as Integer, y as
Integer) As Boolean
'dim base as new MenuItem
base.Append( EditCut )
base.Append( EditCopy )
base.Append( EditPaste )
base.Append( new MenuItem( MenuItem.TextSeparator ) )
base.Append( new MenuItem( "My menu item text" ) )
base.Append( new MenuItem( "Other text" ) )
dim results as MenuItem
results = base.PopUp
select case results.Text
case "My menu item text"
'DoSomething
dim j as integer = 1
case "Other text"
'DoSomethingElse
dim jj as integer = 2
end select
Return true
End Function
--
Cheers,
Dr Gerard Hammond
MacSOS Solutions
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
--
Cheers,
Dr Gerard Hammond
MacSOS Solutions
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>