L_AnnSetAutoText

#include "l_bitmap.h"

L_LTANN_API L_INT L_AnnSetAutoText(hObject, uItem, pText)

Sets the character string for a menu or dialog box item associated with automated annotations.

Parameters

HANNOBJECT hObject

Handle to the annotation automation object.

L_UINT uItem

Constant that specifies the menu or dialog box item, which appears when the user presses the right mouse button. For lists of constants and their default values, refer to the following:

L_TCHAR *pText

Character string to use for the menu or dialog box item.

Returns

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

Comments

To retrieve the character string for a menu item or dialog box item, use L_AnnGetAutoTextLen to determine the length of the string and to allocate a buffer of appropriate size. Then call L_AnnGetAutoText to retrieve the string.

When you call L_AnnSetAutoText, if you pass an empty string, the menu item defined by uItem will be disabled and removed from the automation menu. To re-enable the menu item, call L_AnnSetAutoText and pass a valid string.

If hObject is NULL, the automation strings are changed for all the automation objects that will be created from this point on. It also changes the strings for the automation objects that have not overwritten the specified string.

If hObject is not NULL, the string is overwritten only for the specified automation object. Some programs create a new automation object each time a file is opened. This is especially true for MDI applications. In this case, the string is set only for the current file. If you want this string to be set for all files, you must set the string each time you create a new automation object, or call L_AnnSetAutoText with hObject set to NULL.

To reset a string used in the annotation toolbar menus, you must call L_AnnSetAutoText with hObject sett to NULL, since the annotation toolbar is not tied to a specific automation object.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

This example changes the text for selecting the line style.

L_INT AnnSetAutoTextExample(HANNOBJECT hAutoObject)/* Automation object */ 
{ 
   L_INT nRet; 
   nRet = L_AnnSetAutoText(hAutoObject, ANNAUTOTEXT_LINE_SOLID     , TEXT("Solid line")); 
   if(nRet != SUCCESS) 
      return nRet; 
   nRet = L_AnnSetAutoText(hAutoObject, ANNAUTOTEXT_LINE_DASH      , TEXT("Dash (_ _ _ _)")); 
   if(nRet != SUCCESS) 
      return nRet; 
   nRet = L_AnnSetAutoText(hAutoObject, ANNAUTOTEXT_LINE_DOT       , TEXT("Dot (. . . .)")); 
   if(nRet != SUCCESS) 
      return nRet; 
   nRet = L_AnnSetAutoText(hAutoObject, ANNAUTOTEXT_LINE_DASHDOT   , TEXT("Dash dot (_._._)")); 
   if(nRet != SUCCESS) 
      return nRet; 
   nRet = L_AnnSetAutoText(hAutoObject, ANNAUTOTEXT_LINE_DASHDOTDOT, TEXT("Dash dot dot (_.._.._)")); 
   if(nRet != SUCCESS) 
      return nRet; 
   nRet = L_AnnSetAutoText(hAutoObject, ANNAUTOTEXT_LINE_NULL      , TEXT("Invisible line")); 
   if(nRet != SUCCESS) 
      return nRet; 
   return SUCCESS; 
} 

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

LEADTOOLS Raster Imaging C API Help