For projects working with an API, the developer / user of a project can see the API commands in the magic wand, after some preparation, to be done once for each project.
In Script.Project [Variables]
- The line %API%=<ApiScript> already exists if the project already uses the API
- Cut all the lines in script.project [Variables] which define API calls, and paste them into Api.script in a new created section [<ApiVar>]
- In Api.Script generate a new section [<API>] containing the syntax of the API commands how it should appear in the magic wand.
Sample:
Require_Version=Require_Version,Filename,Version,Section - In Api.Script generate a new section [<Title>] containing the syntax of the submenu API commands how it should appear in the magic wand.
- In script.project, add in [Process]
AddVariables,%API%,<ApiVar>,GLOBAL - In script.project, add the [Variables]
- %APIVAR%=<ApiVar>
- %APIDEF%=<API>
- %APISUBDEF%=<Title>[,<Title>[, ...]]
- <ApiScript> the full page to the Api.Script file, maybe with variables like %ProjectDir%
- <API> a user defined string which will appear in the magic wand as menu item, preferably "API"
- <ApiVar> a user defined string for the name of the new api variable definition section in api.script, preferably "ApiVar"
- <Title> a user defined string which will appear in the magic wand as sub menu titel, e.g. Shortcuts
And
- Build Project
- Build Single Script
- Run Codebox
This will work with WinBuilder 075 beta 6 b and later.
New commands in API.script can be used and added to the magic wand menu w/o any changes in script project, just by delivering the new Api.script
Peter
Edited by psc, 18 January 2009 - 11:19 AM.
Adding of sub menus