|
// --- Interface tools ---
static Boxs box_box ;
// --- for Brush Selection Tool ---
static Boxs box_brush ;
static Tool_Brush tool_brush ;
// ----------------------------------------------------------------------------
//
// 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_brush.Height() // brush selection
+ 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 ;
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.Init( wnd ) ;
// --- now prepare the tool itself ---
tool_brush.Resize( &box_brush ) ;
}
|