LToolbar::Create
#include "ltwrappr.h"
L_INT LToolbar::Create (hwndParent, pszTitle, dwFlags)
HWND hwndParent; |
/* window handle */ |
LPCSTR pszTitle; |
/* window title string */ |
L_UINT32 dwFlags; |
/* flag that indicates the toolbar type */ |
Creates a toolbar.
Parameter |
Description |
|
hwndParent |
Window handle to the toolbar's parent window. |
|
pszTitle |
Pointer to a null-terminated string to be used as the title for the toolbar window. |
|
dwFlags |
Flags that will indicate the type of the toolbar to be created. Possible values are: |
|
|
Value |
Meaning |
|
TOOLBAR_PAINT |
Creates a DigitalPaint toolkit toolbar. |
|
TOOLBAR_VECTOR |
Creates a vector toolkit toolbar. |
|
TOOLBAR_EMPTY |
Creates an empty toolbar. |
Returns
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 DigitalPaint toolbars are Automation toolbars. When using the Automation Class Library in addition to the Toolbar Class Library, these toolbars automatically handle the buttons and the necessary function calls. If automation is not used, then it is the user's responsibility to create buttons, assign ID numbers, process the events and handle all necessary function calls. |
The DigitalPaint toolbar contains the following buttons:
Description |
Button ID |
Paintbrush tool |
ID_TOOL_PAINT_BRUSH |
Line shape tool |
ID_TOOL_PAINT_SHAPE_LINE |
Rectangle shape tool |
ID_TOOL_PAINT_SHAPE_RECT |
Rounded rectangle shape tool |
ID_TOOL_PAINT_SHAPE_ROUNDRECT |
Ellipse shape tool |
ID_TOOL_PAINT_SHAPE_ELLIPSE |
Polygon shape tool |
ID_TOOL_PAINT_SHAPE_POLYGON |
Bezier shape tool |
ID_TOOL_PAINT_SHAPE_BEZIER |
Region rectangle tool |
ID_TOOL_PAINT_REGION_RECT |
Rounded rectangle region tool |
ID_TOOL_PAINT_REGION_ROUNDRECT |
Ellipse region tool |
ID_TOOL_PAINT_REGION_ELLIPSE |
Polygon region tool |
ID_TOOL_PAINT_REGION_POLYGON |
Surface region tool |
ID_TOOL_PAINT_REGION_SURFACE |
Border region tool |
ID_TOOL_PAINT_REGION_BORDER |
Color region tool |
ID_TOOL_PAINT_REGION_COLOR |
Surface fill tool |
ID_TOOL_PAINT_FILL_SURFACE |
Border fill tool |
ID_TOOL_PAINT_FILL_BORDER |
Color replace tool |
ID_TOOL_PAINT_FILL_COLORREPLACE |
Text tool |
ID_TOOL_PAINT_TEXT |
Zoom tool |
ID_TOOL_PAINT_ZOOM |
Border color picker tool |
ID_TOOL_PAINT_BORDERCOLORPICKER |
Mover tool |
ID_TOOL_PAINT_MOVER |
The vector toolbar contains the following buttons:
Neutral (No tool selected) |
ID_TOOL_VECTOR_NONE |
Select object(s) |
ID_TOOL_VECTOR_SELECT |
Vertex |
ID_TOOL_VECTOR_VERTEX |
Line |
ID_TOOL_VECTOR_LINE |
Rectangle |
ID_TOOL_VECTOR_RECTANGLE |
Polyline |
ID_TOOL_VECTOR_POLYLINE |
Polybezier |
ID_TOOL_VECTOR_POLYBEZIER |
Polygon |
ID_TOOL_VECTOR_POLYGON |
Ellipse |
ID_TOOL_VECTOR_ELLIPSE |
Circle |
ID_TOOL_VECTOR_CIRCLE |
Arc |
ID_TOOL_VECTOR_ARC |
Text |
ID_TOOL_VECTOR_TEXT |
Pie |
ID_TOOL_VECTOR_PIE |
Chord |
ID_TOOL_VECTOR_CHORD |
Raster |
ID_TOOL_VECTOR_RASTER |
Rotate |
ID_TOOL_VECTOR_ROTATE |
Pan |
ID_TOOL_VECTOR_PAN |
Required DLLs and Libraries
LTTLB
For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.
See Also
Functions: |
LToolbar::Initialize, LToolbar::Free, LToolbar::IsValid, Class Members |
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 ; }