MSM-Workstation
Create the First Set of Windows

Go back to the previous page in this sequence
Go back to the start of this chapter
Go back to the first page of this tutorial

Adjust the size of the labels in the display window

In order to put more appropriate limitations on the size of the labels, a general subroutine will be created in the "common code" section. This subroutine will be called from the "Create action logic" when the various components are created, and from the "resize" logic when the window is re-sized.

Reminder: action logic for the window is accessed by right-clicking on the window, in an area where the window has no component defined.

(Click here to cut and paste this code.)

This subroutine is to be invoked from the Create action logic of the three label components.

For the first label, this means adding the line:

(Click here to cut and paste this code.)

And, similarly, for the other two labels

d labelsiz("Label2","Arial",14)
and
d labelsiz("Label3","Courier",9)

(Click here to cut and paste this code for Label2 and here for Label3.

Since a "resize" event is only trapped at the window level, the calls to this subroutine are entered for all three labels in the "resize action logic" at the window level:

(Click here to cut and paste this code.)

The same action logic will need to be inserted for the events "maximize" (code) and "restore" (code).

A "compile and test" at this point will show that the labels are now showing up appropriately, and are truncated appropriately when the window is re-sized to a smaller size.

And, after resizing

Go on to the next page in this sequence.