Ima_Motion

 

The "Ima_Motion()" function is called whenever the mouse is moved while the cursor is over an image window.

 

Syntax

 

extern "C" __declspec(dllexportint  Ima_Motion(

          HWND wnd,

          SliceO_Window *window

          int up_down,

          short x, short y

)

 

 

Parameters

 

wnd

A handle to the interface's window

 

window

A pointer to the "Window" structure of the image window receiving the action.

 

up_down

is an image of the 3 mouse button states. The lower byte contain a code giving the mouse button action (off, on, pressed or double clicked).  The next byte give the state of each of the 3 keys as on or off. The different values for the variable are:

 

KEY_DBLCLK          3

KEY_PRESS          2

KEY_ON          1

KEY_OFF          0

MOUSE_KEY_LEFT          0x010

MOUSE_KEY_MIDDLE          0x020

MOUSE_KEY_RIGHT          0x040

 

So, for example, if you click on the left mouse button, the value of up_down will be (KEY_PRESS | MOUSE_KEY_LEFT). When you release the button the value will be KEY_OFF.

 

x, y

Horizontal (x) and vertical (y) position of the cursor within the current window. (0,0 at bottom left)

 

 

Return value

 

The function returns "1" if the event has been used.

 

 

Remarks

 

 

Requirements

 

Header:

          sliceO_include.hpp

 

Library:

          sliceO_Structures.lib

 

 

Example

 

Sample "Ima_Motion" function  from the "Edit mode" module.

 

...

 

// ----------------------------------------------------------------------------

//

//          Function:          Ima_Motion

//

//          Parameters:          up_down (int)          state of the mouse buttons

//          Returns:          (int)                    1 if action was used

//

//          This is called each time the cursor is inside an image and the cursor

//          has moved.

//

// ----------------------------------------------------------------------------

extern "C" __declspec(dllexport) int          Ima_Motion( HWND wnd, SliceO_Window *window, int up_down, short x, short y )

{

          // --- there is no significant diff with the "Click" function ---

          return( Ima_Click( wnd, window, up_down, x, y ) ) ;

}

 

...

 

See also