Products | Support | Send comments on this topic. | Email a link to this topic. | Back to Getting Started | Help Version 18.0.10.24
LEADTOOLS Raster imaging C++ Class library help

LAnnAutomation::EnumerateTextTokenTable

Show in webframe

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::EnumerateTextTokenTable()

Lets you examine the contents of the annotation text token table.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

Use this function to examine the contents of the annotation text token table. This function is used with the text annotation objects that support tokens, namely the following:

The LAnnAutomation::EnumTextTokenTableCallBack is called for each token. Note that the tokens cannot be changed with this function. To modify the text token table, use one of the following functions:

LAnnAutomation::InsertTextTokenTable

LAnnAutomation::DeleteTextTokenTable

LAnnAutomation::ClearTextTokenTable

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:

Class Members

Topics:

Annotation Functions: Object Properties

 

Implementing Annotations

 

Automated User Interface for Annotations

 

Annotation Functions: Creating and Deleting Annotations

 

Types of Annotations

 

Annotation Functions: Implementing Custom Annotations

 

Annotation Functions: Creating Custom Annotations

 

Fixed Annotations

 

Minimizing Flicker With Double Buffering

 

Annotation Functions: Working with the Toolbar

Example

// This sample enumerates all of the tokens in the text token table,

// and displays the result

/*<struct>*/
#if defined(MyAnnAutomation)
class MyAnnAutomation: public LAnnAutomation
{
   public:
      virtual L_INT EnumTextTokenTableCallBack(L_INT nTextTokenCount, L_INT nIndex, pANNTEXTTOKEN pTextToken); 
      L_TCHAR m_szMsg[1000]; 
};
#endif
/*</struct>*/
L_INT MyAnnAutomation::EnumTextTokenTableCallBack(L_INT nTextTokenCount, L_INT nIndex, pANNTEXTTOKEN pTextToken) 
{
   L_TCHAR szTemp[100]; 
   L_TCHAR *pszType; 
   if (nIndex == 0) 
      wsprintf(m_szMsg, TEXT("Total Tokens: %d\n"), nTextTokenCount); 
   pszType = TEXT("Unknown");
   switch(pTextToken->nTokenType) 
   {
      case ANNTOKEN_NONE: 
         pszType = TEXT("ANNTOKEN_NONE");
         break; 
      case ANNTOKEN_SEPARATOR: 
         pszType = TEXT("ANNTOKEN_SEPARATOR");
         break; 
      case ANNTOKEN_TEXT: 
         pszType = TEXT("ANNTOKEN_TEXT");
         break; 
      case ANNTOKEN_DATE_YYYY: 
         pszType = TEXT("ANNTOKEN_DATE_YYYY");
         break; 
      case ANNTOKEN_DATE_YY: 
         pszType = TEXT("ANNTOKEN_DATE_YY");
         break; 
      case ANNTOKEN_DATE_MM: 
         pszType = TEXT("ANNTOKEN_DATE_MM");
         break; 
      case ANNTOKEN_DATE_DD: 
         pszType = TEXT("ANNTOKEN_DATE_DD");
         break; 
      case ANNTOKEN_DATE_MONTH_NAME: 
         pszType = TEXT("ANNTOKEN_DATE_MONTH_NAME");
         break; 
      case ANNTOKEN_DATE_DAY_OF_WEEK: 
         pszType = TEXT("ANNTOKEN_DATE_DAY_OF_WEEK");
         break; 
      case ANNTOKEN_TIME_HH_12: 
         pszType = TEXT("ANNTOKEN_TIME_HH_12");
         break; 
      case ANNTOKEN_TIME_HH_24: 
         pszType = TEXT("ANNTOKEN_TIME_HH_24");
         break; 
      case ANNTOKEN_TIME_MM: 
         pszType = TEXT("ANNTOKEN_TIME_MM");
         break; 
      case ANNTOKEN_TIME_SS: 
         pszType = TEXT("ANNTOKEN_TIME_SS");
         break; 
      case ANNTOKEN_TIME_MILLISECONDS: 
         pszType = TEXT("ANNTOKEN_TIME_MILLISECONDS");
         break; 
      case ANNTOKEN_AM_PM: 
         pszType = TEXT("ANNTOKEN_AM_PM");
         break; 
   }
   wsprintf(szTemp, TEXT("[%d]#%c\t%s\t%s\t%s\n"), 
             nIndex, pTextToken->cToken ? pTextToken->cToken : ' ', pTextToken->pszDesc 
             ? pTextToken->pszDesc : TEXT(""), pTextToken->pszTokenString 
             ? pTextToken->pszTokenString : TEXT(""), pszType); 
   return SUCCESS; 
}
L_INT LAnnAutomation_EnumerateTextTokenTableExample(MyAnnAutomation *pLAutomation) 
{
   L_INT nRet;
   lstrcpy(pLAutomation->m_szMsg, TEXT(""));
   pLAutomation->EnableCallBack(TRUE); 
 
   nRet = pLAutomation->EnumerateTextTokenTable();
   if(nRet != SUCCESS)
      return nRet;
   MessageBox(NULL, pLAutomation->m_szMsg, TEXT("Text Token Table"), MB_OK); 
   return SUCCESS;
}
Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.