This method is used to obtain the results of the mouse action.
Syntax
int Read(
void
) ;
Parameters
This method does not have a parameter.
Return value
return the value of the tool when a mouse click is detected. If the click is not in one of the tool's buttons, -1 is returned.
Remarks
The value of "Cur_Value" variable is not updated automatically, You need to assign the value returned by "read" to the Cur_Value parameter manually.
Requirements
Header:
TomoVision_Util.hpp
TomoVision_Tools.hpp
Library:
TomoVision_Util.lib
TomoVision_Tools.lib
Example
|
static Selects demo ;
extern "C" __declspec(dllexport) int Ctrl_Click( HWND wnd, int up_down, short x, short y )
{
// --- We only want the key press, not the key release ---
if ( ! up_down ) {
return( 0 ) ;
}
// ------------------------------------------------
// We received a mouse click, now we try to find in
// which tool the click was. For this we use the
// "select" method.
// ------------------------------------------------
if ( demo.Select( up_down ) ) {
int rep = demo.Read() ;
if ( rep >= 0 ) {
// --- update the value and redraw ---
demo.Cur_Value = rep ;
demo.Adjust() ;
}
return( 1 ) ;
}
return( 0 ) ;
}
|
|
See also