L_AnnSetAutoText

#include "l_bitmap.h"

L_LTANN_API L_INT L_AnnSetAutoText(hObject, uItem, pText)

HANNOBJECT hObject;

/* handle to an automation object */

L_UINT uItem;

/* constant for the specified item */

L_TCHAR *pText;

/* character string for the item */

Sets the character string for a menu or dialog box item associated with automated annotations. This function is available in the Document/Medical Toolkits.

Parameter

Description

hObject

Handle to the annotation automation object.

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:

 

Annotation Automation Menu Strings

 

Annotation Automation Line Dialog Strings

 

Annotation Automation Fill Dialog Strings

 

Annotation Automation Text Dialog Strings

 

Annotation Automation Audio Dialog Strings

 

Annotation Automation Stamp Dialog Strings

 

Annotation Automation ROP2 Dialog Strings

 

Annotation Automation Lock/Unlock Dialog Strings

 

Annotation Automation Miscellaneous Dialog Strings

 

Annotation Automation Ruler Dialog Strings

 

Annotation Automation Point Dialog Strings

 

Annotation Automation Video Dialog Strings

 

Annotation Automation Push Pin Dialog Strings

 

Annotation Automation Nodes Dialog Strings

 

Annotation Automation Protractor Dialog Strings

 

Annotation Automation Name Dialog Strings

 

Annotation Automation Play Video Dialog Strings

 

Annotation Automation Stamp Metafile Dialog Strings

 

Annotation Automation ToolTip Dialog Strings

 

Annotation Automation Transparent Color Dialog Strings

 

Annotation Automation Capture Dialog Strings

 

Annotation Automation Dialog Strings

pText

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

Returns

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

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.

Platforms

Windows 2000 / XP/Vista.

See Also

Functions:

L_AnnGetAutoText, L_AnnGetAutoTextLen, L_AnnSetHyperlinkMenuEnable, L_AnnSetAutoHilightPen, L_AnnSetAutoSnapCursor, L_AnnGetAutoSnapCursor

Topics:

Annotation Functions: Implementing Automation

 

Implementing an Automated Annotation Program

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;
}