Tool example for C++ 5.0 and later
For more information on declaration and unlocking procedures used in testing this example, refer to Annotation Declaration Information.
//This sample displays the current tool, and then changes it to ANN_TOOL_RECT
void SampleTool(ILEADRasterAnnToolBar * pAnnToolBar)
{
CString strTool;
AnnToolConstants nTool;
nTool = pAnnToolBar->GetTool();
strTool.Format(TEXT("Annotation Tool: %d"), nTool);
switch (nTool)
{
case ANN_TOOL_SELECT:
strTool = TEXT("Select");
break;
case ANN_TOOL_LINE:
strTool = TEXT("Line");
break;
case ANN_TOOL_RECT:
strTool = TEXT("Rect");
break;
case ANN_TOOL_ELLIPSE:
strTool = TEXT("Ellipse");
break;
case ANN_TOOL_POLYLINE:
strTool = TEXT("Polyline");
break;
case ANN_TOOL_POLYGON:
strTool = TEXT("Polygon");
break;
case ANN_TOOL_POINTER:
strTool = TEXT("Pointer");
break;
case ANN_TOOL_FREEHAND:
strTool = TEXT("Freehand");
break;
case ANN_TOOL_HILITE:
strTool = TEXT("hilite");
break;
////...other tools
}
AfxMessageBox(TEXT("Current tool: ") + strTool);
AfxMessageBox(TEXT("Changing to ANN_TOOL_RECT"));
pAnnToolBar->PutTool(ANN_TOOL_RECT);
}