Hi David,
 
Since you mention you already have a "Help" choice on your app menu, then
you must have generated your app starting with the WE Script Framework; this
means it's going to be very easy for you to add additional choices to this
menu, as a lot of the work has already been done for you, and provides
examples for you to follow.
 
If you use UIDesign you'll see the menu for your app being defined as one of
the very first entries under the language entry.  This is a tree structure,
and if you open up the menu you'll see the menuItem for the help choice.
All you need to do here is to add one or more menuItems of your own to this
menu.
 
You go back up to the menu (so it's highlighted), and then you can choose
through the "Insert" menu of UIDesign to insert a control, and menuItem is
what you want to add.  You add it, and then go down to the new menuItem
entry and change the text property to define what it should say, and the ID
property so you can specify what you will refer to it as in your programming
code.  You're done here in UIDesign, so you save your changes.
 
Now go into your code and find the menu event handler which the WE Script
Framework created; it will be a function named menuProc.  You'll see how if
refers to the help menuItem by the ID value to handle it; you'll need to add
another case to refer to your newly added menuItem by its ID name, and
you'll need to cause your dialog to be displayed.  You'll need to use a
QUEUE command to run a subroutine which will cause your dialog to open,
because displaying a dialog is one thing that would normally cause your app
to "halt" while the dialog is open (that is, your menuProc function won't be
allowed to complete and return a value if you don't use a QUEUE command to
do this).
 
That's it: modify your xml with UIDesign, modify your menu event handler,
and remember to use QUEUE commands for things which do any sort of file i/o
or create new dialogs.
 
hth,
 
Chip
 


  _____  

From: David [mailto:eleph...@tele2.no] 
Sent: Friday, April 27, 2012 7:32 AM
To: gw-scripting@gwmicro.com
Subject: Adding an entry to the app menu?


OK, likely I am overlooking something here. 
 
I have an app, with a rather extensive documentation. The documentation has
been split into several chapters, and I have a dialog up running, with the
list of Contents, and a chance for the user to pick the topic he wants to
read. All that, is working pretty well. And, I have got the dialog to work,
from the Help and Options menu, in the App Manager.
 
Now, I was wondering, if there is a way to add this dialog more directly to
the app. What I mean, is that when a user opens the App menu (Alt-A) from
the WE control panel, then scroll down to the app of mine, and hit Enter. As
it stands right now, there is only one entry in the drop-down he gets, and
that is the standard Help (Script Help). Is there any way for me, to add my
dialog as a choice on that list? So, when he hit Enter on the app, he gets
two choices, The standard ScriptHelp (which will hold a very short
description of the app and its hotkeys), and another choice saying things
like: "Read Full Documentation". If he chooses this one, my dialog will
open.
 
Hope all of this made sense. I am eager to know, what instructions I would
be looking at, to add my dialog to the drop-down list.
 
Thanks, guys,
 

Reply via email to