PROGRAM CURSORS!       Example cursor.f

! Code converted using TO_F90 by Alan Miller
! Date: 2001-03-14  Time: 21:40:30

USE JAPI


INTEGER :: frame,menubar,FILE,quit,obj
INTEGER :: cursor,def,cross,hand,move,text,wait
INTEGER :: resize,nr,ner,er,ser,sr,swr,wr,nwr

IF( .NOT. j_start()) THEN
  PRINT*, "can't connect to JAPI server"
  GO TO 20
END IF

frame   = j_frame("Cursor Demo")
menubar = j_menubar(frame)
FILE    = j_menu(menubar,"File")
quit    = j_menuitem(FILE,"Quit")

cursor  = j_menu(menubar,"Cursor")
def     = j_menuitem(cursor,"Default")
cross   = j_menuitem(cursor,"Crosshair")
text    = j_menuitem(cursor,"Text")
wait    = j_menuitem(cursor,"Wait")
hand    = j_menuitem(cursor,"Hand")
move    = j_menuitem(cursor,"Move")

resize  = j_menu(menubar,"Resize")
nr      = j_menuitem(resize,"North Resize")
ner     = j_menuitem(resize,"North East Resize")
er      = j_menuitem(resize,"East Resize")
ser     = j_menuitem(resize,"South East Resize")
sr      = j_menuitem(resize,"South Resize")
swr     = j_menuitem(resize,"South West Resize")
wr      = j_menuitem(resize,"West Resize")
nwr     = j_menuitem(resize,"North West Resize")

CALL j_show(frame)
CALL j_setnamedcolorbg(frame,j_white)

NEXTACTION:DO
      obj=j_nextaction()

IF((obj == quit) .OR. (obj == frame)) EXIT

IF(obj == def)   CALL j_setcursor(frame,j_default_cursor)
IF(obj == cross) CALL j_setcursor(frame,j_crosshair_cursor)
IF(obj == hand)  CALL j_setcursor(frame,j_hand_cursor)
IF(obj == move)  CALL j_setcursor(frame,j_move_cursor)
IF(obj == text)  CALL j_setcursor(frame,j_text_cursor)
IF(obj == wait)  CALL j_setcursor(frame,j_wait_cursor)

IF(obj == nr)    CALL j_setcursor(frame,j_n_resize_cursor)
IF(obj == ner)   CALL j_setcursor(frame,j_ne_resize_cursor)
IF(obj == er)    CALL j_setcursor(frame,j_e_resize_cursor)
IF(obj == ser)   CALL j_setcursor(frame,j_se_resize_cursor)
IF(obj == sr)    CALL j_setcursor(frame,j_s_resize_cursor)
IF(obj == swr)   CALL j_setcursor(frame,j_sw_resize_cursor)
IF(obj == wr)    CALL j_setcursor(frame,j_w_resize_cursor)
IF(obj == nwr)   CALL j_setcursor(frame,j_nw_resize_cursor)

END DO NEXTACTION

20      CONTINUE
CALL j_quit()

END PROGRAM CURSORS
