I need help to do something in Mac that I do in Windows.
This is the procedure:
In Windows:
- I press the right mouse button.
- In the MouseDown event I return True, so I can use MouseDrag and MouseUp
- If I use MouseDrag I set a flag, otherwise there is no flag.
- At MouseUp event ConstructContextualMenu is called automatically, but according to the flag I return True or False, so ContextualMenu is shown or not.
In MacOS:
- I press the right mouse button.
- Instantly ConstructContextualMenu is called. But at this moment I don’t know yet if MouseDrag will be used. So I can not decide if ContextualMenu must be shown or not.
How should I proceed to do the same in Mac as I do in Windows?
Thanks for your help.
I dont use constructcontextualmenu
Instead I check keyboard.asynccontrolkey in the mousedown/mouseup events which seems to work fine to indicate if it is a right-mousebutton situation
Here (for both platforms):
MouseDown and MouseUp: not used
Code in:
ConstructContextualMenu
ContextulMenuAction
Works fine. I suppose I followed LR examples.
This is in a Listbox.
Edit: typos and additions below:
http://documentation.xojo.com/api/deprecated/rectcontrol.html#rectcontrol-constructcontextualmenu
http://documentation.xojo.com/api/deprecated/rectcontrol.html#rectcontrol-contextualmenuaction
Mac: since MouseDown fires before ConstructContextualMenu, I sometimes use it to build and resolve contextual menus.
Some appropriate #pragma to trap Mac and/or Windows behavior may come useful.
Function MouseDown(X As Integer, Y As Integer) As Boolean
if IsContextualClick then
//build and resolve contextual menu
end if
End Function
Thanks to all.
With all these suggestions I think I can do what I pretend.