LToolbar::Create

#include "ltwrappr.h"

L_INT LToolbar::Create (hwndParent, pszTitle, dwFlags)

Creates a toolbar.

Parameters

HWND hwndParent

Window handle to the toolbar's parent window.

L_TCHAR * pszTitle

Pointer to a null-terminated string to be used as the title for the toolbar window.

L_UINT32 dwFlags

Flags that will indicate the type of the toolbar to be created. Possible values are:

Value Meaning
TOOLBAR_PAINT Creates a paint toolkit toolbar.
TOOLBAR_VECTOR Creates a vector toolkit toolbar.
TOOLBAR_EMPTY Creates an empty toolbar.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

LToolbar::Initialize must be called before calling this function.

The toolbar is created as a child window to the window specified in hwndParent.

Note: The Vector and Paint toolbars are Automation toolbars. When using the Automation C++ Class Library in addition to the Toolbar C++ Class Library, these toolbars automatically handle the buttons and the necessary function calls. If automation is not used, it is the user's responsibility to create buttons, assign ID numbers, process the events, and handle all necessary function calls.

The toolbar contains the following buttons:

Paint Toolbar Buttons

The Paint toolbar contains the following buttons:

Image Description Button ID
image\Apbrush.gif
Paintbrush tool ID_TOOL_PAINT_BRUSH
image\Alinetool.gif
Line shape tool ID_TOOL_PAINT_SHAPE_LINE
image\Arecttool.gif
Rectangle shape tool ID_TOOL_PAINT_SHAPE_RECT
image\RndRctTl.gif
Rounded rectangle shape tool ID_TOOL_PAINT_SHAPE_ROUNDRECT
image\EllipseTl.gif
Ellipse shape tool ID_TOOL_PAINT_SHAPE_ELLIPSE
image\PylgnTool.gif
Polygon shape tool ID_TOOL_PAINT_SHAPE_POLYGON
image\Bezier.gif
Bezier shape tool ID_TOOL_PAINT_SHAPE_BEZIER
image\RectRgn.gif
Region rectangle tool ID_TOOL_PAINT_REGION_RECT
image\RndRctRgn.gif
Rounded rectangle region tool ID_TOOL_PAINT_REGION_ROUNDRECT
image\EllpsRgn.gif
Ellipse region tool ID_TOOL_PAINT_REGION_ELLIPSE
image\PlygnRgn.gif
Polygon region tool ID_TOOL_PAINT_REGION_POLYGON
image\SurfRgn.gif
Surface region tool ID_TOOL_PAINT_REGION_SURFACE
image\BordRgn.gif
Border region tool ID_TOOL_PAINT_REGION_BORDER
image\ColorRgn.gif
Color region tool ID_TOOL_PAINT_REGION_COLOR
image\SurfFill.gif
Surface fill tool ID_TOOL_PAINT_FILL_SURFACE
image\BordFill.gif
Border fill tool ID_TOOL_PAINT_FILL_BORDER
image\ClrRplc.gif
Color replace tool ID_TOOL_PAINT_FILL_COLORREPLACE
image\TextTool.gif
Text tool ID_TOOL_PAINT_TEXT
image\Zoom.gif
Zoom tool ID_TOOL_PAINT_ZOOM
image\BdrClrPkr.gif
Border color picker tool ID_TOOL_PAINT_BORDERCOLORPICKER
image\MovrTool.gif
Mover tool ID_TOOL_PAINT_MOVER

Vector Toolbar Buttons

The vector toolbar contains the following buttons:

Image Description Button ID
image\Neutral.gif
Neutral (No tool selected) ID_TOOL_VECTOR_NONE
image\Select.gif
Select object(s) ID_TOOL_VECTOR_SELECT
image\Vertex.gif
Vertex ID_TOOL_VECTOR_VERTEX
image\Line.gif
Line ID_TOOL_VECTOR_LINE
image\Rectang.gif
Rectangle ID_TOOL_VECTOR_RECTANGLE
image\Polyline.gif
Polyline ID_TOOL_VECTOR_POLYLINE
image\Pbezier.gif
Polybezier ID_TOOL_VECTOR_POLYBEZIER
image\Polygon.gif
Polygon ID_TOOL_VECTOR_POLYGON
image\VEllipse.gif
Ellipse ID_TOOL_VECTOR_ELLIPSE
image\VCircle.gif
Circle ID_TOOL_VECTOR_CIRCLE
image\Varc.gif
Arc ID_TOOL_VECTOR_ARC
image\VText.gif
Text ID_TOOL_VECTOR_TEXT
image\VPie.gif
Pie ID_TOOL_VECTOR_PIE
image\VChord.gif
Chord ID_TOOL_VECTOR_CHORD<
image\VRaster.gif
Raster ID_TOOL_VECTOR_RASTER
image\VRotate.gif
Rotate ID_TOOL_VECTOR_ROTATE
image\VPan.gif
Pan ID_TOOL_VECTOR_PAN

Required DLLs and Libraries

See Also

Functions

Topics

Example

This example will initiate, create a toolbar, set its position and make it visible.

/* Global LEAD toolbar handle */ 
L_INT LToolbar__CreateExample( HWND hWnd, pTOOLBARHANDLE g_pLeadToolbar, LToolbar* tlb) 
 
{ 
   UNREFERENCED_PARAMETER(g_pLeadToolbar); 
   L_INT nRet; 
 
   /* Initiate the toolbar handle */ 
   nRet = tlb->Initialize () ; 
   if(nRet != SUCCESS) 
      return nRet; 
 
    /* Check the validity of the handle */ 
 
    if ( tlb->IsValid () ) 
 
    { 
 
       POINT pt = { 0, 0 } ; 
 
      /* Initiate the point to be used to align the toolbar at the top-left of its owner client area */ 
 
      ::ClientToScreen ( hWnd, &pt ) ; 
 
      /* Create the toolbar  */ 
 
      nRet = tlb->Create (hWnd, TEXT("Tools Window"), TOOLBAR_PAINT ) ; 
      if(nRet != SUCCESS) 
         return nRet; 
 
      /* Set the toolbar position */ 
 
      nRet = tlb->SetPosition (&pt, TOOLBAR_POSITION_TOP | TOOLBAR_POSITION_LEFT ) ; 
      if(nRet != SUCCESS) 
         return nRet; 
 
      /* Show the toolbar */ 
 
      nRet = tlb->SetVisible (TRUE ) ;  
      if(nRet != SUCCESS) 
         return nRet; 
 
    } 
 
   return SUCCESS ; 
 
} 

Help Version 21.0.2021.7.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Toolbar C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.