GetPaletteText
As with all cursor tools, override the GetPaletteText function to provide the text associated with this particular tool. Change the text to the name of your tool.
void
TCanvasPolygonCreationTool::GetPaletteText (TText& theText) const
{
theText.Replace (TStandardText("Polygon"));
}
TCanvasPolygonCreation
Tool
Similarly, as with all cursor tools, override the CreatePaletteGraphic function to provide an MGraphic associated with this particular tool. You could use this graphic in a tool palette. Although not required, you could provide a graphic for your tool here.
MGraphic*
TCanvasPolygonCreationTool::CreatePaletteGraphic () const
{
return NIL;
}
// Copyright (C) 1995 Taligent, Inc. All rights reserved.
MGraphic*
TCanvasPolygonCreationTool::CreateCursorGraphic () const
{
TGPolygon crossHair (12);
crossHair.SetPoint (0,TGPoint(-1,7));
crossHair.SetPoint (1,TGPoint(1,7));
crossHair.SetPoint (2,TGPoint(1,1));
crossHair.SetPoint (3,TGPoint(7,1));
crossHair.SetPoint (4,TGPoint(7,-1));
crossHair.SetPoint (5,TGPoint(1,-1));
crossHair.SetPoint (6,TGPoint(1,-7));
crossHair.SetPoint (7,TGPoint(-1,-7));
crossHair.SetPoint (8,TGPoint(-1,-1));
crossHair.SetPoint (9,TGPoint(-7,-1));
crossHair.SetPoint (10,TGPoint(-7,1));
crossHair.SetPoint (11,TGPoint(-1,1));
TRGBColor black(0,0,0),white(1,1,1);
TGrafBundle* bundle = new TGrafBundle(new TColorPaint(black),new TColorPaint(white));
return new TPolygon (crossHair, bundle);
}