copy / paste & Drag Ctrl

Started by jfvert, July 12, 2016, 06:25:29 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jfvert

Is it possible to unable the copy / paste option and the drag&Ctrl option for a shape?

Thanks JFvert

RudySchneider

From your description, it sounds like you essentially want to "lock" a shape so that you can neither move it nor copy/paste it.  The simplest way to accomplish this, in my opinion, would be to put the shape(s) on a specific layer, and lock the layer.  See the attached file.  If you need to understand layers, there's plenty of explanations on the web.
There are no problems, only opportunities

FFC

Quote from: RudySchneider on July 12, 2016, 06:40:13 PM
From your description, it sounds like you essentially want to "lock" a shape so that you can neither move it nor copy/paste it.  The simplest way to accomplish this, in my opinion, would be to put the shape(s) on a specific layer, and lock the layer.  See the attached file.  If you need to understand layers, there's plenty of explanations on the web.

I am working on a project with jfvert and we want to be able to move the shape. We just want to be sure that no one will copy/paste it because it is a shape that has links to other shapes and making a copy of it can lead to unexpected things

Croc

#3
Macros are allowed?
If yes, you can use ShapeAdded event for removing appropriate shapes.
Like this:
Private Sub Document_ShapeAdded(ByVal Shape As IVShape)
    If Shape.Text = "NoAddMe" Then
        Shape.Delete
    End If
End Sub

jfvert

We have enough macros at the moment. The best thing would be to do something in the shapesheet without using any macro.

Thanks Jfvert

Hey Ken

Jfvert:

   Here's an odd shapesheet-based approach that will seem to prevent a cut/paste, although not actually prevent it.

   The idea is to have a copied shape hide itself on drop by turning off everything that makes a shape "there".  Specifically, on drop you set Geometry*.NoShow and HideText to True.  That way you can't see the shape.  You also set NoObjHandles, NoCtlHandles, NoAlignBox, and LockSelect to True to make it unnoticeable and untouchable.  The only way you can find it is to use the Drawing Explorer.  Just put the following formula into EventFXMod shapesheet cell of the shape you want to protect:



SETF(GetRef(EventDrop),"=SETF(GetRef(Geometry1.NoShow),""=true"")&SETF(GetRef(NoObjHandles),""=true"")& SETF(GetRef(NoCtlHandles),""=true"")& SETF(GetRef(HideText),""=true"")&SETF(GetRef(NoAlignBox),""=true"")&SETF(GetRef(LockSelect),""=true"")")



   You'll probably need to add more SETFs for Geometry2, 3, 4, etc., and if it's a grouped shape it could get a bit complicated; but the basic idea is the same.  Just turn it all off.

   So if the user tries to copy it, it seems like nothing happens, and they'll likely give up after a few (dozen?) attempts.  The big downside is that the shape is really still there.  That means it takes up space, and there may be some side effects that my meager testing did not reveal.  It also takes over your EventDrop event.  But at least it's a solution.

   Good luck!

   - Ken


Ken V. Krawchuk
Author
No Dogs on Mars - A Starship Story
http://astarshipstory.com

jfvert

Hi Hey Ken,

I don't think this is a great idea for me. I don't want any invisible objects I find this very annoying.

Thanks JFVERT