home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional Developers Kit 1992 November / Disc01 / Disc01.mdf / prodtool / epm / e_macros / mouse.e < prev    next >
Encoding:
Text File  |  1992-08-11  |  18.1 KB  |  550 lines

  1. compile if EVERSION < 5
  2.    *** Error:  This file supports EPM only, not earlier versions of E.
  3. compile endif
  4.  
  5. compile if not defined(SMALL)  -- If SMALL not defined, then being separately compiled
  6.    include 'stdconst.e'
  7.    include 'colors.e'
  8.    tryinclude 'MYCNF.E'        -- Include the user's configuration customizations.
  9. const
  10.  compile if not defined(WANT_CUA_MARKING)
  11.    WANT_CUA_MARKING = 0
  12.  compile endif
  13.  compile if not defined(WANT_STREAM_MODE)
  14.    WANT_STREAM_MODE = 0
  15.  compile endif
  16.  compile if not defined(NLS_LANGUAGE)
  17.    NLS_LANGUAGE = 'ENGLISH'
  18.  compile endif
  19.  compile if not defined(WANT_KEYWORD_HELP)
  20.    WANT_KEYWORD_HELP = 0
  21.  compile endif
  22.  include NLS_LANGUAGE'.e'
  23. compile endif
  24.  
  25. const
  26. compile if not defined(EPM_POINTER)
  27.  compile if EVERSION < 5.50
  28.    EPM_POINTER = SYSTEM_POINTER    -- AVIO version gets arrow pointer
  29.  compile else
  30.    EPM_POINTER = TEXT_POINTER      -- GPI version gets text pointer
  31.  compile endif
  32. compile endif
  33. compile if not defined(LOCAL_MOUSE_SUPPORT)
  34.  const LOCAL_MOUSE_SUPPORT = 0
  35. compile endif
  36. compile if not defined(TOP_OF_FILE_VALID)
  37.    TOP_OF_FILE_VALID = 1
  38. compile endif
  39.  
  40.  
  41. const
  42.   BlankMouseHandler = "BlankMouseHandler"
  43.   TransparentMouseHandler = "TransparentMouseHandler"
  44.  
  45. define
  46. compile if EVERSION < 5.50
  47.    CHARG_MARK =  'CHAR'
  48.    BLOCKG_MARK = 'BLOCK'
  49. compile else                -- New mark types
  50.    CHARG_MARK =  'CHARG'
  51.    BLOCKG_MARK = 'BLOCKG'
  52. compile endif
  53.  
  54. compile if EVERSION >= 5.20
  55. defproc prestore_pos2(save_pos)
  56.    parse value save_pos with svline svcol svsx svsy
  57.    compile if EVERSION >= 5.50
  58.       .lineg = min(svline, .last);                       -- set .line
  59.    compile else
  60.       min(svline, .last);                       -- set .line
  61.    compile endif
  62.    .col = svcol;
  63.    .scrollx = svsx;
  64.    compile if EVERSION >= 5.50
  65.       .cursoryg= svsy;
  66.    compile else
  67.       .scrolly = svsy;
  68.    compile endif
  69.  
  70. defproc psave_pos2(var save_pos)
  71.    compile if EVERSION >= 5.50
  72.       save_pos=.line .col .scrollx .cursoryg
  73.    compile else
  74.       save_pos=.line .col .scrollx .scrolly
  75.    compile endif
  76. compile endif
  77.  
  78. defproc MouseLineColOff(var MouseLine, var MouseCol, var MouseOff, minline)
  79.                         -- MIN = 0 for positioning, 1 for marking.
  80.    xxx = .mousex
  81.    yyy = .mousey
  82.  
  83.    -- saying 5.21, below, but not sure if it will work for that.
  84.    --    it will work for 5.50.
  85.  
  86.    compile if EVERSION >= 5.21
  87.       --call messagenwait("xxx1="xxx "yyy1="yyy);
  88.       map_point 5, xxx, yyy, off, comment;  -- map screen to line
  89.       --call messagenwait("doc xxx2="xxx "yyy2="yyy);
  90.    compile else
  91.       --call messagenwait("xxx1="xxx "yyy1="yyy);
  92.       map_point 1, xxx, yyy, off, comment;  -- map screen to doc
  93.       --call messagenwait("doc xxx2="xxx "yyy2="yyy);
  94.       map_point 2, xxx, yyy, off, comment;  -- map doc to line/col/offset
  95.       --call messagenwait("line="xxx "col="yyy "off="off);
  96.    compile endif
  97.    MouseLine = min(max(xxx, minline), .last)
  98. compile if EVERSION >= 5.50  -- can go to MAXCOL+1 for GPI-style marking
  99.    MouseCol  = min(max(yyy, 1), MAXCOL + (rightstr(arg(5),1)='G' and minline))
  100. compile else
  101.    MouseCol  = min(max(yyy, 1), MAXCOL)
  102. compile endif
  103.    MouseOff  = off
  104.  
  105. defproc SetMouseSet(IsGlobal, NewMSName)
  106.    universal GMousePrefix
  107.    universal LMousePrefix
  108.    universal EPM_utility_array_ID
  109.    if IsGlobal then
  110.       GMousePrefix = NewMSName"."
  111. compile if LOCAL_MOUSE_SUPPORT
  112.    else
  113.       LMousePrefix = NewMSName"."
  114.       -- Remember Local MouseSet
  115.       getfileid ThisFile;
  116.       do_array 2, EPM_utility_array_ID, "LocalMausSet."ThisFile, NewMSName
  117. compile endif
  118.    endif
  119.  
  120. compile if 0  -- Now in SELECT.E, only if LOCAL_MOUSE_SUPPORT = 1
  121. defselect
  122.    universal LMousePrefix
  123.    universal EPM_utility_array_ID
  124.    getfileid ThisFile
  125.    OldRC = Rc
  126.    rc = get_array_value(EPM_utility_array_ID, "LocalMausSet."ThisFile, NewMSName)
  127.    if RC then
  128.       if rc=-330 then
  129.          -- no mouseset bound to file yet, assume blank.
  130.          LMousePrefix = TransparentMouseHandler"."
  131.       else
  132.          call messagenwait('RC='RC)
  133.       endif
  134.       RC = OldRC
  135.    else
  136.       LMousePrefix = NewMSName"."
  137.    endif
  138. compile endif
  139.  
  140. defc processmouse
  141.    universal EPM_utility_array_ID
  142.    universal GMousePrefix
  143.    universal LMousePrefix
  144.    if LMousePrefix<>BlankMouseHandler"." then
  145.       OldRc = rc
  146. compile if LOCAL_MOUSE_SUPPORT
  147.       rc = get_array_value(EPM_utility_array_ID, LMousePrefix||arg(1), CommandString)
  148.       if not rc then
  149.          -- Found it.
  150.          Rc = oldRC
  151.          if CommandString<>'' then
  152.             CommandString
  153.             return
  154.          endif
  155.       else
  156.          if rc<>-330 then
  157.             sayerror UNKNOWN_MOUSE_ERROR__MSG rc
  158.             rc = OldRc
  159.             return
  160.          endif
  161.          -- rc==-330 (no local handler found), now try to find a global one.
  162.       endif
  163. compile endif
  164.       if GMousePrefix<>BlankMouseHandler"." then
  165.          rc = get_array_value(EPM_utility_array_ID, GMousePrefix||arg(1), CommandString)
  166.          if not rc then
  167.             -- Found it.
  168.             Rc = oldRC
  169.             if CommandString<>'' then
  170.                CommandString
  171.             endif
  172.             return
  173.          else
  174.             if rc<>-330 then
  175.                sayerror UNKNOWN_MOUSE_ERROR__MSG rc
  176.             else
  177.                -- nothing assigned to that action
  178.             endif
  179.             rc = OldRc
  180.             return
  181.          endif
  182.       endif
  183.    endif
  184.  
  185.  
  186. defproc register_mousehandler(IsGlobal, event, mcommand)
  187.    universal EPM_utility_array_ID
  188.    universal GMousePrefix
  189.    universal LMousePrefix
  190.    if IsGlobal then
  191.       MousePrefix = GMousePrefix
  192.    else
  193. compile if LOCAL_MOUSE_SUPPORT
  194.       if (LMousePrefix=BlankMouseHandler".") or
  195.          (LMousePrefix=TransparentMouseHandler".") then
  196.          -- can't assign to that mouse handler.
  197. compile endif
  198.          return
  199. compile if LOCAL_MOUSE_SUPPORT
  200.       endif
  201.       MousePrefix = LMousePrefix
  202. compile endif
  203.    endif
  204.    do_array 2, EPM_utility_array_ID, MousePrefix||event, mcommand   -- assign
  205.  
  206. defc MH_gotoposition
  207. compile if WANT_STREAM_MODE = 'SWITCH'
  208.    universal stream_mode
  209. compile endif
  210.    -- this procedure moves the cursor to the current mouse location.
  211. ;;
  212. ;;  Old way
  213. ;;
  214. ;;   .cursory = .mousey
  215. ;;   .cursorx = .mousex
  216. ;;
  217. compile if TOP_OF_FILE_VALID
  218.    call MouseLineColOff(MouseLine, MouseCol, MouseOff, 0)
  219. compile else
  220.    call MouseLineColOff(MouseLine, MouseCol, MouseOff, 1)
  221. compile endif
  222. compile if EVERSION >= 5.20
  223.    oldsx = .scrollx;
  224.  compile if EVERSION >= 5.50
  225.    .lineg = MouseLine
  226.  compile else
  227.    oldsy = .scrolly;
  228.    MouseLine
  229.  compile endif
  230. compile else
  231.    MouseLine
  232. compile endif
  233.    .col  = MouseCol
  234.    while MouseOff<0 do
  235.       left
  236.       MouseOff = MouseOff + 1
  237.    endwhile
  238.    while MouseOff>0 do
  239.       right
  240.       MouseOff = MouseOff - 1
  241.    endwhile
  242. compile if WANT_STREAM_MODE
  243.  compile if WANT_STREAM_MODE = 'SWITCH'
  244.    if stream_mode then
  245.  compile endif
  246.    if .col > length(textline(.line)) then
  247.       end_line
  248.    endif
  249.  compile if WANT_STREAM_MODE = 'SWITCH'
  250.    endif
  251.  compile endif
  252. compile endif
  253. compile if EVERSION >= 5.20
  254.    .scrollx = oldsx;
  255.    compile if EVERSION >= 5.50
  256.    compile else
  257.       .scrolly = oldsy;
  258.    compile endif
  259. compile endif
  260.  
  261. defc MH_begin_mark
  262.    universal BeginningLineOfDrag
  263.    universal BeginningColOfDrag
  264. compile if WANT_CUA_MARKING = 'SWITCH'
  265.    universal CUA_marking_switch
  266. compile endif
  267. compile if 0
  268.    mt = upcase(arg(1))
  269.    if marktype() then
  270.       getfileid curfileid
  271.       getmark markfirstline,marklastline,markfirstcol,marklastcol,markfileid
  272.       if marktype() <> mt or markfileid <> curfileid then
  273.          sayerror -279  -- sayerror('Text already marked')
  274.          return
  275.       endif
  276.    endif
  277. compile elseif WANT_CUA_MARKING = 1
  278.    unmark
  279.    'ClearSharBuff'       /* Remove Content in EPM shared text buffer */
  280. compile else
  281.  compile if WANT_CUA_MARKING = 'SWITCH'
  282.    if CUA_marking_switch then
  283.       unmark
  284.       'ClearSharBuff'       /* Remove Content in EPM shared text buffer */
  285.    endif
  286.  compile endif
  287.    if marktype() then
  288.       sayerror-279  --  sayerror('Text already marked')
  289.       return
  290.    endif
  291. compile endif
  292.    call MouseLineColOff(BeginningLineOfDrag, BeginningColOfDrag, MouseOff, 1, arg(1));
  293.    call register_mousehandler(1, 'ENDDRAG',    'MH_end_mark '||arg(1))  -- shifted
  294.    call register_mousehandler(1, 'CANCELDRAG', 'MH_cancel_mark')  -- shifted
  295.    if upcase(arg(1))='LINE' then
  296.       .DragStyle = 2
  297.    elseif upcase(arg(1))=BLOCKG_MARK then
  298.       .DragStyle = 1
  299.    elseif upcase(arg(1))=CHARG_MARK then
  300.       .DragStyle = 3
  301.    endif
  302.    mouse_setpointer MARK_POINTER
  303. compile if DRAGCOLOR
  304.    .DragColor = DRAGCOLOR
  305. compile else
  306.    .DragColor = .markcolor
  307. compile endif
  308.  
  309. defc MH_end_mark
  310.    universal BeginningLineOfDrag
  311.    universal BeginningColOfDrag
  312. compile if WANT_CUA_MARKING = 'SWITCH'
  313.    universal CUA_marking_switch
  314. compile endif
  315.    call MouseLineColOff(endingline, endingcol, MouseOff, 1, arg(1));
  316.    unmark
  317.    getfileid CurrentFile
  318.    call pset_mark(BeginningLineOfDrag, endingline,
  319.                   BeginningColOfDrag,  max(endingcol,1),  arg(1), CurrentFile)
  320.    mouse_setpointer EPM_POINTER
  321. compile if WANT_CUA_MARKING
  322.  compile if WANT_CUA_MARKING = 'SWITCH'
  323.    if CUA_marking_switch then
  324.  compile endif
  325.    getmark  firstline,lastline,firstcol,lastcol,fileid
  326.    if marktype()<>'LINE' then
  327.       .col=lastcol
  328.    endif
  329.    if lastline<>.line then
  330.       if lastline>.line then '+'lastline-.line; else lastline-.line; endif
  331.    endif
  332.    'MH_gotoposition'
  333.  compile if WANT_CUA_MARKING = 'SWITCH'
  334.    endif
  335.  compile endif
  336. compile endif
  337. ;  refresh                                          ???
  338.    call register_mousehandler(1, 'ENDDRAG', ' ')
  339.    call register_mousehandler(1, 'CANCELDRAG', ' ')
  340.    /* Copy the marked area to the clipboard in case we want to copy it */
  341.    /* into a different editor window.                                  */
  342.    'Copy2SharBuff'
  343.  
  344. defc MH_cancel_mark
  345.    mouse_setpointer EPM_POINTER
  346.    call register_mousehandler(1, 'ENDDRAG', ' ')
  347.    call register_mousehandler(1, 'CANCELDRAG', ' ')
  348.  
  349. defc markword
  350.    'MH_gotoposition'
  351.    unmark
  352.    call pmark_word()
  353.  
  354. defc marktoken
  355.    'MH_gotoposition'
  356.    if find_token(startcol, endcol) then
  357.       getfileid fid
  358.       call pset_mark(.line, .line, startcol, endcol, 'BLOCK', fid)
  359.    endif
  360.  
  361. defc findword
  362.    'MH_gotoposition'
  363.    if find_token(startcol, endcol) then
  364.       .col = endcol
  365.       'l '\1 || substr(textline(.line), startcol, (endcol-startcol)+1)
  366.    endif
  367.  
  368. compile if WANT_CUA_MARKING
  369. defc MH_singleclick
  370.    unmark
  371.    'ClearSharBuff'       /* Remove Content in EPM shared text buffer */
  372.    'MH_gotoposition'
  373.  
  374. defc MH_dblclick
  375.    unmark
  376.    if .line then
  377. ;;    call pmark_word()  -- pmark_word doesn't include white space; the following does:
  378.       call pbegin_word()
  379.       mark_block
  380.       startcol = .col
  381.       tab_word
  382.       if .col<length(textline(.line)) then .col = .col - 1; endif
  383.       mark_block
  384.       .col = startcol
  385.    endif
  386.    'Copy2SharBuff'       /* Copy mark to shared text buffer */
  387.  
  388. compile endif
  389.  
  390. defc MH_double  -- Used to be just 'dupmark U', but now overloaded in a DIR listing:
  391.    if upcase(subword(.filename,1,2)) = '.DOS DIR' then
  392.       executekey a_1  -- For simplicity, assume user hasn't redefined this key:
  393.    else
  394.       unmark
  395.       'ClearSharBuff'
  396.    endif
  397.  
  398. defc MH_shiftclick
  399.    if marktype() then
  400.       getmark markfirstline,marklastline,markfirstcol,marklastcol,markfileid
  401.    else
  402.       markfileid=''
  403.    endif
  404.    unmark
  405.    getfileid CurrentFile
  406.    if CurrentFile<>markfileid then
  407.       markfirstline=.line; markfirstcol=.col
  408.    elseif markfirstline=.line & markfirstcol=.col then
  409.       markfirstline=marklastline; markfirstcol=marklastcol
  410.    endif
  411.    call MouseLineColOff(MouseLine, MouseCol, MouseOff, 1, arg(1))
  412.    call pset_mark(markfirstline, MouseLine, markfirstcol, MouseCol, 'CHAR', CurrentFile)
  413.    'MH_gotoposition'
  414.    'Copy2SharBuff'
  415.  
  416. definit
  417.    universal EPM_utility_array_ID, MouseStyle
  418. compile if (EVERSION < 5.21 & EPM_POINTER<>SYSTEM_POINTER) | (EVERSION >= 5.21 & EPM_POINTER<>TEXT_POINTER)
  419.    mouse_setpointer EPM_POINTER
  420. compile endif
  421.    -- set initial mousesets
  422.    SetMouseSet(1, "BaseMouseHandlers") -- default global mouseset
  423. compile if LOCAL_MOUSE_SUPPORT
  424.    SetMouseSet(0, TransparentMouseHandler)  -- default local mouseset is blank.
  425. compile endif
  426. compile if WANT_CUA_MARKING = 'SWITCH'
  427.    call MH_SET_Mouse()
  428.  
  429. defproc MH_set_mouse
  430.    universal CUA_marking_switch, MouseStyle
  431.  
  432.  
  433.    if CUA_marking_switch then
  434. compile endif
  435.  
  436.       -- 1 == shift, 2 = control, 4 = alt.
  437. compile if WANT_CUA_MARKING
  438.    call register_mousehandler(1, '1 CLICK 0',     'MH_singleclick')
  439.    call register_mousehandler(1, '1 CLICK 1',     'MH_shiftclick')
  440.    call register_mousehandler(1, '1 CLICK 2',     'MH_singleclick')
  441.    call register_mousehandler(1, '1 CLICK 3',     'MH_shiftclick')
  442.    call register_mousehandler(1, '1 CLICK 4',     'MH_singleclick')
  443.    call register_mousehandler(1, '1 CLICK 5',     'MH_shiftclick')
  444.    call register_mousehandler(1, '1 CLICK 6',     'MH_singleclick')
  445.    call register_mousehandler(1, '1 CLICK 7',     'MH_shiftclick')
  446.    call register_mousehandler(1, '1 SECONDCLK 0', 'MH_dblclick')
  447.    call register_mousehandler(1, '1 SECONDCLK 2', 'MH_dblclick')
  448.    call register_mousehandler(1, '1 SECONDCLK 4', 'MH_dblclick')
  449.    call register_mousehandler(1, '1 SECONDCLK 6', 'MH_dblclick')
  450.    call register_mousehandler(1, '1 BEGINDRAG 0', 'MH_begin_mark' CHARG_MARK)
  451.    call register_mousehandler(1, '1 BEGINDRAG 1', 'MH_begin_mark' CHARG_MARK)
  452.    call register_mousehandler(1, '1 BEGINDRAG 2', 'MH_begin_mark' CHARG_MARK)
  453.    call register_mousehandler(1, '1 BEGINDRAG 3', 'MH_begin_mark' CHARG_MARK)
  454.    call register_mousehandler(1, '1 BEGINDRAG 4', 'MH_begin_mark' CHARG_MARK)
  455.    call register_mousehandler(1, '1 BEGINDRAG 5', 'MH_begin_mark' CHARG_MARK)
  456.    call register_mousehandler(1, '1 BEGINDRAG 6', 'MH_begin_mark' CHARG_MARK)
  457.    call register_mousehandler(1, '1 BEGINDRAG 7', 'MH_begin_mark' CHARG_MARK)
  458. compile endif
  459.  
  460. compile if WANT_CUA_MARKING = 'SWITCH'
  461.       call register_mousehandler(1, '2 BEGINDRAG 0', '')  -- Delete the defs
  462.  compile if EVERSION < 5.50
  463.       call register_mousehandler(1, '2 BEGINDRAG 2', '')
  464.  compile endif
  465.       call register_mousehandler(1, '3 BEGINDRAG 0', '')  -- from the other style.
  466.       call register_mousehandler(1, '2 SECONDCLK 0', '')
  467.       call register_mousehandler(1, '2 SECONDCLK 2', '')
  468.       call register_mousehandler(1, '2 SECONDCLK 1', '')
  469.    else
  470.  compile if EVERSION < 5.50
  471.       call register_mousehandler(1, '1 CLICK 2',     '')  -- (ditto)
  472.  compile endif
  473.       call register_mousehandler(1, '1 CLICK 4',     '')
  474.       call register_mousehandler(1, '1 CLICK 6',     '')
  475.       call register_mousehandler(1, '1 SECONDCLK 2', '')
  476.       call register_mousehandler(1, '1 SECONDCLK 4', '')
  477.       call register_mousehandler(1, '1 SECONDCLK 6', '')
  478.       call register_mousehandler(1, '1 BEGINDRAG 1', '')
  479.       call register_mousehandler(1, '1 BEGINDRAG 3', '')
  480.       call register_mousehandler(1, '1 BEGINDRAG 4', '')
  481.       call register_mousehandler(1, '1 BEGINDRAG 5', '')
  482.       call register_mousehandler(1, '1 BEGINDRAG 6', '')
  483.       call register_mousehandler(1, '1 BEGINDRAG 7', '')
  484. compile endif
  485.  
  486. compile if WANT_CUA_MARKING = 'SWITCH' or WANT_CUA_MARKING = 0
  487.    call register_mousehandler(1, '1 CLICK 0',     'MH_gotoposition')
  488.    call register_mousehandler(1, '1 CLICK 1',     'MH_shiftclick')
  489.    if MouseStyle = 1 then but_1 = BLOCKG_MARK; c_but_1 = CHARG_MARK
  490.                      else but_1 = CHARG_MARK;  c_but_1 = BLOCKG_MARK
  491.    endif
  492.    call register_mousehandler(1, '1 BEGINDRAG 0', 'MH_begin_mark 'but_1)
  493.    call register_mousehandler(1, '1 BEGINDRAG 2', 'MH_begin_mark 'c_but_1)
  494.  compile if EVERSION < 5.50
  495.    call register_mousehandler(1, '2 BEGINDRAG 0', 'MH_begin_mark LINE')
  496.  compile else
  497.    call register_mousehandler(1, '2 BEGINDRAG 0', 'MH_begin_drag_2 0')
  498.    call register_mousehandler(1, '2 BEGINDRAG 2', 'MH_begin_drag_2 1')
  499.    call register_mousehandler(1, '1 CLICK 2',     'MH_gotoposition')
  500.  compile endif
  501.    call register_mousehandler(1, '3 BEGINDRAG 0', 'MH_begin_mark 'c_but_1)
  502.    call register_mousehandler(1, '1 SECONDCLK 0', 'MH_double')
  503.    call register_mousehandler(1, '2 SECONDCLK 0', 'markword')
  504.    call register_mousehandler(1, '2 SECONDCLK 2', 'marktoken')
  505.    call register_mousehandler(1, '2 SECONDCLK 1', 'findword')
  506.  compile if WANT_KEYWORD_HELP
  507.    call register_mousehandler(1, '1 SECONDCLK 2', 'kwhelp')
  508.  compile endif
  509. compile endif
  510.  
  511. compile if WANT_CUA_MARKING = 'SWITCH'
  512.    endif
  513. compile endif
  514.  
  515. compile if EVERSION >= 5.50
  516. defc MH_begin_drag_2  -- Determine if a click is within the selected area
  517.  compile if WANT_CUA_MARKING = 'SWITCH'
  518.    universal CUA_marking_switch
  519.  compile endif
  520.    -- First we query the position of the mouse
  521.    call MouseLineColOff(MouseLine, MouseCol, MouseOff, 0)
  522.    -- Now determine if the mouse is in the selected text area.
  523.    mt=leftstr(marktype(),1)
  524.    inselection=0
  525.    if mt then
  526.       getfileid curfileid
  527.       getmark markfirstline,marklastline,markfirstcol,marklastcol,markfileid
  528.       if  (markfileid == curfileid) and
  529.           (MouseLine >= markfirstline) and (MouseLine <= marklastline) then
  530.  
  531.           -- assert:  at this point the only case where the text is outside
  532.           --          the selected area is on a single line char mark and a
  533.           --          block mark.  Any place else is a valid selection
  534.           if not ((mt=='C' & (markfirstline=MouseLine & MouseCol < markfirstcol) or (marklastline=MouseLine & MouseCol > marklastcol)) or
  535.                   (mt=='B' & (MouseCol < markfirstcol or MouseCol > marklastcol)) ) then
  536.              inselection=1
  537.           endif
  538.       endif
  539.    endif
  540.    if inselection then
  541.       call WindowMessage(0,  getpminfo(EPMINFO_EDITCLIENT),
  542.                          5434,               -- EPM_DRAGDROP_DIRECTMINP
  543.                          arg(1),
  544.                          0)
  545.    else
  546.       'MH_begin_mark LINE'
  547.    endif
  548.  
  549. compile endif
  550.