Tool example for C++ Builder
//This sample displays the current tool, and then changes it to ANN_TOOL_RECT
void __fastcall TForm1::ToolClick(TObject *Sender)
{
AnsiString strTool;
strTool = pRasterAnnToolbar->Tool;
switch (pRasterAnnToolbar->Tool)
{
case ANN_TOOL_SELECT:
strTool = "Select";
break;
case ANN_TOOL_LINE:
strTool = "Line";
break;
case ANN_TOOL_RECT:
strTool = "Rect";
break;
case ANN_TOOL_ELLIPSE:
strTool = "Ellipse";
break;
case ANN_TOOL_POLYLINE:
strTool = "Polyline";
break;
case ANN_TOOL_POLYGON:
strTool = "Polygon";
break;
case ANN_TOOL_POINTER:
strTool = "Pointer";
break;
case ANN_TOOL_FREEHAND:
strTool = "Freehand";
break;
case ANN_TOOL_HILITE:
strTool = "hilite";
break;
//...other tools
}
ShowMessage ("Current tool: " + strTool);
ShowMessage ("Changing to ANN_TOOL_RECT");
pRasterAnnToolbar->Tool = ANN_TOOL_RECT;
}