Control op Push
D UpdAns
Before we start discussing the code behind this program, we
would like to point out that this program is a tutorial first and foremost and that our
primary intention is that of showing you the various macros and methods that are
available. This should justify the some inconsistency in %%macro usage (although the end
result does work equally well).

Having defined our code, we now add a menu item called Reset. It will lie next to File
menu item, be accessed by ALT+R and will have an option within it call I am Sure.
We will assign a shortcut key CTRL+R so that the user will be able to invoke the option
directly. The screen shot above shows how to assign such keys. Not shown is the message
that will appear at the bottom of the window when the user clicks on Reset.
The action associated with this command is to DO Reset.
Our next task is to also
add a button beneath the Close button called Reset. MSM-Workstation has a tool bar with
all the tools you can use. Clicking on any one will describe what the particular tool
does.
We select the Button icon and click once on our window were we want it to appear. A
default sized button will appear and this objects dialog box will appear.
With this button weve cleared the text and set up an icon for the button. The
icon was created using a drawing package and saved as a bitmap. It is called boom.bmp.
The push action associated with this button is DO Reset.
The Button Definition dialogue box below shows how to go about setting it up.
Another esthetic change will be to Label3. Besides changing the text, we will change
some of the properties of this object. When working with windows and their objects, you
will notice that under the toolbar you have a property bar that allows you to view and
modify all properties associated with that object.

The first drop down list shows all the objects. You can therefore either select an
object by clicking on it or by choosing it from this list. The second list shows all the
properties associated with the selected object. The third drop down list lets you choose
(or enter) from the available options associated with that property. We removed the border
from answer.
How do you follow (dry run) such programs?
There are some parts of the code that will take place when the
program initialises. In our program we have the Window Create event. (we wont
be going into M syntax herethose who are new to M should have a look at our M Tutorial). The called routines may be either within the
event or they may be found in the CommonCode section. The events that remain dictate what
will happen when values are modified, buttons are pushed, radio buttons are checked, etc.
It might help if you associate these events with choices on a menu of a tightly integrated
system. The user will select options the way he wants, although ultimately everything has
to work like clockwork.
Continued...
E&OE
