LAnnotation::SetAutoMenuItemEnable

#include "ltwrappr.h"

virtual L_INT LAnnotation::SetAutoMenuItemEnable(nObjectType, uItem, uEnable, uFlags, pUserList)

L_INT nObjectType;

/* type of annotation object */

L_UINT uItem;

/* constant for the specified item */

L_UINT uEnable;

/* flag that indicates whether to enable or disable an item */

L_UINT uFlags;

/* flags that determine which objects to process */

L_TCHAR L_FAR *pUserList;

/* character string that contains the user list */

Enables or disables a menu item for one or more annotation objects. This function is available in the Document/Medical Toolkits.

Parameter

Description

nObjectType

Constant that specifies an object's type. If hObject is an automation object, the specified menu item for all objects of type nObjectType will be enabled or disabled. For descriptions of possible object types, refer to Types of Annotations.

uItem

Constant that specifies the menu or dialog box item to enable or disable. For lists of constants and their default values, refer to the following:

 

Annotation Automation Menu Strings

 

Annotation Automation Line Dialog Strings

 

Annotation Automation Line 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 Stamp Metafile Dialog Strings

 

Annotation Automation Transparent Color Dialog Strings

 

Annotation Automation Capture Dialog Strings

uEnable

Flag that indicates whether to enable or disable the specified item. Possible values are:

 

Value

Meaning

 

ANNMENU_ENABLED

Enable the menu item.

 

ANNMENU_DISABLED

Disable the menu item.

 

ANNMENU_DEFAULT

Enable or disable the menu item, based on the setting for the object type.

uFlags

Flags that determine which objects to process. Most of the flags apply only to container objects. You can combine values when appropriate by using a bitwise OR ( | ). The following are valid values:

 

Value

Meaning

 

0

Process only the specified object.

 

ANNFLAG_SELECTED

[0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the LAnnotation::IsSelected and LAnnotation::SetSelected functions.

 

ANNFLAG_NOTTHIS

[0x0004] Process only one level of objects within the specified container, not the container itself. If there are containers within the container, they are modified, but the objects within them are not.

 

ANNFLAG_RECURSE

[0x0008] Process objects within a container, and within any subcontainers, down to any level.

 

ANNFLAG_NOTCONTAINER

[0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.

 

ANNFLAG_NOINVALIDATE

[0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.

 

ANNFLAG_USER

[0x0040] Process only those objects that have a user included in pUserList. If pUserList is NULL, process only those objects that do not have an associated user.

pUserList

Character string that contains the list of users associated with the specified object. pUserList has the form "User1,User2,…,UserN". This must be a NULL terminated string with user names separated by a comma. This parameter is valid only if ANNFLAG_USER is set in uFlags.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

By default, all automation menu items that are not NULL are displayed.

If an automation menu item is NULL, that menu item will not be displayed, even if the menu item has been enabled using this function.

The menu item strings are changed using the LAnnAutomation::SetAutoText function.

Menu items can be enabled or disabled for one or more than one object, depending on the object. The following table indicates the possible options:

Menu Item String

Status

Object

nObjectType

Result

NULL

Enabled

Annotation or automation

Any type

Menu item is not displayed.

NULL

Disabled

Annotation or automation

Any type

Menu item is not displayed.

Not NULL

Disabled

Automation object

ANNOBJECT_XXX

Menu item is not displayed for all objects of type ANNOBJECT_XXX.

Not NULL

Disabled

Automation object

ANNOBJECT_ALL

Menu item is not displayed for all objects.

Not NULL

Enabled

Automation object

ANNOBJECT_XXX

Menu item is displayed for all objects of type ANNOBJECT_XXX.

Not NULL

Enabled

Automation object

ANNOBJECT_ALL

Menu item is displayed for all objects.

Not NULL

Disabled

Annotation object

Ignored

Menu item is not displayed for the specified object, based on the value of uFlags.

Not NULL

Enabled

Annotation object

Ignored

Menu item is displayed for the specified object, based on the value of uFlags.

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:

LAnnotation::GetAutoMenuItemEnable, LAnnAutomation::SetAutoText, LAnnAutomation::GetAutoText, LAnnotation::GetAutoMenuState, LAnnotation::SetAutoMenuState, LAnnotation::SetAutoSnapCursor, LAnnotation::GetAutoSnapCursor

Topics:

Annotation Functions: Implementing Automation

 

Implementing Annotations

 

Automated User Interface for Annotations

Example

//This example uses the following member variables:
// LAnnotationWindow m_AnnotationWindow
// m_AnnotationWindow should be created and initialized (using CreateWnd) prior to the example
void CVCAnnotationToolbar11Dlg::OnButtonAnnAutoMenu()
{
   L_UINT Enable;
   LAnnAutomation AnnAutomation;

   LAnnotationWindow m_AnnotationWindow;

   AnnAutomation = m_AnnotationWindow.GetAutomationObject();

   AnnAutomation.GetAutoMenuItemEnable ( ANNOBJECT_ALL, ANNAUTOTEXT_MENU_CUT, &Enable);
   if (Enable == ANNMENU_ENABLED)
   {
     AfxMessageBox(TEXT("Menu item is enabled. It will now be disabled."));
     AnnAutomation.SetAutoMenuItemEnable( ANNOBJECT_ALL, ANNAUTOTEXT_MENU_CUT, ANNMENU_DISABLED, 0, NULL);
   }
   else if (Enable == ANNMENU_DISABLED)
   {
     AfxMessageBox(TEXT("Menu item is disabled. It will be enabled."));
     AnnAutomation.SetAutoMenuItemEnable( ANNOBJECT_ALL, ANNAUTOTEXT_MENU_CUT, ANNMENU_ENABLED, 0, NULL);
   }
   else
   {
     AfxMessageBox(TEXT("Menu item is using its default behavior. It will be disabled."));
     AnnAutomation.SetAutoMenuItemEnable(ANNOBJECT_ALL, ANNAUTOTEXT_MENU_CUT, ANNMENU_DISABLED, 0, NULL);
   }
}