I'm trying to make a project that has an a2dcanvas and a tool controller derived from a2dStToolContr.

I'm trying to make it so that when the editing tool a2dRecursiveEditTool is popped onto the a2dStToolContr stack, that when a certain a2dRect is selected, that the user will be unable to rotate the rectangle.

I've searched and found a supposed solution, but it does not work (here: https://sourceforge.net/p/wxart2d/mailman/message/18925778/)

Here is the code for adding the rectangle:

a2dCanvasDocument* root = CameraView->GetCanvasDocument();

m_ToolController = new MyCanvasStToolContr(CameraView->GetCanvasView(),

m_ToolController->SetTopTool( new a2dDragTool(m_ToolController));

a2dRect *Rect = new a2dRect(0,0,2,2);

Rect->SetStroke(wxColour(0,255,0), STROKE_WIDTH,


a2dCanvasObject::PROPID_Allowrotation->SetPropertyToObject(Rect, false);
a2dCanvasObject::PROPID_Allowskew->SetPropertyToObject(Rect, false);

But the edit tool is always able to rotate and skew the rectangle above. How do I get this to work??

(It occurs to me that perhaps the reason this doesn't work is that the edit tool creates a clone of the object that it is editing, and perhaps the property of "do not allow rotation" doesn't get cloned with it?)

- Mike

Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Wxart2d-users_dev mailing list

Reply via email to