Lugaru's Epsilon
Programmer's
Editor

Context:
Epsilon User's Manual and Reference
   Primitives and EEL Subroutines
      Input Primitives
         Keys
         The Mouse
            Mouse Cursors
            Mouse Subroutines
            The Scroll Bar
            Mouse Panning
         Window Events
         . . .

Previous   Up    Next
Mouse Cursors  Primitives and EEL Subroutines   The Scroll Bar


Epsilon User's Manual and Reference > Primitives and EEL Subroutines > Input Primitives > The Mouse >

Mouse Subroutines

window int (*mouse_handler)();
allow_mouse_switching(int nwin)    // mouse.e subr.
buffer char mouse_dbl_selects;
char run_by_mouse;
char show_mouse_choices;

The mouse.e and menu.e files define the commands and functions normally bound to the mouse buttons. The functions that handle button clicks examine the window-specific function pointer mouse_handler so that you can easily provide special functions for clicks in a particular window. By default, the variable contains 0 in each window, so that Epsilon does no special processing. Set the variable to point to a function, and Epsilon will call it whenever the user pushes a mouse button and the mouse cursor is over the indicated window. The function receives one parameter, the window handle of the specified window. It can return nonzero to prevent the normal functioning of the button, or zero to let the function proceed.

The allow_mouse_switching( ) subroutine is a mouse_handler function. Normally, when a pop-up window is on the screen, Epsilon doesn't let the user simply switch to another window. Depending on the context, Epsilon either removes the pop-up window and then switches to the new window, or signals an error and remains in the pop-up window. If you set the mouse_handler variable in a particular window to the allow_mouse_switching( ) subroutine, Epsilon will permit switching to that window if the user clicks in it, without deleting any pop-up window.

The buffer-specific mouse_dbl_selects variable controls what double-clicking with a mouse button does. By default the variable is zero, and double-clicking selects words. If the variable is nonzero, Epsilon instead runs the command bound to the <Newline> key.

The run_by_mouse variable is normally zero. Epsilon sets it to one while it runs a command that was selected via a pull-down menu or using the tool bar. Commands can use this variable to behave differently in this case. For example, the subroutine that provides completion automatically produces a list of choices to choose from, when run via the mouse. It does this if the MUST_MATCH flag (see Completion Internals) indicates that the user must always pick one of the choices (instead of typing in a different selection), or if the show-mouse-choices variable is nonzero.



Previous   Up    Next
Mouse Cursors  Primitives and EEL Subroutines   The Scroll Bar


Lugaru Copyright (C) 1984, 2012 Lugaru Software Ltd. All Rights Reserved.