I'd like to draw a simple line with this framework.
Can somebody tell me, how to do that?
wxSFLineShape* pShape = (wxSFLineShape*)GetDiagramManager()->AddShape(CLASSINFO(wxSFLineShape), event.GetPosition(), sfDONT_SAVE_STATE);
isn't enough, I think
Thank you in advance
in current (1.5.x) library version you cannot create a standalone line. The line shape must be always used as a connection between two shapes (even between two existing line shapes). If you wish to create new connection line use wxSFDiagramManager::CreateConnection(...) or wxSFShapeCanvas::StartInteractiveConnection(...) functions.
The CreateLine methods need a shape ID.
I can't seem to find a pshape->GetID(); method.
Function GetId() ( not GetID() !!! ) is member of xsSerializable class which is a base of wxSFShapeBase class, so you can call it as follows:
Thanks Michal -
I never would have found that!
I was looking in ShapeBase, BitMapShape, Canvas, etc.
Log in to post a comment.