home *** CD-ROM | disk | FTP | other *** search
/ Vectronix 2 / VECTRONIX2.iso / FILES_07 / EZTXPRO2.ZIP / BASIC_C.TUT / TUT33.BAS < prev    next >
BASIC Source File  |  1994-09-09  |  921b  |  43 lines

  1. DEFINT a-z
  2. LIBRARY "gemaes","gemvdi"
  3. '$option k50,y
  4. '$include aes.bh
  5.  
  6. DIM mess(7)    'create message buffer
  7. DIM SHARED junk
  8.  
  9. SUB WinMessage
  10. SHARED mess()
  11. STATIC message
  12. message=mess(0)
  13. SELECT CASE message
  14.     CASE WM_MOVED,WM_SIZED
  15.         junk=FNwind_set(mess(3),5,mess(4),mess(5),mess(6),mess(7))
  16.     CASE WM_REDRAW
  17.         WindowRedraw mess(3),mess(4),mess(5),mess(6),mess(7)
  18. END SELECT
  19. END SUB
  20.  
  21. SUB WindowRedraw(VAL win,VAL rx,VAL ry,VAL rw,VAL rh)
  22. STATIC wx,wy,ww,wh,x,y,w,h
  23. 'obtain work area of window
  24. junk=FNwind_get(win,4,wx,wy,ww,wh)
  25. Intersection rx,ry,rw,rh,wx,wy,ww,wh,x,y,w,h
  26. vs_clip 1,x,y,x+w-1,y+h-1
  27. vsf_color 0
  28. vr_recfl x,y,x+w-1,y+h-1
  29. END SUB
  30.  
  31.  
  32. WINDOW OPEN 1,"TestWindow",50,50,200,100,4095    'open a small window
  33.  
  34. DO
  35.     evnt_mesag VARPTR(mess(0))
  36.     IF mess(0)>=WM_REDRAW and mess(0)<=WM_MOVED THEN
  37.         CALL WinMessage
  38.     END IF
  39. LOOP UNTIL mess(0)=WM_CLOSED
  40.  
  41. WINDOW CLOSE 1    'close the window
  42.  
  43.