-------------
 GUIDELINES
-------------



Creating a simple PM application with Guidelines: 
-------------------------------------------------

Building a small Presentation Manager application can be very simple, and in 
this section we'll see how all the elements fit together. 

It is assumed that CSet++ has been installed, followed by Guidelines, and the 
paths have been set up correctly as a result.

1.  Most applications start with a main frame window. Select "Frame" from the 
"Create" menu, and a frame window will appear with a menu bar.  Double 
clicking on the title bar brings up a details dialog to allow you to change 
the appearance. Change the "Title" field from "Text" to "My Test Application" 
and press the "OK" button to dismiss the dialog. The new title will appear in 
the title bar.

2.  To brighten up the window, let's put some text in it. Traditionally a 
first program bears the words "Hello World", so from the "Create" menu we 
select Static|Static Text and click on the main frame where we want this text 
to appear. Double clicking brings up the Details dialog for the static text, 
so we enter "Hello World" in the "Text" field. 

3. As with most items, we would like to change the appearance of the text, so 
click on the top picture button on the left (red "a") to select "Presentation 
Parameters". For the first parameter in the list ("Font name/size") select a 
font, "Times Rmn Bold" for instance, and set the point size to 18. A sample 
will appear in the preview box. The second and subsequent items select the 
lettering colors, so pick one of your choice. When you are done, close the 
dialog, and you will see the words "Hello World" in your frame. You will 
probably have to resize the box around the text, and move it with the mouse 
so the words fit properly, and it is nicely centred.

4.  Next we will set up the menu to include an exit option to quit the 
application. Double click on the menu bar to bring up a menu arrangement 
dialog with the menu structure. Double click on MenuItem1 and a details 
dialog for that item will appear. Change the item "Text" to "Exit".

5.  To add the code behind the Exit option, select the "Action Editor" by 
clicking on the "Actions" button (just above the Trashcan on the right hand 
side). Using a right mouse click on a window or menu etc will also do this.

The action editor will appear, and display a window in which you can enter 
JOT code. Here we simply want the program to exit when the menu item is 
selected, so we enter  ExitProgram (0).  The module will look like this:

 VOID Frame1.MenuItem1.Click ()
     ExitProgram (0)

 end

Instead of typing ExitProgram, you can click the right mouse button in the 
Action Editor window, and you will be prompted for the code you wish to 
enter. In this case you would select "Functions" then "Process Control" then 
"ExitProgram" from the cascading menu. This menu is called the prompter, and 
allows you to start writing programs quickly, without learning lots of 
language details first. Close the Action Editor, and opt to save the changes 
made. The F1 key at any point will bring up the online help.

6. The basis for a PM application has now been written. Before going ahead 
and generating it, we need to fill in the "Application Settings" from the 
"File" item on the main menu.  All you need to change is the "Main Source 
File" option to give a name for the generated files (eg MYAPP1), but you 
will probably want to customise the title and copyright message as well.

7. To generate and build the program, from the "Output" menu select 
"Generate" then "Compile". This will create the files you need, and build a 
PM executable called MYAPP1.EXE.  Selecting "Run" from the "Output" menu 
will the run your program.


Of course it doesn't do much, but "Hello World" progams are rarely intended 
to - instead it demonstrates the principles on which all PM applications are 
built. A couple of hundred lines of C++ code were generated, without any 
necessary knowledge of C++ or the underlying tools. 

Guidelines contains a lot of functionality beyond that shown here, and 
additional controls are available from JBA International to extend its 
capabilities still further. In the Guidelines folder on your desktop, take a 
look in the BIN and GUI folders. These contain demonstration programs and 
samples respectively, of varying complexity. At one end of the scale, 
ENGINE.EXE shows a simple animation, while at the other GUIMINE.EXE and 
BATTLE.EXE are full PM games.


 Jon Wright [Guidelines Tech Support] 

c) JBA International Plc 1994.