Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Shortcut menu
Message
From
26/02/2003 09:58:47
 
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Title:
Miscellaneous
Thread ID:
00756895
Message ID:
00758074
Views:
17
Mr. Arie;

I am not certain from your post exactly what you mean by using a shortcut menu from a table, unless you means storing the menu code in a table, which is certainly possible.

Generally, shortcut menus are activated from a right-mouse-click on an object. While a grid has a RightClick() event, this is not particularly useful because the structure of a grid almost always results in a right-mouse-click being registered by an object on the grid: a column or a control in a grid cell.

To force the grid control to pass the right-mouse-click to the grid, you can write something like this code in the control's RightClick() event:
this.parent.parent.RightClick()
What I have done is create a general shortcut menu method on my base form called m_Control_RightClick() and call it from the RightClick() method of every control, thusly...
*   Control.RightClick()
*
RETURN thisform.m_Control_RightClick( this )
In the m_Control_RightClick() method you can distinguish controls on a grid from other controls by examining the control's .parent property.
*   BaseForm.m_Control_RightClick()
*
LPARAMETERS toControl

LOCAL llIsOnGrid

llIsOnGrid = ( UPPER( toControl.parent.BaseClass ) == 'COLUMN' )

IF llIsOnGrid

   *   Display shortcut menu for grid controls.

ELSE

   *   Display shortcut menu for all other controls.

ENDIF

RETURN
I hope this at least starts to answer your questions.

Regards,
Jim Edgar
Jurix Data Corporation
jmedgar@yahoo.com

No trees were destroyed in sending this message. However, a large number of electrons were diverted from their ordinary activities and terribly inconvenienced.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform