Profile Picture

Preventing Editing of a custom shape

Posted By Ron Sawyer 14 Years Ago
Author
Message
Ron Sawyer
Posted 14 Years Ago
View Quick Profile
Junior Member

Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)

Group: Forum Members
Last Active: 13 Years Ago
Posts: 16, Visits: 1

I have a custom shape descended from NGroup. When I double click on it, an in-place editor pops up. (See attachment). I want to prevent this. I have tried setting the protection of both the shape and the rectangle (sample code of setting rectangle protection.) I have tried both true and false.

NAbilities protection = rect.Protection;

protection.InplaceEdit = true;



On a related note (I think) once the in-place editor has been invoked, the rectangle seems to separate from the shape when I drag it. (See second part of attachment) I want to prevent this as well. I have tried setting protection.ungroup.

[Serializable]

class TestClass : NGroup

{

      NRectangleShape rect;

      public TestClass()

      {

            // add a rectangle shape as base

            rect = new NRectangleShape(new NRectangleF(0, 0, 100, 300));

            rect.DestroyShapeElements(ShapeElementsMask.All);

            rect.Protection = new NAbilities(AbilitiesMask.Select | AbilitiesMask.InplaceEdit | AbilitiesMask.Copy);

            Shapes.AddChild(rect);

 

            // update the model bounds with the rectangle bounds

            UpdateModelBounds(rect.Transform.TransformBounds(rect.ModelBounds));

      }

}



Attachments
Shape.zip (83 views, 17.00 KB)



Similar Topics


Reading This Topic