| Stonefield Query SDK |
| Application.SetupMenu |
The menu system is referenced with an object passed as the second parameter to the code. Top-level menu items, such as File, Edit, and Tools, are called "pads" and are referenced by members of the menu named with the English caption for the pad followed by "Pad." For example, the File pad is referenced by toMenu.FilePad. To add a menu item (called a "bar") to a menu, call the pad's AddBar method, passing it the name (not caption) of the bar. You can then set properties of the bar object returned by AddBar. A bar object has the following properties:
After adding bars to a pad, call the pad's Show method to redisplay the menu.
Parameters
A reference to the Stonefield Query Application object and a reference to the menu system object.
Return Value
Any value (Stonefield Query ignores the return value).
Example
Here's an example taken from Stonefield Query for Sage Pro ERP that adds a "Import Report Writer reports" bar named FileImportFF to the File pad. cOnClickCommand is set to ImportFF, which calls a custom script with that name.
Visual FoxPro
lparameters toApplication as SQApplication, toMenu
local loBar
loBar = toMenu.FilePad.AddBar('FileImportFF')
with loBar
.cPictureFile = 'importxpsmall.bmp'
.cCaption = 'Import ACCPAC Report &Writer Reports...'
.cOnClickCommand = 'ImportFF()'
endwith
toMenu.FilePad.Show()See Also
Scripts
| Last Updated: 06/01/11 |