xxx::Resize

 

Tool_Brush::Resize

Tool_Tag::Resize

Tool_Histo::Resize

Tool_Propagate::Resize

Tool_DB_Class::Resize

Tool_DB_File::Resize

 

This method is used to update the size of the tool.

 

 

Syntax

 

int  Resize(

          Boxs *box

) ;

 

 

Parameters

 

box

          The Pox_X, Pos_Y, Dim_X and Dim_Y, border, color, the font parameters and wnd parameters of the Boxs class will be used in scaling and positioning the tool.

 

 

Return value

 

This method returns 0 if an error occurred, 1 otherwise.

 

 

Remarks

 

The method is usually called from within your Ctrl_Resize() function. The parameter "box" define a bounding box for the tool.

 

 

Requirements

 

Header:

          TomoVision_Util.hpp

          TomoVision_Tools.hpp

          Tool_work.hpp

 

Library:

          TomoVision_Util.lib

          TomoVision_Tools.lib

          SliceO_Tools.lib

 

 

Example

 

// --- Interface tools ---

static          Boxs          box_box ;

 

// --- for Brush Selection Tool ---

static          Boxs          box_brush ;

static          Tool_Brush          tool_brush ;

 

...

 

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

{

short          p_x, p_y, d_x, d_y ;

 

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

// In the "Config" menu, the user can change the interface's size.

// This action change a number of variables that are used to compute

// the size of the tool in the intearface.  We now load a few of these

// variables and use them to compute the dimension of our interface tools.

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

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          Space_Dim =              (short)  Fct_Variable_Value( "$INTERFACE_SPACE_DIM" ) ;

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

 

          ...

 

          // ===========================================================================

          // --- Brush_Selection Tool

          // ===========================================================================

          p_x = box_box.Pos_X + Space_Dim ;

          p_y = box_box.Pos_Y + Space_Dim ;

          d_x = box_box.Dim_X - 2*Space_Dim ;

          d_y = tool_brush.Height() ;

 

          // --- The tool will be inside this box ---

          box_brush.Flag = OUTIL_EMPTY ;

          box_brush.Pos_X = p_x ;

          box_brush.Pos_Y = p_y ;

          box_brush.Dim_X = d_x ;

          box_brush.Dim_Y = d_y ;

          box_brush.color = box_box.color ;

          box_brush.border = Border_Dim;

          box_brush.Font_Name   = Tools_Font_Name ;

          box_brush.Font_Weight = Tools_Font_Weigth ;

          box_brush.Font_Scale  = Tools_Font_Scale ;

          box_brush.Init( wnd ) ;

 

          // --- now prepare the tool itself ---

          tool_brush.Resize( &box_brush ) ;

 

          return( 1 ) ;

}

 

 

See also