LAnnToolBar::Create
#include "ltwrappr.h"
virtual HWND LAnnToolBar::Create(hWndParent, pPoint, uAlign, bVisible, uButtons, pButtons)
HWND hWndParent; |
/* handle to the parent window */ |
LPPOINT pPoint; |
/* pointer to the POINT structure */ |
L_UINT uAlign; |
/* constant for the toolbar allignment */ |
L_BOOL bVisible; |
/* flag that indicates whether the toolbar will be visible */ |
L_UINT uButtons; |
/* number of buttons the toolbar will have */ |
pANNBUTTON pButtons; |
/* array of ANNBUTTON structures that contain toolbar button information */ |
Creates an annotation toolbar in the specified window.
Parameter |
Description |
|
hWndParent |
Handle to the parent window. |
|
pPoint |
Pointer to the POINT structure that specifies the position of the new window in the parent window. Coordinates are relative to the parent window. |
|
uAlign |
Value indicating which corner of the toolbar is located at pPoint. One of the following values: |
|
|
ANNTOOLALIGN_LEFT [0x0000] |
|
|
ANNTOOLALIGN_RIGHT [0x0001] |
|
|
must be combined using the bitwise OR with one of these values: |
|
|
ANNTOOLALIGN_TOP [0x0000] |
|
|
ANNTOOLALIGN_BOTTOM [0x0002] |
|
|
For example, ANNTOOLALIGN_LEFT|ANNTOOLALIGN_TOP indicates that pPoint is the top left point of the toolbar. |
|
bVisible |
Flag that indicates whether the toolbar will be visible. Possible values are: |
|
|
Value |
Meaning |
|
TRUE |
Toolbar will be visible. |
|
FALSE |
Toolbar will not be visible. |
uButtons |
Number of buttons that will be in the annotation toolbar. This value is valid only if pButtons is not NULL. |
|
pButtons |
Array of ANNBUTTON structures that contain information about the tool buttons to include in the annotation toolbar. If this is NULL, the default annotation toolbar will be created. |
Returns
>0 |
Handle of the created toolbar. |
=NULL |
An error occurred. Refer to Return Codes. |
Required DLLs and Libraries
LTANN 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: |
|
Topics: |
|
|
|
|
|
|
Example
L_INT LAnnToolBar_CreateExample(HWND hWndParent) { LAnnToolBar LeadAToolbar ; HWND hWnd ; POINT Point ; L_UINT uChecked ; L_INT nRet; if (LeadAToolbar.IsCreated() == FALSE) { Point.x = 10 ; Point.y = 10 ; HWND hWnd = LeadAToolbar.Create(hWndParent,&Point, ANNTOOLALIGN_LEFT | ANNTOOLALIGN_TOP, TRUE) ; if(hWnd == NULL) return ERROR_INVALID_PARAMETER; } hWnd = LeadAToolbar.GetWndHandle(); if (hWnd == NULL) { MessageBox(NULL,TEXT("A ToolBar was not created ..."),TEXT("Notice"),MB_OK) ; return FAILURE; } if (LeadAToolbar.IsButtonVisible(ANNTOOL_LINE) == FALSE) { nRet = LeadAToolbar.SetButtonVisible(ANNTOOL_LINE,TRUE); if(nRet != SUCCESS) return nRet; } uChecked = LeadAToolbar.GetToolChecked() ; if (uChecked != ANNTOOL_LINE) { nRet = LeadAToolbar.SetToolChecked(ANNTOOL_LINE) ; if(nRet != SUCCESS) return nRet; } //... //... LeadAToolbar.Destroy(); return SUCCESS; }