home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / TextEditors&Viewers / Texteditors / FFRED10.LHA / fpl / SoftEdit.FPL < prev    next >
Encoding:
Text File  |  1994-10-23  |  2.3 KB  |  89 lines

  1. export int MouseMark(int mode)
  2. {
  3.    int x, y;
  4.  
  5.    x = ReadInfo("mouse_x");
  6.    y = ReadInfo("mouse_y");
  7.    SetInfo(-1, "cursor_marking", 0);
  8.    if (mode)
  9.    {
  10.       BlockMark(0);
  11.       PlaceCursor(x, y);
  12.    }
  13.    else if (x >= 0 && y >= 0)
  14.    {
  15.       BlockMark(1);
  16.       PlaceCursor(x, y);
  17.    }
  18. }
  19.  
  20. export int MouseMark2()
  21. {
  22.    SetInfo(-1, "cursor_marking", 0);
  23.    BlockMark(1);
  24.    PlaceCursor(ReadInfo("mouse_x"), ReadInfo("mouse_y"));
  25.    BlockMark(1);
  26. }
  27.  
  28. export int MouseMarkDouble()
  29. {
  30.    SetInfo(-1, "cursor_marking", 1);
  31.    CursorRightWord();
  32.    CursorLeftWord();
  33.    BlockMark(1);
  34.    CursorRightWord();
  35.    BlockMark(1);
  36.    SetInfo(-1, "cursor_marking", 0);
  37. }
  38.  
  39. export int MM_BlockHook()
  40. {
  41.    if (!ReadInfo("cursor_marking"))
  42.    {
  43.       BlockMark(0);
  44.       return (0);
  45.    }
  46. }
  47.  
  48. export int MM_OutputHook()
  49. {
  50.    BlockDelete();
  51.    return(0);
  52. }
  53.  
  54. /* Mouse Drag assigns */
  55. AssignKey("MouseMark(1);", "MouseLeft", "block_exist");
  56. AssignKey("MouseMark(0);", "MouseLeftDrag");
  57. AssignKey("BlockMark(2);", "MouseLeftUp", "block_exist");
  58.  
  59. /* Doubleclick marks a word */
  60. AssignKey("MouseMarkDouble();", "MouseLeftDouble");
  61.  
  62. /* Mouse buttons for cut, copy & paste */
  63. AssignKey("BlockPaste();", "ctrl MouseLeft");
  64. AssignKey("BlockCopy();", "MouseRight");
  65. AssignKey("BlockCut();", "ctrl MouseRight");
  66.  
  67. /* Shift + Left button marks from cursor */
  68. AssignKey("MouseMark2();", "Shift MouseLeft");
  69.  
  70. /* Output clears the marked block */
  71. Hook("Output", "MM_OutputHook();", "block_exist");
  72.  
  73. /* Cursor movements removes the block marking */
  74. Hook("CursorUp", "MM_BlockHook();", "block_exist");
  75. Hook("CursorDown", "MM_BlockHook();", "block_exist");
  76. Hook("CursorLeft", "MM_BlockHook();", "block_exist");
  77. Hook("CursorRight", "MM_BlockHook();", "block_exist");
  78. Hook("CursorLeftWord", "MM_BlockHook();", "block_exist");
  79. Hook("CursorRightWord", "MM_BlockHook();", "block_exist");
  80. Hook("PageUp", "MM_BlockHook();", "block_exist");
  81. Hook("PageDown", "MM_BlockHook();", "block_exist");
  82. Hook("Backspace", "MM_OutputHook(); return(1);", "block_exist");
  83. Hook("Delete", "MM_OutputHook(); return(1);", "block_exist");
  84.  
  85. /* This hack makes it possible for us to mark with Amiga b as usual */
  86. ConstructInfo("cursor_marking", "", "", "LBH", "", 0, 1);
  87. SetInfo(-2, "cursor_marking", 0);
  88. AssignKey("SetInfo(-1, \"cursor_marking\", 1); BlockMark();", "Amiga b");
  89.