LAnnToolBar::Create

Summary

Creates an annotation toolbar in the specified window.

Syntax

#include "ltwrappr.h"

virtual HWND LAnnToolBar::Create(hWndParent, pPoint, uAlign, bVisible, uButtons=NULL, pButtons=NULL)

Parameters

HWND hWndParent

Handle to the parent window.

LPPOINT 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.

L_UINT uAlign

Value indicating which corner of the toolbar is located at pPoint. One of the following values:

must be combined using the bitwise OR with one of these values:

For example, ANNTOOLALIGN_LEFT | ANNTOOLALIGN_TOP indicates that pPoint is the top left point of the toolbar.

L_BOOL 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.

L_UINT uButtons

Number of buttons that will be in the annotation toolbar. This value is valid only if pButtons is not NULL.

pANNBUTTON 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

Value Meaning
>0 Handle of the created toolbar.
=NULL An error occurred. Refer to Return Codes.

Required DLLs and Libraries

Platforms

Win32, x64.

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; 
} 
Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.