home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 24 / CD_ASCQ_24_0995.iso / dos / tools / aurora21 / mouse.aml < prev    next >
Text File  |  1995-08-10  |  5KB  |  233 lines

  1.  
  2. // -------------------------------------------------------------------
  3. // The Aurora Editor v2.1
  4. // Copyright 1993-1995 nuText Systems. All Rights Reserved Worldwide.
  5. //
  6. // Mouse definitions (included by MAIN.AML)
  7. //
  8. // If you have made any changes, save this file and select 'Recompile
  9. // the Editor' <alt f2> from the Set menu. Exit and re-enter the
  10. // editor for your changes to take effect.
  11. // -------------------------------------------------------------------
  12.  
  13. // -------------------------------------------------------------------
  14. //  Edit and File Manager windows
  15. // -------------------------------------------------------------------
  16.  
  17.  
  18.   object edit_fmgr
  19.  
  20.   // left button down
  21.   function  <lbutton>
  22.     if button? 2 then
  23.       queue <chord>
  24.     else
  25.       pass
  26.     end
  27.   end
  28.  
  29.   // right button down
  30.   function  <rbutton>
  31.     if button? 1 then
  32.       queue <chord>
  33.     else
  34.       case getregion
  35.         when 1
  36.           gotomenu
  37.         when 11, 12
  38.           open "*.*"
  39.         otherwise
  40.           pass
  41.       end
  42.     end
  43.   end
  44.  
  45.   // left & right button down (mouse chording)
  46.   function  <chord>
  47.   end
  48.  
  49.   // left button double-click
  50.   function  <ldouble>
  51.  
  52.     case getregion
  53.  
  54.       // background
  55.       when ''
  56.         winlist
  57.  
  58.       // title bars
  59.       when 11, 12
  60.         if max? or min? then
  61.           restore
  62.         else
  63.           maximize
  64.         end
  65.  
  66.       otherwise
  67.         pass
  68.     end
  69.   end
  70.  
  71.  
  72. // -------------------------------------------------------------------
  73. //  Prompts and Edit windows
  74. // -------------------------------------------------------------------
  75.  
  76.   object  prompt
  77.  
  78.   // left button down
  79.   function  <lbutton>
  80.     // pass on to the library (lib.x)
  81.     pass
  82.     // library may switch windows, so check...
  83.     if wintype? "prompt" then
  84.       _lbf =''
  85.       case getregion
  86.         // retrieve tab
  87.         when 14
  88.           askhistory
  89.         // left title
  90.         when 13
  91.           call <lbuttonup>
  92.           close
  93.         // client area
  94.         when 1
  95.           // set flag for mouse marking
  96.           _lbf = 1
  97.           trackmouse
  98.       end
  99.     end
  100.   end
  101.  
  102.   // move mouse
  103.   function  <move>
  104.     if _lbf then
  105.  
  106.       // mouse marking
  107.       if _lbf == 1 then
  108.         destroymark
  109.  
  110.         mark_type = if? (wintype? "edit") (shiftkey? 0Fh) 1h
  111.  
  112.         // get the mark type from the keyboard shift-state or the
  113.         // MouMark config variable
  114.         if not mark_type then
  115.           mark_type = case _MouMark
  116.                         when 'k'  4h
  117.                         when 'l'  8h
  118.                         otherwise 1h
  119.                       end
  120.         end
  121.  
  122.         case mark_type
  123.           when 4h    markcolumn
  124.           when 8h    markline
  125.           otherwise  markstream
  126.         end
  127.         _lbf = 2
  128.       end
  129.       trackmouse
  130.     else
  131.       pass
  132.     end
  133.   end
  134.  
  135.   // left button up
  136.   function  <lbuttonup>
  137.     if _lbf then
  138.       stopmark
  139.       _lbf = ''
  140.     end
  141.     pass
  142.   end
  143.  
  144.  
  145. // -------------------------------------------------------------------
  146. //  Edit windows
  147. // -------------------------------------------------------------------
  148.  
  149.   object edit
  150.  
  151.   // left button double-click
  152.   function  <ldouble>
  153.     case getregion
  154.       when 1
  155.         destroymark
  156.         case _MouMarkD
  157.           when 'k'   markcolumn
  158.           when 's'   markstream
  159.           otherwise  markline
  160.         end
  161.         setobj _lbf 2 "prompt"
  162.       otherwise
  163.         pass
  164.     end
  165.   end
  166.  
  167.   // left button triple-click
  168.   function <ltriple>
  169.     case getregion
  170.       when 1
  171.         markword
  172.     end
  173.   end
  174.  
  175.  
  176. // -------------------------------------------------------------------
  177. //  File Manager windows
  178. // -------------------------------------------------------------------
  179.  
  180.   object  fmgr
  181.  
  182.   // double click to open
  183.   function  <ldouble>
  184.     _lbf = ''
  185.     case getregion
  186.       when 1
  187.         fopen '1'
  188.       otherwise
  189.         pass
  190.     end
  191.   end
  192.  
  193.   // left button down
  194.   function  <lbutton>
  195.     // pass on to the library (lib.x)
  196.     pass
  197.     // library may switch windows, so check...
  198.     if wintype? "fmgr" then
  199.       if getregion == 1 then
  200.         _lbf = 1
  201.         trackmouse
  202.         // toggle file mark if <ctrl> is pressed
  203.         if shiftkey? 4h then
  204.           fmark
  205.         end
  206.       else
  207.         _lbf = ''
  208.       end
  209.     end
  210.   end
  211.  
  212.   // mouse move
  213.   function  <move>
  214.     y = getmousey 'e'
  215.     if _lbf and (button? 1h) then
  216.       if shiftkey? and y <> _lasty then
  217.         fmark
  218.       end
  219.       _lasty = y
  220.       trackmouse
  221.     else
  222.       _lbf = ''
  223.       pass
  224.     end
  225.   end
  226.  
  227.   // left button up
  228.   function  <lbuttonup>
  229.     _lbf = ''
  230.     pass
  231.   end
  232.  
  233.