home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / programs / programming / wimpworks / Apps / !ShowDraw / WWv2Data < prev   
Encoding:
Text File  |  1998-09-03  |  1.5 KB  |  68 lines

  1. # WimpWorks Information File
  2. # WimpWorks © Jaffa Software 1997. All rights reserved.
  3.  
  4. DEF TASKdetails
  5.     Name        ShowDraw
  6.     Purpose        Display Draw files
  7.     Author        © Jaffa Software 1997
  8.     Licence        
  9.     Version        1.00 (15-Dec-1997)
  10.     Compress    False
  11.     Memory        0K
  12.     IconbarSide    Right
  13.     IconbarPriority    &00000000
  14.     IconbarSprite    !showdraw
  15.     IconbarText    
  16. ENDTASK
  17.  
  18. DEF WEMinclude
  19.     Starter Pack
  20. ENDWEM
  21.  
  22. DEF MENUiconMenu%
  23.     ShowDraw
  24.     Info
  25.         S(infoWindow%)
  26.         
  27.     Quit
  28.         
  29.         CLOSEDOWN
  30. ENDMENU
  31.  
  32. DEF SUBR_PROCfile_dragged
  33.     Event    4
  34.     Every    -1
  35. DEF PROCfile_dragged(window%, icon%, file$, type%)
  36.   LOCAL size%
  37.  
  38.   ' Is it a Draw file? If not, then we can't proceed
  39.   IF type%<>&AFF THEN WARNING(TOKEN("NotDraw"),"Message from ShowDraw")
  40.  
  41.   ' If there is already a file open, then close it (see FNwindow_close)
  42.   IF OPENQUERY(display) THEN CLOSEWINDOW(display)
  43.  
  44.   ' Use LOADFILE from the Starter Pack WEM, producing an error if there
  45.   ' is not enough memory available - then find the size of the file, to
  46.   ' pass on to DRAW
  47.   drawMem%=LOADFILE(file$)
  48.   IF drawMem%=-1 THEN WARNING(TOKEN("NoMem"),"Message from ShowDraw")
  49.   SYS "OS_File",17,file$ TO ,,,,size%
  50.  
  51.   ' Display the file in the 'display' and open it
  52.   DRAW(display,0,0,100,100,drawMem%,size%)
  53.   OPENWINDOW(display)
  54. ENDPROC
  55. ENDSUBR
  56.  
  57. DEF SUBR_FNwindow_close
  58.     Event    11
  59.     Every    -1
  60. DEF FNwindow_close(window%)
  61.   ' Should the window be open, clear the window and gives
  62.   ' the memory back to the system
  63.  
  64.   IF window%=display THEN CLWIN(display):RELEASE(drawMem%)
  65. =TRUE
  66. ENDSUBR
  67.  
  68.