Object Instructions


PLBCMP GUI Only

 

A number of object variables have been added to PL/B to support the Graphical User Interface. Accordingly, several new verbs have been added to manipulate these various objects.

 

ACTIVATE

Make an object visible and active.

CHECKITEM

Set or clear a check mark beside a menu item.

CHECKPROP

Determine if a property is valid for an object.

CREATE

Create the data structures and load the data for an object.

DEACTIVATE

Take an object out of active mode.

DELETEITEM

Delete an item from an object.

DESTROY

Remove an object from the screen.

DISABLEITEM

Disable an object item allowing it to still be seen.

DRAGITEM

Enable or disable an object's drag and drop capabilities.

ENABLEITEM

Enable an object item.

EVENTREGISTER

Register an event for an object.

EVENTSEND

Trigger an event for an object.

FORMLOAD

Load and activate a PLFORM.

GETFOCUS

Obtain the identification number of the object that currently has focus.

GETITEM

Obtain the name or value of an object item.

GETPROP

Obtain the various properties of an object.

INSERTITEM

Add a new item to an object.

LISTCNT

Count objects in a COLLECTION.

LISTDEL

Delete an object from a COLLECTION.

LISTGET

Retrieve an object from a COLLECTION.

LISTINS

Insert an object into a COLLECTION.

SETFOCUS

Change the focus to another object.

SETITEM

Change the name or value of an object item.

SETPROP

Change the various properties of an object.

 

The following is the minimum number of instructions required for object variables:

 

 

CREATE

{object}...

;Allocates memory

 

...

 

 

 

ACTIVATE

{object}...

;Displays on screen

 

...

 

 

 

DEACTIVATE

{object}

;Takes off screen

 

...

 

 

 

DESTROY

{object}

;Deallocates memory

 

The other instructions change the state of an active object or to add or delete items in an object.

 

Following on the next page is a simple program to create a single button, a menu item and a submenu item. A check mark is placed beside the menu items when they are selected and the check mark is deleted when they are selected again.

 

*

 

 

. Sample PL/B program to demonstrate SUBMENU usage.

.

 

 

HALT

BUTTON

 

MENU1

MENU

 

MENUOPT

FORM

1(3)

SUBMNU

SUBMENU

 

SUBMNUD

INIT

"/SSubOptions;":

 

 

"/1Test1;":

 

 

"/2Test2;":

 

 

"/3Test3"

RESULT

FORM

2

INS

INTEGER

1,"1"

*

 

 

. Initialize the Window

.

 

 

 

DISPLAY

*BGCOLOR=*CYAN,*FGCOLOR=*BLACK:

 

 

*ES,*P33:1,*BLACK,"SubMenu Test"

*

 

 

. Create HALT button selection to Exit in a nice mode.

.

 

 

 

CREATE

HALT=9:10:35:45,"HALT"

 

ACTIVATE

HALT,EXIT,RESULT

*

 

 

. Create a MENU item named "Menu".

.

 

 

 

CREATE

MENU1,"/OOptions;/DDisplay;/LList;/NNone"

 

ACTIVATE

MENU1,MENUEXC,RESULT

*

 

 

. Create SUBMENU

.

 

 

 

CREATE

SUBMNU,SUBMNUD,MENU1,2

 

ACTIVATE

SUBMNU,SUBEXC,RESULT

*

 

 

. This is the primary event processing point.

.

 

 

 

LOOP

 

 

EVENTWAIT

 

 

REPEAT

 

*

 

 

. Exit Point. This routine is called when

. the STOP button is clicked on.

.

 

 

EXIT

STOP

 

*

 

 

. MENU1 items processed. Toggle check mark

. beside menu item selected.

.

 

 

MENUEXC

 

 

 

IF

( MENUOPT(RESULT) = 1 )

 

CHECKITEM

MENU1,RESULT,OFF

 

CLEAR

MENUOPT(RESULT)

 

ELSE

 

 

CHECKITEM

MENU1,RESULT,ON

 

MOVE

"1",MENUOPT(RESULT)

 

ENDIF

 

 

RETURN

 

*

 

 

. SUBMNU items processed.

.

 

 

SUBEXC

 

 

 

...

 

 

RETURN

 

 

 



PL/B Language Reference ACTIVATE