You are on page 1of 7

Inform Box Editor

The Inform Box Editor Window can be opened and closed by using the Debug4x Main Window's View Menu. There is no shortcut key. The Inform Box Editor is the way to create, modify or inspect source code which draws Inform Boxes on the calculator. The Inform Box Editor is a graphical user environment for creating these boxes. Source code created by the Inform Box Editor can also be inspected and modified using the Debug4x Source Code Editor menu item Open Inform as Source. The Inform Box Editor converts a graphic image of a form into RPL. The RPL that is produced can be customized through the use of five edit boxes:

Definitions: user code that will be inserted at the beginning of the file before the external name is defined (EXTERNAL statements for special code) Init Code: user code that appears immediately after the external name (xNAME) is defined (example {{ A B C }} for local variables) Ending Code: user code which appears just before the terminating ; for the unit (example ABND for local variables) Additional Code: user code which appears after the terminating semicolon for the unit (example the xNAME Config or other verb) Source: this is the code generated by the Inform Box editor. It includes the user code from the other four boxes above.

A double click in any of the above boxes opens a full editor window similar to the Source Editor window. Within these windows bookmarks, shift-space (Template Completion), ctrl-space (Dynamic Verb Completion) and all the other editor features may be used. The Inform Box Editor has many features. These are presented in the following articles:

Form Settings Rules for message handler fields Source Code Areas Labels Fields RPL or Quoted Strings for Title, Label Messages, Field Help Field Properties Buttons

Form Settings. The blue outlined area in the above picture shows the Form Settings area. These items apply to the definition of the entire form:

48 Style: selects a DoInputForm style box, otherwise HP49 style IfMain will be used. 48 Style may be used on an HP49 if desired. M Table: if checked, text strings will be added to the library's Message Table, otherwise text strings will be embedded in the verb. Do...Inform: normally the entry name for the inform box will be given by the Unit Name edit box. The default is the same name as the file name. If the Do...Inform box is checked the entry point name will be DoUnitNameInform where UnitName comes from either the Unit Name box or the file name default. This check box has been provided to enable compatibility with past versions of the software. If a file generated by debug2 is loaded, this box will be checked automatically. NAMELESS: define the entry point name of the form using NAMELESS name. xNAME: define the entry point name of the form using xNAME name. If neither xNAME nor NAMELESS is checked, NULLNAME name will be generated. Use NULLNAME (no check marks) for internally called library routines. Use xNAME if you want the name listed as an entry for your library. LOCALNAME: any handlers will be defined using LOCALNAME name instead of NULLNAME name. This is for ROM developers. Author: Enter your name. This name will appear in the header information lines at the beginning of the generated source code. Unit Name: The external name of the form unit. This is the name that will be called from other verbs. Title String: The title line which appears on the top most line of the Inform Display. See RPL or Quoted Strings for Title, Label Messages, Field Help for use of RPL in this field. Form Message Handler: code for the form's message handler. see the Rules for Message Handler Fields for these fields.

Source Code Areas There are five source code areas on the Inform Edit Window:

Definitions, user code which is inserted before the Inform's :: entry point. Example: EXTERNAL statements, EQUs etc. Init Code, user code which appears just after the Inform's :: entry point. Example: the {{ }} local variable definitions. Ending Code, user code which is inserted by the Inform Editor just before the Inform's ; end. Example: the ABND for local variables. Additional Code, user code which is inserted by the Inform Editor just after the Inform's ; end. Example: xNAME CONFIG or other verb definitions. Source, automatically generated RPL code which creates the Inform Box. User changes in this area will be discarded during any Save. (See Editing Generated RPL below).

Double clicking any source code areas will open a large editor window with all the features of the main editor window (bookmarks etc). Even when the windows are not expanded, the Dynamic Verb Completion and the Template Completion features will work in these windows.

Editing Generated RPL The RPL Source generated by the Inform Editor can be edited by following this procedure:

Close the Inform Editor In the main Editor Window, select Open Inform As Source... from the File menu. Edit the RPL and then save it to the file. The changes will remain in the file until the next time the file is saved from the Inform Editor window or until the next time the Generate Source button of the Inform Editor is pressed.

Inform Editor Buttons There are five buttons on the Inform Editor screen:

Generate Source, creates source code from the graphical screen layout. Generate Layout, creates the graphics from the source code. Save, saves the source code to a file. Save As, saves the source to a new file. Open, opens a new source code file.

Generate Source The source code in the Source window is generated from the graphical screen in the upper left of the Inform Editor window. Any previous changes made by the user to the source code will be lost. Code from the Definitions, Init Code, Ending Code, and Additional Code will be included in the Source code. Generate Layout The embedded numeric areas at the end of the RPL source code will be scanned and used to re-create the graphical picture of the Inform Box. These numeric areas are clearly marked and they should never be modified by the user (or Debug4x may not be able to re-create the graphics and the form will become unusable). Save The RPL Source will be generated and then saved to the current file. Save As The RPL Source will be generated and then saved to a file. The user will be asked to supply the file name using a standard Windows Save Dialog. Open If the current file has been modified, the user is prompted to save it. A Windows Open Dialog will be shown to choose a new file for opening. If the selected file is an Inform Box file, it will be opened in the Inform Editor otherwise it will appear in the Editor.

Inform Box Editor Labels


Create a Label Labels display fixed text strings on the Inform Box. To create a new label:

Click New Label, a new, blank label will appear in the simulated screen area. In the Message box, type the text that should appear in the label. See RPL or Quoted Strings for Title, Label Messages, Field Help for use of RPL in this field. In the Label Name box, enter a meaningful name for the label (or you can just leave the default name). Drag the label to the desired position on the screen. The label may also positioned by typing or using the arrow buttons in the Left and Top boxes. The width and height of the label can also be adjusted (HP49 only) using the Width and Height boxes. Visible can be unchecked (HP49 only) to make the label invisible. RPL code then can make it visible when desired.

Label and Field Selector There is a selection box just above the New Label button. This selector can be used to make any field or label the currently selected item. Data is then displayed for that field or label. A field or label can also be selected by clicking on the label or field with the mouse. Delete a Label or Field To delete a label or field, select the label or field with the mouse or selector box then press Delete. There is no undo for this deletion.

Inform Box Editor Fields


Create a Field Fields are the user entry boxes on the Inform Box. To create a new field:

Click New Field, a new, blank field will appear in the simulated screen area. In the Field Name box, enter a meaningful name for the field (or you can just leave the default name). Drag the field to the desired position on the screen. The field may also positioned by typing or using the arrow buttons in the Left and Top boxes. Adjust the width and height of the field using the Width and Height boxes. Visible can be unchecked (HP49 only) to make the field invisible. RPL code then can make it visible when desired. The field properties must be also be set to define the field type.

Label and Field Selector There is a selection box just above the New Label button. This selector can be used to make any field or label the currently selected item. Data is then displayed for that field or label. A field or label can also be selected by clicking on the label or field with the mouse.

Delete a Label or Field To delete a label or field, select the label or field with the mouse or selector box then press Delete. There is no undo for this deletion.

Inform Box Editor - Field Properties


Field Message Handler Every field may have a message handler. A default will be provided if no code is present in the box. See the Rules for message handler fields. Types Place check marks for the various data types that may be entered into the field. Multiple checkmarks are accepted. InitValue Enter an initial value for the field. This is the value that will be displayed when the form first runs on the calculator. If InitValue is left blank, MINUSONE will be automatically provided. ResetValue Enter the reset value for the field. This is the value that will be copied into the field when the user selects reset for the form or field. If ResetValue is left blank, MINUSONE will be automatically provided. Help String This text will be displayed on the last line of the form whenever the calculator has entered the field. It is a prompt for the user. Do not include a leading or ending quote mark. See RPL or Quoted Strings for Title, Label Messages, Field Help for use of RPL in this field. Field Type Select the type of field desired. The types are:

Text User can enter anything ChooseEdit (or ComboBox) User can select from a list of values or enter another (not on HP48) Choose User selects from a list of values. CheckBox User can check or uncheck the field.

Decomp Check the type of processing that should be used for this field. The choices are:

{x} Take the first decomposition item in a list {..x} Take the second item in a list Stack Ap Display as the item would appear on the stack. Edit Ap Display as the item would appear in the editor. This is a good value to start with if you are unsure of what to use. First char Display the first character of the item

Mini Font (HP49 only) Display using the mini-font. (May be combined with the other items in the list). Text (HP48 only) No decompile, just display the string as given. none used when only strings will be on the stack and they will be displayed without quotes in the standard font.

Do not combine these check marks (other than Mini Font) unless you really understand what they do on the calculator. Chose Dec. Choose Decompile type for ChooseEdit or Choose type fields. Choices are:

ONE Display as on stack TWO Display as in editor FOUR Display the first character of a composite SEVENTEEN Display first object of a composite, as on stack MINUSONE Display

Choose List Items Enter the list of items for ChooseEdit or Choose type fields. For example: { {"String1" verb1} {"String2" verb2} } ChooseEdit I cannot make this field type work properly. If you know how to do it, send me an email message! RPL or Quoted Strings for Title, Label Messages, Field Help: The strings used for:

Inform Box Titles Label Messages Field Help Strings

are usually coded as literal strings. The Inform Box Editor will automatically place quotes around the entered text imagen

The above strings may be replaced with RPL code which computes and then loads a string to the stack. Sometimes this can be useful when the programmer has a unique string library technique (other than the Message Table built into HP libraries). To use this feature, remove the check mark from the Quote box just in front of the Form Title, any Label Message Box or any Field Help string box. If you do this for Imagen

one label, it will apply to all labels. If you do this for one field, it will apply to all fields

If some of the help fields are RPL code but a few are still text, an RPL text string ("abcdefg") with quotes may be entered. This will generate a literal RPL string. Such a string will NOT be collected into the Message Table, even if the M Table option has been checked. To use the Message Table, little quote boxes must be checked.

Message Handler Fields:


If the edit box is empty, then the field (or form) message handler will be set to 'DROPFALSE. This is the standard, default message handler. If the edit box begins with anything except "= ", Inform Edit expects you have coded a handler and the entire contents of the box becomes the in-line handler. Typically this would start like: ' :: IfMsgaaaaaaa #=case . . . ; If the edit box begins with "= " (equal sign followed by a space), then the field (or form) message handler will be set to FieldNameHandler (or UnitNameHandler for forms). After all the code for the form unit has been defined and after the final semi-colon, Inform Editor will define a series of verbs for the various message handlers. These units will start with NULLNAME FieldNameHandler (or UnitNameHandler for forms) followed by the text from the edit box. The edit box should start with "= " then have a :: and end with a fianl ; after all the code has been entered.

Summary MessageHandler Message Handler Box Field empty 'DROPFALSE ' :: code ; ':: code ; 'Name 'Name code code results ' = :: code ; FieldNameHandler Added Entry Code no generated entry no generated entry no generated entry no generated entry NULLNAME FieldNameHandler :: code ;