home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d5xx / d592 / ezasm.lha / EZAsm / scrwin.s < prev    next >
Text File  |  1992-01-31  |  2KB  |  140 lines

  1.  
  2.  
  3. * Opens a window on a screen, and prints a message in it
  4.  
  5.  
  6.  
  7.  
  8. LONG    _IntuitionBase _GfxBase
  9.  
  10. LONG    Screen Window IMClass MsgSave
  11. WORD    IMCode
  12.  
  13.  
  14.  
  15.     _IntuitionBase = OpenLibrary( "intuition.library" 0 )
  16.     beq    Exit
  17.  
  18.     _GfxBase = OpenLibrary( "graphics.library" 0 )
  19.     beq    Exit
  20.  
  21.     a1 = #NewScr
  22.     a0 = _GfxBase
  23.     6(a1) = 216(a0) w    ;NewScr.Height = GfxBase.NormalDisplayRows
  24.  
  25.     Screen = OpenScreen( #NewScr )
  26.     beq    Exit
  27.  
  28.     a0 = #NewWin
  29.     30(a0) = Screen        ;NewWin.Screen = Screen
  30.  
  31.     Window = OpenWindow( #NewWin )
  32.     beq    Exit
  33.  
  34.     a0 = Window
  35.     Move( 50(a0) 20 30 )
  36.  
  37.     a0 = Window
  38.     Text( 50(a0) "I hope you enjoy using EZAsm!" 29 )
  39.     
  40.  
  41. *   Check for messages..
  42.  
  43.  
  44. CheckMsg
  45.  
  46.     a1 = Window
  47.     WaitPort( 86(a1) )    ;Window.UserPort
  48.  
  49. GetMessage
  50.  
  51.     a1 = Window
  52.     MsgSave = GetMsg( 86(a1) )
  53.     beq    CheckMsg
  54.  
  55. *   Got something..
  56.  
  57.     a1 = MsgSave
  58.     IMClass = 20(a1)    ;save Class
  59.     IMCode = 24(a1)        ;save Code
  60.  
  61.     ReplyMsg( d0 )
  62.  
  63.     IMClass = 512 Exit    ;CLOSEWINDOW?
  64.  
  65.     jmp    GetMessage
  66.  
  67.  
  68. Exit
  69.  
  70.     Window != 0 {
  71.  
  72.         Forbid( )    ;( stop messages )
  73.  
  74. FreeLoop    a1 = Window
  75.         GetMsg( 86(a1) )
  76.  
  77.         d0 != 0 {
  78.             ReplyMsg( d0 )
  79.             jmp    FreeLoop
  80.         }
  81.  
  82.         CloseWindow( Window )
  83.         Permit( )
  84.     }
  85.  
  86.     Screen != 0 {
  87.         CloseScreen( Screen )
  88.     }
  89.  
  90.     _GfxBase != 0 {
  91.         CloseLibrary( _GfxBase )
  92.     }
  93.  
  94.     _IntuitionBase != 0 {
  95.         CloseLibrary( _IntuitionBase )
  96.     }
  97.  
  98.  
  99.  
  100.     END
  101.  
  102.  
  103.  
  104.  
  105.  
  106. NewScr    ds.w    0        ;( word align )
  107.     dc.w    0,0,640,0,2    ;LeftEdge,TopEdge,Width,Height,Depth
  108.     dc.b    -1,-1        ;DetailPen,BlockPen
  109.     dc.w    $8000,$000f    ;ViewModes,Type
  110.     dc.l    0,0        ;Font,DefaultTitle
  111.     dc.l    0        ;Gadgets
  112.     dc.l    0        ;CustomBitMap
  113.  
  114.  
  115. *  ViewModes = HIRES
  116.  
  117. *  Type      = CUSTOMSCREEN
  118.  
  119.  
  120.  
  121. NewWin    ds.w    0        ;( word align )
  122.     dc.w    20,20,400,150    ;LeftEdge,TopEdge,Width,Height    
  123.     dc.b    -1,-1        ;DetailPen,BlockPen
  124.     dc.l    $00000200    ;IDCMPFlags
  125.     dc.l    $0002100f    ;Flags
  126.     dc.l    0,0,0        ;FirstGadget,CheckMark,Title
  127.     dc.l    0,0        ;Screen,BitMap
  128.     dc.w    400,75        ;MinWidth,MinHeight
  129.     dc.w    $ffff,$ffff    ;MaxWidth,MaxHeight
  130.     dc.w    $000f        ;Type
  131.  
  132.  
  133. *  IDCMPFlags = CLOSEWINDOW
  134.  
  135. *  Flags      = WINDOWCLOSE | SMART_REFRESH | ACTIVATE | WINDOWDRAG |
  136. *        WINDOWDEPTH | WINDOWSIZING | NOCAREREFRESH
  137.  
  138. *  Type       = CUSTOMSCREEN
  139.  
  140.