REF XVEDMOUSE John Gibson Jan 1997 COPYRIGHT University of Sussex 1997. All Rights Reserved. >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<<< >>>>>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<<< XVED STANDARD >>>>>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<<< MOUSE PROCEDURES >>>>>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<<< >>>>>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< CONTENTS - (Use g to access required sections) 1 Introduction 2 Moving the Text Cursor 3 Window Scrolling 4 Selecting Text 5 Marking Ranges 6 Miscellaneous --------------- 1 Introduction --------------- The procedures in this file implement the standard XVed mouse button functions: their names (without the vedmouse__ prefix) may be used in vedset mouse statements. See Mouse Handling in REF * XVED. (Note that these procedures pick up information about the mouse event for which they are called from the vector in the variable * vvedmousedata.) ------------------------- 2 Moving the Text Cursor ------------------------- vedmouse__point() [procedure] Moves the text cursor to the pointer row/column. vedmouse__drag() [procedure] Makes the pointer 'drag' the text cursor around the window; dragging off the screen in any direction will cause the Ved buffer to scroll in that direction. (Should be attached to a drag event, with vedmouse__end_drag attached to the corresponding dragRelease.) vedmouse__end_drag() [procedure] Ends a dragging sequence initiated by vedmouse__drag. (Normally attached to a dragRelease event.) ------------------- 3 Window Scrolling ------------------- vedmouse__scroll() [procedure] vedmouse__hscroll() [procedure] These procedures cause the window to scroll vertically (vedmouse__scroll) or horizontally (vedmouse__hscroll) by an amount proportional to the movement of the pointer in that direction. (That is, for vedmouse__scroll, pointer moved down = scroll up, pointer moved up = scroll down, and for vedmouse__hscroll, pointer moved left = scroll right, pointer moved right = scroll left.) In all cases, the text cursor remains in the same position relative to window. (Should be attached to a drag event, with vedmouse__end_scroll attached to the corresponding dragRelease.) vedmouse__end_scroll() [procedure] Ends a scrolling sequence initiated by vedmouse__scroll or vedmouse__hscroll. (Normally attached to a dragRelease event.) ----------------- 4 Selecting Text ----------------- The current selection is the value of * vvedclipboard. vedmouse__select() [procedure] Initiates or continues a selection sequence, that is, makes the current selection be all text between the start pointer position (i.e. where the selection sequence was started) and its current position. (Should be attached to a drag event, with vedmouse__end_select attached to the corresponding dragRelease.) vedmouse__adjust() [procedure] If there is no selection in the current file, same as vedmouse__select. Otherwise, extends the current selection to include all text up to the the pointer position (and thereafter behaves the same as vedmouse__select). (Should be attached to a drag event, with vedmouse__end_select attached to the corresponding dragRelease. Can also be concatenated with vedmouse__end_select and the two together attached to e.g. a click event to extend the current selection to the pointer position.) vedmouse__end_select() [procedure] Ends a selection sequence initiated by vedmouse__select or vedmouse__adjust. (Normally attached to a dragRelease event.) vedmouse__select_character() [procedure] vedmouse__select_word() [procedure] vedmouse__select_line() [procedure] vedmouse__select_sentence() [procedure] vedmouse__select_procedure() [procedure] vedmouse__select_range() [procedure] vedmouse__select_paragraph() [procedure] vedmouse__select_window() [procedure] vedmouse__select_file() [procedure] vedmouse__select_toendfile() [procedure] vedmouse__select_tostartfile() [procedure] Procedures that set the current selection to be the corresponding piece of text indicated by the pointer position. vedmouse__paste() [procedure] Pastes the current selection in at the current text cursor position. ----------------- 5 Marking Ranges ----------------- vedmouse__mark_range() [procedure] Initiates or continues a range-marking sequence, that is, makes the current Ved marked range be all lines between the start pointer position (i.e. where the sequence was started) and its current position. (Should be attached to a drag event, with vedmouse__end_range attached to the corresponding dragRelease.) vedmouse__adjust_range() [procedure] If there is no marked range in the current file, same as vedmouse__mark_range. Otherwise, extends the current marked range to include all lines up to the the pointer position (and thereafter behaves the same as vedmouse__mark_range). (Should be attached to a drag event, with vedmouse__end_range attached to the corresponding dragRelease. Can also be concatenated with vedmouse__end_range and the two together attached to e.g. a click event to extend the current marked range to the pointer position.) vedmouse__end_range() [procedure] Ends a range-marking sequence initiated by vedmouse__mark_range or vedmouse__adjust_range. (Normally attached to a dragRelease event.) vedmouse__mark_lo() [procedure] vedmouse__mark_hi() [procedure] vedmouse__mark_line() [procedure] vedmouse__mark_procedure() [procedure] vedmouse__mark_paragraph() [procedure] vedmouse__mark_window() [procedure] vedmouse__mark_file() [procedure] vedmouse__mark_toendfile() [procedure] vedmouse__mark_tostartfile() [procedure] Procedures that set the Ved marked range to be the corresponding piece of text indicated by the pointer position. ---------------- 6 Miscellaneous ---------------- vedmouse__set_left_margin() [procedure] vedmouse__set_right_margin() [procedure] These procedures set the Ved left and right margins to the column indicated by the pointer position. vedmouse__menu() [procedure] Pops up the XVed popup menu. (Note that this must be attached to a hold event.) vedmouse__do_text_action() [procedure] Calls * ved_do_text_action on the window line and column indicated by the pointer position. Note that this will do something only if the pointer is in active text containing a text action or a "*" documentation reference. Otherwise, * xvedeventhandled is not set true, and the next mouse handler for the event (if any) will be called. (This, for example, allows the behaviour of single-clicking button 1 in the standard setup, namely execute a text action if there is one, or set the text cursor position otherwise,) --- C.x/x/ved/ref/xvedmouse --- Copyright University of Sussex 1997. All rights reserved.