I am trying get a tool to create a GoTextNode that has a user defined size.
I am thinking the GoToolCreating is the tool to use because it will "rubberband define a size rectangle". But the samples in Demo1 use addPoint, and I cannot define a TextNodes bounds that way.
The ClickCreateTool creates GoTextNodes, but with a fixed size. Which won't work.
I have tried this code (Tool derived from GoToolCreating, no code in start except cursor), but my FirstInput.DocPoint is always (0,0). I am not getting the rubberband and my node is always at the origin. Note, I am just creating this tool and assigning it to the View (Modeless?).
public override void DoMouseDown() {
_StartPt = this.FirstInput.DocPoint;
}
public override void DoMouseUp() {
StartTransaction();
GoTextNode node = new GoTextNode();
SizeF sz = new SizeF(this.LastInput.DocPoint.X - _StartPt.X, this.LastInput.DocPoint.Y - _StartPt.Y);
node.Bounds = new RectangleF(_StartPt , sz);
node.Text = “New Node”;
this.View.Document.Add(node);
this.TransactionResult = “inserted object”;
StopTransaction();
}
Is there another sample I should look for?
Thanks
Bob