Call Box Editors Manual
Version 1.0 Aug 15,1989


CHAPTER 2 - THE DIALOG EDITOR

OVERVIEW
The CALL-BOX Dialog Editor creates templates for use by the Apple IIgs Dialog Manager. This editor can load either OMF2 object code or resources and can output APW/ORCA sourcecode, OMF2 object code and resources. The resource filetype is $1000 and uses a converter to get into memory. The standard programming procedure for resources is presented at the end of this chapter.

DIALOGS
A dialog is a presentation feature that appears when an application needs more information to carry out a command. A dialog box resembles a form on which the user checks boxes and fills in blanks.

The user supplies any necessary information in the dialog box; for example, by entering text or clicking a check box. The dialog box usually contains a button labeled OK to tell the application to accept the information provided and preform the command, and a button labeled CANCEL to cancel the command as though it had never been given.

Dialog boxes provide an alert window that displays items (Controls) for the user to select from. Several standard types are supported by this editor. (See Fig 2.11)

  • Simple button
  • Causes an immediate or continuous action when the user clicks it with the mouse.
  • Check box
  • Retain and display a setting, either checked(on) or not checked (oft); clicking with the mouse reverses the setting.
  • Radio button
  • Retain and display a setting. Grouped into a family in which only one button can be on at any time.
  • Line edit item
  • Displays alphanumeric data and allows the user to edit the data from the keyboard.
  • Static text
  • Displays text used for titles or messages that are not capable of being manipulated by the user.
  • Icons, pixel images
  • For use as alert icons such as the STOP or CAUTION Icons.

    Figure 2.11
    Figure 2.11 Typical Dialog Box

    The Dialog Manager's main function is to present controls until a valid selection is made at which point the manager returns information to the user on what was selected or changed.

    EDITOR OPERATION
    The Dialog Editor is a "DeskTop" type PI6 application and follows the standard conventions for desktop applications. Support for new desk accessories (NDA's) is provided via the apple selection in the menu bar and an Edit menu which become activated when a "system" window is up.

    To best illustrate how to create a dialog template we will run through an editing session and create one from scratch.

    Let's make this dialog in 320 mode ... if you are just starting the editor the screen mode will be 640. If you want to create a dialog in 320 mode select 320MODE from the GOODIES menu.

    1.     Select FILE-NEW. A dialog box will appear.

    2.     Select CONTROLS-DRAGGING, MODIFYING and when you move the cursor in the dialog box it will change to a hand for dragging things around.


    Very Important!

    This will be the normal cursor mode, the arrow is just for test operating your dialog box.

    You are now ready to put some dialog items in your dialog box. Let's use one of each type to get some practice.

    3.     Select CONTROLS-STANDARD BUTTON followed by the other five types ... CHECK BOX, RADIO BUTTON, ICON, LINE EDIT BOX and TEXT.

    This wil put a mish-mosh of items in your dialog box one on top of the other.

    4.     Use the mouse and the hand cursor to drag the items off of each other and place them so that each one can be doubleclicked.

    You can grab and drag the right and bottom edge of the dialog box to either grow or shrink it and even grab it somewhere in the middle where it's free of an item and move the whole dialog box around.

    To set-up a particular dialog item you must double-click the item in question. A dialog box editor will appear tailored for the particular item.

    5.     Double-click the Standard Button item in your dialog box. (See Fig 2.12)

    A dialog box will appear. Change something and then select DONE to see the results. Repeat this several times to learn how to operate this part of the editor. A detailed explaination of these functions may introduce more doubt and uncertainty than if you work it out for yourself.

    This learning technique applies to the following five steps and to life in general. Enough philosophy, fiddle around with the other items in the dialog box.

    6.     Double-click the Check Box. (See Fig 2.13)

    7.     Double-click the Radio button. (See Fig 2.14)

    8.     Double-click Icon (See Fig 2.15)

    9.     Double-click Text (See Fig 2.16)

    10.     Double-click Line Edit (See Fig 2.17)

    Figure 2.12
    Figure 2.12 Standard Button Edit Dialog
    Figure 2.13
    Figure 2.13 Check Box Edit Dialog
    Figure 2.14
    Figure 2.14 Radio Button Edit Dialog
    Figure 2.15
    Figure 2.15 Icon Edit Dialog
    Figure 2.16
    Figure 2.16 Text Edit Dialog
    Figure 2.17
    Figure 2.17 Line Edit Dialog

    Several selections in the GOODIES menu will aid you when aligning and centering:

  • Horizontal Grid
  • Enables or disables an invisible snap grid for item placement.
  • Align Controls
  • Snaps items to the position of the invisible grid.
  • Center Dialog
  • Moves the entire dialog box to the center of the screen.
  • 2/3 Center
  • Moves the entire dialog box to center horizontally and two thirds of the way up from the bottom of the screen.

    Fine adjustments can be made to an items placement by setting the coordinates numerically while each item is being edited.

    To delete an item hold the OPTION key while double-clicking it and an option to delete it will come up.

    This about finishes up creating your dialog box, you could save it at this point but let's cover some other things about this editor first.

    Special Explanation

  • The menu selection GOODIES-DISPLAY INFO will bring up a control info scroll window. This window represents a list of items in your dialog box that is kept internally in the editor.

  • Figure 2.18
    Figure 2.18 Info Window

    Double-clicking an item in this window will bring up the edit dialog for that item the same as double-clicking the item itself.

  • The menu selection GOODIES-PRINT INFO will dump this list to your printer. The list is very handy for subsequent identification of items and their LD. numbers. The menu selection FILE-CHOOSE PRINTER will select the proper driver for your printer. Your printer driver must be in the SYSTEMIDRIVERS subdirectory of your boot volume.

  • Do not be switch modes after a dialog box is started. Colors become strange and the rectangular limits often go askew.

  • The menu selection CONTROLS-NORMAL RESPONSE will change the cursor to the system arrow and allow you to test your dialog box.

  • SAVE DIALOGS
    Once you have created a dialog template you will want to save it to disk so it can be incorporated in your program code.

    Select FILE-SAVE AS ... A save dialog box will appear as shown.

    Figure 2.19
    Figure 2.19 Save Dialog Box

    This box has buttons to select the drive, create a new folder, open or close a folder, cancel the operation and save the file. There is also a box for typing in a filename and three radio buttons across the bottom of the dialog box. These three buttons select the type of output you will be saving.

  • Object ($B1)
  • Select this button to save the template as an OMF2 object file. This filetype can reloaded by the editor.
  • Source ($B0)
  • Select this button to save the template as an APW/ORCA source code file. This filetype can not be reloaded by the editor.
  • Resource (any file)
  • Select this button to save the template to a resource fork of an extended ProDOS file. This file type can be reloaded by the editor.

    Selecting either Object or Source will create or overwrite a file on disk. The operation is straight forward. Selecting Resource, however, will present extra windows that control how resources are saved to disk. Resources are assigned types and I.D.'s. The type for a CALL-BOX dialog template is $1000 and is set by the editor. You only need set the I.D. for your resource. You can either rewrite an existing resource by double-clicking on its I.D. number or double-clicking the ---->New entry to save with the next avaliable I.D. number. (Fig 2.20)

    Figure 2.20
    Figure 2.20 Save Resource I.D. Window

    You can cancel the resource save operation by clicking the close box in the title bar of the resource I.D. window. You can also edit the resource I.D. (re-number or delete) by pressing and holding the OPTION key while double clicking the desired I.D. (See Fig 2.21) When renumbering resource I.D.'s be sure to use 8 hex digits in the I.D. number window (use leading zeroes to pad small numbers). Failure to do so will cause unpredictable results and could ruin the resource fork of the ProDOS file.

    Figure 2.21
    Figure 2.21 Edit Resource I.D. Dialog Box

    If a resource fork does not exist for a given ProDOS file a dialog box will appear that gives you the opportunity to create one.

    LOAD DIALOGS Once you have created dialogs and saved them to disk you may want to load them to the editor for further editing.

    Select FILE-OPEN ... A load dialog box will appear. (See Fig 2.22) This box has buttons to select the drive, open or close a folder, cancel this operation and open the file. There are 2 radio buttons at the bottom of the dialog box. These select the type of input you will be loading.
    Figure 2.22
    Figure 2.22 Load Dialog Box

  • Object, ($B1)
  • Select this button to load an OMF2 type of dialog template file.
  • Resource (any filetype)
  • Select this button to load the template from a resource fork of an extended ProDOS file.

    Selecting Object will load a file from disk and the operation is straight forward. Selecting Resource, however, will present some extra windows that control how resources are loaded to memory.

    Resources are assigned types and I.D.'s. The type for a CALL-BOX dialog template is set to $1000 by the editor. You set is the I.D. for your resource. You can load a resource by double-clicking on the desired I.D. number.

    Figure 2.23
    Figure 2.23 Load Resource ID. Window

    You can cancel the resource load operation by clicking the close box in the title bar of the resource I.D. window. You can also edit the resource I.D. (re-number or delete) by first pressing and holding the OPTION key while double-clicking the desired I.D. (See Fig 2.21) When re-numbering resource I.D.'s be sure to use 8 hex digits in the I.D. number window (use leading zeroes to pad small numbers). Failure to do so will cause unpredictable results and could ruin the resource fork of the ProDOS file.

    If a resource fork does not exist for a given ProDOS file then no template will be loaded.

    <- Previous | Next ->