CREATE LABELTEXT Example


Example:

 

*

 

 

.Define the LABELTEXTs, COLORs, BUTTON, and other variables

.

 

 

LTEXT

LABELTEXT

(9)

COLORS

COLOR

(3)

BUTTON1

BUTTON

 

FONT1

FONT

 

RESULT

FORM

2

*

 

 

.Create the supporting objects

.

 

 

  

CREATE

COLORS(1)=*BLUE

  

CREATE

COLORS(2)=*YELLOW

  

CREATE

COLORS(3)=*RED

  

CREATE

FONT1,"Arial",SIZE=12

*

 

 

.Create a variety of LabelText objects

.

 

 

  

CREATE

LTEXT(1)=2:3:20:42,TEXT="LabelText Message 1":

  

  

FONT="SYSTEM(8,BOLD)",BORDER

.

 

 

  

CREATE

LTEXT(2)=5:6:20:43,TEXT="LabelText Message 2":

  

  

FONT="FIXED(10,BOLD)"

.

 

 

  

CREATE

LTEXT(3)=7:8:20:43,TEXT="LabelText Message 3":

  

  

FONT="HELVETICA(12,BOLD)",BGCOLOR=COLORS(2)

.

 

 

  

CREATE

LTEXT(4)=10:11:20:50,TEXT="LabelText Message 4":

  

  

FONT="TIMES(14,ITALIC)",FGCOLOR=COLORS(3)

.

 

 

  

CREATE

LTEXT(5)=14:15:8:50,TEXT="LabelText Message 5":

  

  

FONT="SYSTEM(20,BOLD)",BORDER

.

 

 

  

CREATE

LTEXT(6)=2:5:50:67,TEXT="Long LabelText Message 6"::

  

  

"that WordWrap.":

  

  

FONT="SYSTEM(8,BOLD)",BORDER,WORDWRAP=1

.

 

 

  

SETPROP

FONT1,UNDERLINE=1

  

CREATE

LTEXT(7)=7:8:50:79,TEXT="LabelText Message Underlined":

  

  

FONT=FONT1

.

 

 

  

SETPROP

FONT1,UNDERLINE=0,STRIKE=1

  

CREATE

LTEXT(8)=9:10:50:79,TEXT="LabelText Message Strike Thru":

  

  

FONT=FONT1

.

 

 

  

SETPROP

FONT1,STRIKE=0,ANGLE=3500

  

CREATE

LTEXT(9)=12:15:50:79,TEXT="LabelText Message Angle":

  

  

FONT=FONT1

.

 

 

  

CREATE

BUTTON1=23:24:35:42,"Exit"

*

 

 

.Activate All of the LabelText Objects and the Button

.

 

 

  

ACTIVATE

LTEXT // All LABELTEXT Objects

  

ACTIVATE

BUTTON1,EXIT,RESULT

*

 

 

.Wait for an Event to Occur

.

 

 

  

LOOP

 

  

  EVENTWAIT

 

  

REPEAT

 

*

 

 

.Exit Button Selected

.

 

 

EXIT

 

 

  

STOP

 

 

This example creates a number of LABELTEXT objects with differing properties. Note that all of the LABELTEXT objects are activated using a single ACTIVATE statement. When the Exit BUTTON is clicked, the program terminates.

 



PL/B Language Reference CREATE ICON Examples CREATE LINE Example