|
// --- Interface tools ---
static Boxs box_box ;
// --- for TAG Selection Tool ---
static Boxs box_tag ;
static Tool_Tag tool_tag( TOOL_TAG_LOCK_AS_ENABLE ) ;
// ----------------------------------------------------------------------------
//
// Function: Ctrl_Register
//
// ----------------------------------------------------------------------------
extern "C" __declspec(dllexport) int Ctrl_Register( unsigned short *mode )
{
...
short Title_Dim = (short) Fct_Variable_Value( "$INTERFACE_TITLE_DIM_BIG" ) ;
short Space_Dim = (short) Fct_Variable_Value( "$INTERFACE_SPACE_DIM" ) ;
// --- compute the height of the interface ---
short height = Title_Dim // title at top of tool
+ tool_tag.Height(4) // tag selection tool (4 buttons high)
+ Space_Dim ; // space at the bottom
return( height ) ;
}
...
// ----------------------------------------------------------------------------
//
// Function: Ctrl_Resize
//
// ----------------------------------------------------------------------------
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 Space_Dim = (short) Fct_Variable_Value( "$INTERFACE_SPACE_DIM" ) ;
short Border_Dim = (short) Fct_Variable_Value( "$INTERFACE_BORDER_DIM" ) ;
...
// ===========================================================================
// --- TAG 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_tag.Height(4) ;
// --- The tool will be inside this box ---
box_tag.Flag = OUTIL_NO_3D ;
box_tag.Pos_X = p_x ;
box_tag.Pos_Y = p_y ;
box_tag.Dim_X = d_x ;
box_tag.Dim_Y = d_y ;
box_tag.color = box_box.color ;
box_tag.border = Border_Dim;
box_tag.Font_Name = Tools_Font_Name ;
box_tag.Font_Weight = Tools_Font_Weigth ;
box_tag.Font_Scale = Tools_Font_Scale ; // + 1 ;
box_tag.Init( wnd ) ;
box_tag.Flag = OUTIL_EMPTY ;
// --- now prepare the tool itself ---
tool_tag.Resize( &box_tag ) ;
return( 1 ) ;
}
|