Tools::Init

 

Initialize a tool. 

 

 

Syntax

 

void  Init(

          HWND window=NULL

) ;

 

 

Parameters

 

window

          A pointer to the window where the tool reside.  The first time the function is called, you must provide a value for this parameter.  on subsequent calls, the value may be omitted.

 

 

Return value

 

This method does not return a value.

 

 

Remarks

 

The "Init" method must be the first method called for any tool. The first time it is called for a tool, you must provide a value for the "window" variable. If some of the tool's values have been modified and we need to re-initialize it again (for example, if we change the tool's dimensions), we can omit the window variable.

 

 

Requirements

 

Header:

          TomoVision_Util.hpp

          TomoVision_Tools.hpp

 

Library:

          TomoVision_Util.lib

          TomoVision_Tools.lib

 

 

Example

 

static          Boxs  demo ;

 

extern "C" __declspec(dllexport) int          Ctrl_Resize( HWND wnd, int width, int height )

{

short          p_x, p_y, d_x, d_y ;

 

char   *          Tools_Font_Name =          (char *) Fct_Variable_Value( "$INTERFACE_TOOL_FONT_NAME" ) ;

char   *          Tools_Font_Weigth =          (char *) Fct_Variable_Value( "$INTERFACE_TOOL_FONT_WEIGHT" ) ;

short          Tools_Font_Scale =          (short)  Fct_Variable_Value( "$INTERFACE_TOOL_FONT_SCALE" ) ;

short          Border_Dim =          (short)  Fct_Variable_Value( "$INTERFACE_BORDER_DIM" ) ;

short          Space_Dim =          (short)  Fct_Variable_Value( "$INTERFACE_SPACE_DIM" ) ;

 

p_x = Space_Dim ;

p_y = Space_Dim ;

d_x = width - 2*Space_Dim ;

d_y = 85 ;

 

demo.Flag      = NAME_V_CENT ;

demo.Name      = "Demo" ;

demo.Pos_X     = p_x ;

demo.Pos_Y     = p_y ;

demo.Dim_X     = d_x ;

demo.Dim_Y     = d_y ;

demo.border    = Border_Dim ;

demo.Font_Name   = Tools_Font_Name ;

demo.Font_Weight = Tools_Font_Weigth ;

demo.Font_Scale  = Tools_Font_Scale ;

 

demo.Init( wnd ) ;

 

return( 1 ) ;

}

 

See also