L_AnnSetShowFlags (original) (raw)
Summary
Determines how the rulers will be displayed.
Syntax
#include "l_bitmap.h"
L_LTANN_API L_INT L_AnnSetShowFlags(hObject, uShowFlags, uFlags)
Parameters
HANNOBJECT hObject
Handle to the annotation object.
L_UINT uShowFlags
Flag that indicates how to display the rulers. Possible values are:
Value | Meaning |
---|---|
0 | Do not display the ruler length or the ruler gauge or the tic marks. In this case, the ruler looks like a line. |
ANNSHOW_LENGTH | Display the ruler length. |
ANNSHOW_GAUGE | Display the ruler gauge. |
ANNSHOW_TICMARKS | Display the tic marks. |
L_UINT 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 L_AnnGetSelected and L_AnnSetSelected 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_CHECKMENU | [0x0020] Process objects only if the ANNAUTOTEXT_MENU_SHOWRULER menu item has been selected. |
Returns
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
Comments
This function is valid for the following objects:
- ANNOBJECT_CROSSPRODUCT
- ANNOBJECT_POLYRULER
- ANNOBJECT_PROTRACTOR
- ANNOBJECT_RULER
In addition, the Automation object stores the show flag settings along with the other object default settings.
For Protractor objects, the default value for uShowFlags
is 0. For the Ruler, PolyRuler, and Cross-Product objects the default value for uShowFlags is ANNSHOW_LENGTH | ANNSHOW_TICMARKS.
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
Win32, x64.
See Also
Functions
Topics
- Annotation Functions: Object Properties
- Annotation Objects - Default Values
- Annotation Objects - Automated Features
- Implementing an Automated Annotation Program
- Implementing a Non-automated Annotation Program
- Altering Annotation Object Settings
- Using Rulers in Annotation Objects
- Annotation Features
- Calibrating Annotation Ruler Objects
Example
L_INT EXT_CALLBACK ShowFlagsAnnEnumCallback(HANNOBJECT hObject, L_VOID* pUserData)
{
UNREFERENCED_PARAMETER(pUserData);
L_UINT Type, ShowFlags;
L_INT nRet;
nRet = L_AnnGetType(hObject, &Type);
if (nRet != SUCCESS)
return nRet;
switch (Type)
{
case ANNOBJECT_PROTRACTOR:
case ANNOBJECT_RULER:
case ANNOBJECT_CROSSPRODUCT:
case ANNOBJECT_AUTOMATION:
nRet = L_AnnGetShowFlags(hObject, &ShowFlags);
if (nRet != SUCCESS)
return nRet;
if (ShowFlags != 0)
ShowFlags = 0;
else
ShowFlags = ANNSHOW_LENGTH | ANNSHOW_GAUGE;
nRet = L_AnnSetShowFlags(hObject, ShowFlags, 0);
if (nRet != SUCCESS)
return nRet;
break;
default:
_tprintf(_T("%s"), TEXT("Notice: Object is not a protractor, ruler, cross-product or automation object."));
return FAILURE;
}
return SUCCESS;
}
extern "C" L_INT AnnSetShowFlagsExample(HANNOBJECT hContainer)
{
return L_AnnEnumerate(hContainer, (ANNENUMCALLBACK)ShowFlagsAnnEnumCallback, NULL, ANNFLAG_RECURSE | ANNFLAG_SELECTED, NULL);
}
LEADTOOLS Raster Imaging C API Help