SETMODE MCURSOR Example


Example:

 

*

 

 

.Define the Objects and Variables

.

 

 

WHITE

COLOR

 

CLIST

DATALIST

 

EXIT

BUTTON

 

RESULT

FORM

1

*

 

 

.Ready the Screen

.

 

 

  

DISPLAY

*P9:5,"Select a Cursor Style:";

*

.Create a Color and a Data List

.

 

 

  

CREATE

WHITE=*WHITE

  

CREATE

CLIST=5:10:33:47,BGCOLOR=WHITE

*

 

 

.Insert the Cursor Types into the Data List

.

 

 

  

INSERTITEM

CLIST,9999," Arrow"

  

INSERTITEM

CLIST,9999," Cross"

  

INSERTITEM

CLIST,9999," I Beam"

  

INSERTITEM

CLIST,9999," Plus"

  

INSERTITEM

CLIST,9999," Wait"

*

 

 

.Select the Default Arrow Datalist Item and Activate the Datalist

.

 

 

  

SETITEM

CLIST,0,1

  

ACTIVATE

CLIST,CLISTR,RESULT

*

 

 

.Create and Activate the Exit Button

.

 

 

  

CREATE

EXIT=17:18:35:45,"E&xit"

  

ACTIVATE

EXIT,EXITR,RESULT

*

 

 

.Wait for an Event to Occur

.

 

 

  

LOOP

 

  

  WAITEVENT

 

  

REPEAT

 

*

 

 

.A Datalist Click Occurred - Switch to the Requested Cursor Style

.

 

 

CLISTR

BRANCH

RESULT TO C1,C2,C3,C4,C5

.

 

 

C1

SETMODE

*MCURSOR=*ARROW

  

RETURN

 

.

 

 

C2

SETMODE

*MCURSOR=*CROSS

  

RETURN

 

.

 

 

C3

SETMODE

*MCURSOR=*IBEAM

  

RETURN

 

.

 

 

C4

SETMODE

*MCURSOR=*PLUS

  

RETURN

 

.

 

 

C5

SETMODE

*MCURSOR=*WAIT

  

RETURN

 

*

 

 

.Exit the Program

.

 

 

EXITR

 

 

  

STOP

 

 

This program displays a datalist containing the various styles of mouse cursors. Upon selecting a style from the list, the cursor is changed.

 



PL/B Language Reference SETMODE Example SETPROP Examples