CREATE MREGION Example


Example:

 

*

 

 

.Define the MREGION, BUTTON, and other variables

.

 

 

MREGION1

MREGION

 

GB1

GROUPBOX

 

BUTTON1

BUTTON

 

RESULT

FORM

2

*

 

 

.Create the Objects

.

 

 

  

CREATE

MREGION1=4:12:26:54,ZORDER=20

  

CREATE

GB1=3:12:25:55:

  

  

TITLE="Click Inside Here":

  

  

FONT=">Arial(10,BOLD)":

  

  

STYLE=3DOUT,ZORDER=10

  

CREATE

BUTTON1=16:17:35:42,"Exit"

*

 

 

.Activate the Objects

.

 

 

  

ACTIVATE

GB1

  

ACTIVATE

MREGION1,ACTION,RESULT

  

ACTIVATE

BUTTON1,EXIT,RESULT

*

 

 

.Wait for an Event to Occur

.

 

 

  

LOOP

 

  

  EVENTWAIT

 

  

REPEAT

 

*

 

 

.Clicked Inside Mouse Region

.

 

 

ACTION

 

 

  

DISPLAY

*P25:14,"You clicked in the Box!":

  

  

*W,*H=25,*EL;

  

RETURN

 

*

 

 

.Exit Button Selected

.

 

 

EXIT

 

 

  

STOP

 

 

This CREATE MREGION instruction creates a box on the screen. A GROUPBOX is created as a visual aid. The assignment of the ZORDER places the MREGION above the GROUPBOX. A mouse click in this box causes display of a message. Clicking the Exit button exits the program.

 

 



PL/B Language Reference CREATE MOVIE Example CREATE PANEL Example