home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 3 / goldfish_volume_3.bin / files / util / edit / polyed / macros / tutorial / windowtest.ped < prev   
Encoding:
Text File  |  1995-04-30  |  1.7 KB  |  59 lines

  1. /*
  2. ** $VER: windowtest.ped 1.0 (28.4.95) written by Robert Brandner
  3. **
  4. ** Minimizes the size of all windows of the current project
  5. **
  6. */
  7.  
  8. OPTIONS RESULTS
  9.  
  10. OPTIONS FAILAT 11                           /* ignore warnings          */
  11. SIGNAL ON SYNTAX                            /* ensure clean exit        */
  12. SIGNAL ON FAILURE
  13. SIGNAL ON BREAK_C                            /* no label->syntax->exit    */
  14.  
  15. if (LEFT(ADDRESS(), 6) ~= "POLYED") then do
  16.     if SHOW("Ports", "POLYED.1") then
  17.         address 'POLYED.1'
  18.     else do
  19.         say "PolyEd is not running!"
  20.         exit
  21.     end
  22. end
  23.  
  24. 'LOCKGUI'
  25.  
  26. /*----- begin of custom code area --------------------------------------*/
  27.  
  28. /* get name of current project and a list of all windows
  29. */
  30. 'GETATTR APPLICATION FIELD CURRENTPROJECT'
  31. currentproj = RESULT
  32. 'GETATTR WINDOWS STEM W.'
  33.  
  34. /* for each window, we get the name of the project it belongs to,
  35. ** and check if that is the current one. If so, we zoom it.
  36. */
  37. do i=0 to W.WINDOWS.COUNT-1
  38.     'GETATTR' WINDOW '"'W.WINDOWS.i'"' STEM W2.
  39.     if W2.PROJECT == currentproj then do
  40.         'SETATTR APPLICATION FIELD CURRENTWINDOW' NEWVALUE '"'W.WINDOWS.i'"'
  41.         'ZOOMWINDOW'
  42.     end
  43. end i
  44.  
  45. /*----- end of custom code area ----------------------------------------*/
  46.  
  47. 'UNLOCKGUI'
  48. EXIT                                        /* clean exit                */
  49.  
  50. SYNTAX:                                     /* ARexx error...           */
  51.  
  52. say "Error line" SIGL ":" ERRORTEXT(RC)     /* report it...             */
  53. 'UNLOCKGUI'                                 /* Unlock GUI!              */
  54. EXIT                                        /* exit                     */
  55.  
  56. FAILURE:
  57. 'UNLOCKGUI'                                 /* Unlock GUI!              */
  58. EXIT                                        /* exit                     */
  59.