22
BAAN IV Tools Graphical User Interface (GUI) Developer’s Guide 5570US

BAAN IV Tools Graphical User Interface (GUI)

  • Upload
    others

  • View
    12

  • Download
    0

Embed Size (px)

Citation preview

Page 1: BAAN IV Tools Graphical User Interface (GUI)

BAAN IV Tools

Graphical User Interface (GUI)

Developer’s Guide 5570US

Page 2: BAAN IV Tools Graphical User Interface (GUI)
Page 3: BAAN IV Tools Graphical User Interface (GUI)

Graphical User Interface (GUI)

i

Document

Number : 5570USType : Developer’s GuideName : Graphical User Interface (GUI)Version : ADate : December, 95

Document information

© Copyright 1995 Baan Development B.V. The Netherlands

All rights reserved. No part of this publication may be reproduced and/or published by print, photoprint,

microfilm, audiotape, electronically, mechanically or any other means, or stored in an information

retrieval system, without prior permission from the copyright owner.

Because of the continous development of the products of Baan Development b.v. it is quite conceivable

that this documentation is incomplete or inadequate. Hence, all information contained herein is of a

general nature and can never fall under any contractual obligation.

Page 4: BAAN IV Tools Graphical User Interface (GUI)

Graphical User Interface (GUI)

Graphical User Interface (GUI)

ii

Page 5: BAAN IV Tools Graphical User Interface (GUI)

Graphical User Interface (GUI)

iii

1. GUI Developer's Guide 1.11.1 Multi-occurrence area 1.11.2 Scroll bar 1.11.3 Selected records 1.11.3.1 Variables 1.11.3.2 Loops 1.11.3.3 Object action model 1.21.4 ASCII screens 1.21.5 Invisible fields 1.31.6 Zoom 1.31.7 Different types of forms in one session 1.41.8 Single-occurrence fields under multi-occurrence area 1.41.9 Buttons in the button area 1.41.10 Messages 1.51.10.1 Messages in BX/BW 1.51.10.2 Messages and shortcuts 1.51.10.3 Message types (BX/BW only) 1.61.11 Form editor 1.61.11.1 Group box 1.61.11.2 Buttons 1.61.11.3 Additional space 1.71.11.4 Skip top lines 1.71.12 Switch to process 1.71.13 Mnemonics 1.91.14 Ellipsis 1.91.15 Vertical occurrences 1.101.16 Button for cont.process 1.101.17 Form tabs 1.101.18 Display fields used as labels (BW only) 1.111.19 Zoom type 1.111.19.1 Modeless 1.121.19.2 Modal child dialog 1.131.19.3 Modal dialog 1.141.19.4 Modal without title 1.151.20 Start and end options 1.151.21 Required changes in applications 1.161.21.1 Terms and definitions 1.161.21.2 Specifying the ordering method in print sessions 1.16

Table of contents

Page 6: BAAN IV Tools Graphical User Interface (GUI)

Graphical User Interface (GUI)

iv

Structure

This document describes the consequences of changes in the userinterface for BAAN 4GL programmers.

Introduction

Page 7: BAAN IV Tools Graphical User Interface (GUI)

Graphical User Interface (GUI)

1 - 1

1.1 Multi-occurrence area

In a graphical environment, multi-occurrence fields are placed in aseparate window (possibly with their own scroll bars). To keep the labelsabove these fields in the same window, the standard program adds thelines that contain labels to that multi-occurrence window by placing themdirectly above this area. The number of lines is calculated and set bymeans of fattr.toplines. The value that is calculated for the number oflines is a default value which can be overwritten in the before.programsection. If the labels for the multi-occurrence area are spread out overfour lines and if the formula does not meet the user’s expectations, thefollowing lines must be added:

before.program:fattr.toplines = 4

1.2 Scroll bar

The fattr.scrollbar variable makes it possible to remove the scroll bar fromthe multi-occurrence area. This variable must be set in the before.programsection:

before.program:fattr.scrollbar = false

1.3 Selected records

1.3.1 Variables

Name Description Typemarked index of the record that was selected last longunmarked index of the record that was unselected last longnumber.of.marks number of selected records longmark.table() for every record : is selection set? array of longs

Example of mark.table:

for i = 1 to filled.occif mark.table(i) then

do.occ(i, some_function)endif

endfor

1.3.2 Loops

The choice.mark.occur (before/after .choice) sections are executed eachtime a record is selected or unselected.

The following is an example of a piece of code that will cause a loop:

1. GUI Developer's Guide

Page 8: BAAN IV Tools Graphical User Interface (GUI)

1 GUI Developer's Guide

Graphical User Interface (GUI)

1 - 2

choice.cont.process:on.choice:

if (not number.of.marks) thenexecute(mark.occur)

endif

choice.mark.occur:after.choice:

if (not mark.status) thenexecute(cont.process)

endif

For example, the last record is unselected. This implies an execute of thecont.process event. Since no records were selected, the mark.occur eventis executed which will result in an infinite loop.

1.3.3 Object action model

A common GUI guideline is to first select the objects and then specify theaction. In the BAAN IV ASCII interface, this is to first enter the commandand then select a record. In the BAAN IV GUI, the standard program willaccept the object action model for the delete, copy, text manager, etc.options. If no records are selected, the No records selected for option(delete, copy , text) message will appear and the command will becanceled.

Unfortunately, many scripts contain the following code fragments:

choice.user.0:on.choice:

if (not number.of.marks) thenexecute(mark.occur)

endif

or

choice.zoom:on.choice:

execute(mark.occur)if marked then

zoom.to$(??????)endif

These should be replaced by:

if (not number.of.marks) thenmessage(code) | "No records selected, command canceled"choice.again()

endif

1.4 ASCII screens

The switch.to.ascii.mode function can be used to run certain sessions inASCII mode, for example if there are calls to the print, cp$(), data.input()

Page 9: BAAN IV Tools Graphical User Interface (GUI)

1 GUI Developer's Guide

Graphical User Interface (GUI)

1 - 3

and key.in$() 1 functions (ASCII functionality). The switch.to.ascii.modefunction should be called in the before.program section.

before.program:switch.to.ascii.mode()

Child processes will inherit the display mode from their parents. If themodes of the child and parent processes differ, a new main window willbe created for the child process. A general problem arises whenever agraphical 4GL process starts an ASCII 3GL process which starts agraphical 4GL process. The 3GL process explicitly sets the mode to ASCIIto create a new graphical main window for its child processes. Theswitch.to.ascii.mode() function is not available in 3GL code. The 3GLequivalent is:

graphical.mode = false

1.5 Invisible fields

inputfield.invisible(...)Even if the attr.echo attribute is switched off, input fields are still visiblebecause of their shadow effect and background color. This function isused to make certain fields entirely invisible.

before.program:inputfield.invisible( “ttadv200.cpac”, ”ttadv200.crel”)

This function can be called anywhere in the program script, to either makefields invisible or visible under certain conditions.

inputfield.visible(...)This function is used to make a field visible again.

is.field.invisible (string field.name18)This function checks if a field is visible or not. For example:

if not is.field.invisible(“ttadv200.cpac”) then...

endif

1.6 Zoom

In an ASCII environment, the choice field is used to zoom to a menu. Theresult is a pop-up window in which a session (or another menu) can beselected from a predefined set of options.

If a menu code is added to the choice field (in the form editor), the menuitems will be added to the Application menu group in the menu bar.

The menu items in the menu bar are static which means they cannot bechanged after the user has clicked on the menu group. In BAAN IV terms,

1 The function key.in$(99) is still available in graphical forms.

Page 10: BAAN IV Tools Graphical User Interface (GUI)

1 GUI Developer's Guide

Graphical User Interface (GUI)

1 - 4

this means that the choice.zoom-after.choice section is executed after amenu item was selected.

To support the flexible selection of a zoom menu and guarantee ASCIIcompatibility, a simple solution was found:

First, a zoom menu dependent on the data must be selected. In the Zoomfield, menu must be specified whereas the Zoom Code field must remainempty. The standard program will detect a context-dependent zoom and,as a result, only one menu item is added to the Application menu group. Ifthis option is selected, a dynamic pop-up window will appear containing allitems from the fattr.zoomsession$ menu dump.

Remarks

•• Limit the number of sessions in a sub-menu to 8.•• Do not use sub-menus in sub-menus.

1.7 Different types of forms in one session

It is now possible to have different types of forms in one session. Forexample, the first form is of type 2 or 3 (multi-occurrence or multi-occurrence with overview) while the second form is of type 1 (single-occurrence).

An example of this new feature can be found in the Maintain Table Fields(ttadv4122s000) session.

1.8 Single-occurrence fields under multi-occurrence area

Stand-alone fields are used as to display additional information on aparticular record. These fields are handled by the 4GL script. See, forexample, the Maintain Hours Accounting (tpppc2131m000) session.

BAAN IV offers the functionality to display the fields of a selected record.This function is used to specify the table fields that must be handled asmulti-occurrence fields even though they are specified as single-occurrence fields and are filled with the values of the current record.Because of this functionality, it is now easier to maintain several fields fora table in a multi-occurrence session.

In previous releases, these fields are handled as view fields. For example:

before.program:single.fields.on.mocc.form ("ttadv200.cpac","ttadv200.crel")

1.9 Buttons in the button area

In the Maintain Forms (ttadv3100m000) session, an extra option isavailable to define form buttons for both standard and form-specific

Page 11: BAAN IV Tools Graphical User Interface (GUI)

1 GUI Developer's Guide

Graphical User Interface (GUI)

1 - 5

options. If no buttons are defined, a default set of buttons will be created,depending on the session type.

These buttons are created on the right side of the form. This is becausethere is no space underneath the form on 640x480 VGA displays.

Remarks

•• Do not add buttons in this area for large forms (132-column forms),because these buttons will occupy space needed by the form.

•• Do not use abbreviations in buttons.•• Do not add buttons to a process form.•• Limit the number of buttons to four, not including the OK, Cancel, and

Do buttons.

The following chart provides a list of created buttons if no buttons arespecified. Buttons are created, provided the corresponding options areactivated.

Session Type OK Cancel2 Continue Default3

Main Maintain X ContinueMain Display X4 X ContinueMain Other X4 X ContinueSub Maintain X ContinueSub Display X X X OKSub Other X X Continue

1.10 Messages

1.10.1 Messages in BX/BW

Messages in a graphical environment should not refer to shortcutsbecause the options that are used frequently should be available in theform of buttons. If these options are represented by buttons, the shortcutis available in the menu bar. It is possible to specify whether a messageon the choice field should be displayed in BA only or also in BX and BW.

1.10.2 Messages and shortcuts

Although shortcuts in messages should be avoided, they areautomatically converted to GUI shortcuts if entered in the appropriateformat. The character should be enclosed in square brackets ([.])and themodifier (control) must be entered as <Ctrl>. 2 Started with <Esc>. If there is no Cancel button, <Esc> will start the Undooption.3 Started with <Return>.4 Only if Continue is active.

Page 12: BAAN IV Tools Graphical User Interface (GUI)

1 GUI Developer's Guide

Graphical User Interface (GUI)

1 - 6

1.10.3 Message types (BX/BW only)

Messages can be of one of the following types:

Information Provides information on the results of a command. Doesnot offer the user a choice.

Warning Informs the user of a condition or situation that requires adecision and input to continue. For example, an impendingaction with irreversible consequences.

Critical Informs the user of a serious problem that requiresintervention or correction.

1.11 Form editor

1.11.1 Group box

Fields can be grouped on a form by means of a box. In GUI, these boxesare displayed in such a way that the lines have a shadow whereas inASCII the boxes are displayed without the shadow. To draw these boxes,the <Esc>[G] option is used. In addition, it is possible to display a labelover the top line of the box. For this purpose, the <Ctrl>[Y] option is used.See, for example, the second form of the Maintain Forms(ttadv3100m000) session.

Remarks

•• Do not use these boxes as lines.•• Only use these boxes for single occurrence fields.•• Avoid overlapping boxes.•• Boxes must be clearly separated from boxes.•• Limit the use of boxes.•• Reversed labels may be replaced by group boxes without height.

1.11.2 Buttons

In release 6.11a, the rudimentary labels for ASCII were displayed (see forexample: 1 = Maintain Forms in the Maintain Sessions (ttadv2100m000)session). In GUI, these labels can be replaced by buttons whereas, in

Page 13: BAAN IV Tools Graphical User Interface (GUI)

1 GUI Developer's Guide

Graphical User Interface (GUI)

1 - 7

ASCII, only the form-specific options are displayed as labels, preceded bythe option code.

These buttons can be created as special fields (<Ctrl>[V]). Thedescription of the option is derived from the short description of thestandard option (Maintain Standard Options (ttadv4171m000)) or theform-specific option (Maintain Form-Specific Options (ttadv3111s000)).

1.11.3 Additional space

In the graphical user interface, enums and zoom fields need extra spaceto display the drop-down and zoom symbols. No modifications are neededin multi-occurrence forms, because the remainder of the line can bemoved to the right. This is not possible in single-occurrence forms,because fields are left-aligned or right-aligned. Consequently, the formeditor mandates three additional positions for the drop-down symbol andone additional position for the zoom symbol.

1.11.4 Skip top lines

Top lines that do not contain fields or labels are skipped. The first line,which only contains a special field or label, will be displayed in the headerand the following lines without fields or labels will be skipped. This is doneto save space on VGA screens. Input and display fields in the first threelines from the top should be avoided as much as possible.

1.12 Switch to process

The switch.to.process() and wait.for.switch() functions offer the possibilityto switch between parent processes and activated child processes.Additional control to position forms is exercised by means of thesattr.combined variable.

If a process frequently zooms to a specific zoom process, these functionsrepeatedly avoid the start-up of that zoom process. These functions canalso be used to simultaneously display two sessions. For example, onesession to maintain a record and another to display the context of thatrecord (multi-occurrence).

Normally. a process simply calls zoom.to$(). If zooming to this zoomsession happens frequently, the zoom session must be loaded in andremoved from memory for every zoom.to$. To avoid this, the followingstatement sequences should be included in the program:

The switch.to.process() function sends a signal to a process identified byprocess id (usually a child process created with activate(), or a parentprocess that created this process with activate())and will wait until theother process sends a switch.to.process() to this process.

Page 14: BAAN IV Tools Graphical User Interface (GUI)

1 GUI Developer's Guide

Graphical User Interface (GUI)

1 - 8

wait.for.switch() will wait for another process to call switch.to.process().This function is typically used at the start-up of the zoom process forsynchronization purposes.

If the forms of the two processes should NOT overlap and not re-size tothe full window, another variable should be set in before.program.

before.program:sattr.combined = COMBINED.TOP| the form will be placed at the top of the main windowsattr.combined = COMBINED.BOTTOM| the form will be placed at the bottom of the main window.

The second, optional argument of the switch.to.process() function can beset to the sum of the following values:

•• If the two processes must be of the same size, the valueSWITCH.SAME.SIZE must be added to the flag argument.

•• Switching to another process will also pass the input control to thatprocess. As a result. the current form is set to inactive and the otherform to active. If the focus does not have to be switched to the otherform (i.e. the other process is a display process without interaction),the SWITCH.WITHOUT.INTERACTION flag must be set. This flagshould only be set in the process passing the control to the otherprocess without interaction. For example, proc2 is a single-occurrencesession used to maintain an order line and proc1 is a multi-occurrencesession that displays the other order lines of the same order header. Itis not possible to enter input on the fields of proc1 or to entercommands for proc1. The SWITCH.WITHOUT.INTERACTION flagshould only be set for the switch.to.process call of proc2.

•• The other process should not be stopped by means of the kill()function for benchmarking reasons. If a process has to exit, the normalswitch.to.process() cannot be done. In this situation, theSWITCH.WITHOUT.WAIT flag can be used. This flag will activateboth processes. If this flag is set, all other flags will be ignored.

The following is an example of a new situation for the BAAN IVenvironment:

Page 15: BAAN IV Tools Graphical User Interface (GUI)

1 GUI Developer's Guide

Graphical User Interface (GUI)

1 - 9

The SWITCH.VERTICAL and SWITCH.HORIZONTAL macros have noeffect. For compatibility purposes, they are defined to avoid compilationerrors.

1.13 Mnemonics

Mnemonics can be used to open menu groups from the menu bar and toselect menu items from a menu group. Mnemonics are identified by thefact that the item character is underlined. To start an option withmnemonics, type the <Alt>[underlined character] combination to open amenu group. Then, type the underlined character of the item in the menugroup. By default, the mnemonic character is the first character of theoption. To set the default to another character in the string, this charactershould be preceded by an ampersand (&). This ampersand is removedfrom the string after which the next character is used as the mnemoniccharacter. The menu bar and the mnemonics are maintained by theMaintain Pull-down Menu Data (ttadv4172m000) and Maintain Pull-DownOption Groups (ttadv4176m000) sessions.

1.14 Ellipsis

In GUI, an ellipsis consists of three dots (...) following an option.

Many menu items take effect as soon as they are chosen. If the menuitem is a command that requires additional information to complete its

Parent

declaration: extern long instruction

before.program sattr.combined = COMBINED.BOTTOM

form.1:init.form: child.id = activate( "child") switch.to.process(child.id, SWITCH.WITHOUT.INTERACTION+ SWITCH.SAME.SIZE)choice.X:after.choice: instruction = X switch.to.process(child.id, SWITCH.WITHOUT.INTERACTION+

SWITCH.SAME.SIZE)

choice.end.program:on.choice: instruction = end.program switch.to.process(child.id) wait.for.switch()

Child

declaration: long instruction

before.program: sattr.combined = COMBINED.TOP wait.for.switch()

form.1:init.form: while true import(“instruction”,instruction) if instruction=end.program then switch.to.process(parent,

SWITCH.WITHOUT.WAIT)

endif execute(instruction) switch.to.process(parent) endwhile

Note

Page 16: BAAN IV Tools Graphical User Interface (GUI)

1 GUI Developer's Guide

Graphical User Interface (GUI)

1 - 10

execution, the command is followed by an ellipsis (...). The ellipsis informsthe user that the information is incomplete. When used with a command,it indicates that additional information is needed to execute thatcommand. Such commands usually result in the display of a dialog box.For example, the Find command (in BW) includes an ellipsis because thatcommand remains incomplete until the the key fields have been suppliedor confirmed.

Not every command that produces a dialog box or other secondarywindow should include an ellipsis. For example, an ellipsis should not beincluded in the Compile command (ttadv2130m000) since this commandalready results in an informational window. After the command iscompleted, no further parameters or actions are required to fulfill theintent of the command. Similarly, an ellipsis should not be included in acommand resulting in the display of a message box.

No changes are required for zoom sessions since an ellipsis isautomatically added to these menu items. An ellipsis must be added tothe description of form-specific options if these options are used to zoomto another session.

1.15 Vertical occurrences

Although this type of session is still supported by BAAN IV, it is notpossible to select items.

1.16 Button for cont.process

By default, the text of the button for cont.process contains a shortdescription of the option itself, namely Continue. This default value can beoverruled by another label. First, this label must be created in the MaintainLabels (ttadv1140m000) session. Next, it must be specified in theMaintain Buttons (ttadv3114s000) session which is activated from theMaintain Forms (ttadv3100m000) session.

1.17 Form tabs

The form data now includes an extra field which can be used to specifythe Form Tab label. By default the text of this label is Form n, where n isthe number of the form.

If a session consists of four forms and the fourth form is special form (onlyto be displayed while processing), form tabs must be defined for the firstthree forms only. This can be achieved by setting the max.formtabsvariable to 3. In general, if only the first n forms are to be displayed withform tabs, the max.formtabs variable must be set to n in thebefore.program section:

Page 17: BAAN IV Tools Graphical User Interface (GUI)

1 GUI Developer's Guide

Graphical User Interface (GUI)

1 - 11

before.program:max.formtabs = 3

1.18 Display fields used as labels (BW only)

It may be necessary to define context-sensitive labels. As BAAN Toolsdoes not support this type of label, a display-only field is used to definesuch context-sensitive labels. This may cause problems in a graphicalenvironment, since labels are displayed proportionally and form fields aredisplayed with a fixed font.

To solve this problem, it is now possible to specify that form fields shouldbe displayed with a proportional font.

Display fields that are used as labels can also be used to display unitsbetween brackets. For example:

Length [m ] 100

1.19 Zoom type

The session data now also includes an extra field which can be used tospecify the type of zoom session. The following types are available:

•• Modeless•• Modal child dialog•• Modal dialog•• Modal without title

Page 18: BAAN IV Tools Graphical User Interface (GUI)

1 GUI Developer's Guide

Graphical User Interface (GUI)

1 - 12

1.19.1 Modeless

If the type of the child session is set to Modeless, it will be created as aparallel session. Both parent and child can be modified simultaneously.An example of this type of zoom session is the Query by Form session inwhich a new set of constraints can be sent to the parent session at anytime.

Both sessions have a menu bar and an icon bar. This type of zoomsession cannot be used with sessions using switch.to.process(). Althoughit is possible to switch from one session to another by means of a mouse,the other process will not accept input until a switch.to.process is done inthe previous process.

Page 19: BAAN IV Tools Graphical User Interface (GUI)

1 GUI Developer's Guide

Graphical User Interface (GUI)

1 - 13

1.19.2 Modal child dialog

This type of session will create its own main window and will set the mainwindow of its parent to insensitive. This session must be finished before itis possible to continue the parent session. The main window cannot beminimized or maximized.

Page 20: BAAN IV Tools Graphical User Interface (GUI)

1 GUI Developer's Guide

Graphical User Interface (GUI)

1 - 14

1.19.3 Modal dialog

This type of session is implemented for sessions with simple selections.Since it does not have a menu bar or an icon bar, a limited set ofcommands is available through buttons on the form.

Page 21: BAAN IV Tools Graphical User Interface (GUI)

1 GUI Developer's Guide

Graphical User Interface (GUI)

1 - 15

1.19.4 Modal without title

This type of session is typically used for combined sessions. It will displaya form in the main window of its parent. The child of a combined sessionshould always be of type Modal without title.

WindowHeader

OwnToolbar

ParallelInteraction

Available inBW

Available inBX

Modeless Yes Yes Yes Yes Yes

Modal child dialog Yes Yes No Default No

Modal dialog Yes No No Yes No

Modal without title No No No Yes Default

1.20 Start and end options

If the default start option is get.defaults, the save.defaults option will beexecuted automatically when a session is exited by means ofend.program (the Save and Exit option).

If an exit (abort.program) is initiated and data was changed, a messagewill appear warning the user that the changes that were made will be lost

Page 22: BAAN IV Tools Graphical User Interface (GUI)

1 GUI Developer's Guide

Graphical User Interface (GUI)

1 - 16

and prompting the user to save these changes before the exit commandis executed.

1.21 Required changes in applications

1.21.1 Terms and definitions

Avoid the following words Replace bymark selectunmark unselectview (type 3 form) groupsearch findabort (session) exitabort (action) cancel

1.21.2 Specifying the ordering method in print sessions

In some print sessions, an Order by field is defined in which a numberreferring to an ordering method is entered. These Order by fields must bereplaced by drop-down list boxes (enums).