Is it possible to lock the size of an object?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Is it possible to lock the size of an object?
I am creating graphics problematically for the user to move around but I do not want the user to be able to change the size of them. Is there a way to do this? There is a lockLoc but no lockSize, lockWidth or lockHeight
Cyril Pruszko
https://sites.google.com/a/pgcps.org/livecode/
https://sites.google.com/a/setonhs.org/app-and-game-workshop/home
https://learntolivecode.com/
https://sites.google.com/a/pgcps.org/livecode/
https://sites.google.com/a/setonhs.org/app-and-game-workshop/home
https://learntolivecode.com/
-
- VIP Livecode Opensource Backer
- Posts: 10052
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Is it possible to lock the size of an object?
lockLoc could more accurately be called lockRect, as it locks all aspects of the object's position.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Is it possible to lock the size of an object?
Thank you for the reply
That is the problem, lockLoc locks everything.
I do want to let them move it around. I just do not want them to accidentally change the sizes.
I want to lock the size but not prevent the users from positioning it
That is the problem, lockLoc locks everything.
I do want to let them move it around. I just do not want them to accidentally change the sizes.
I want to lock the size but not prevent the users from positioning it
Cyril Pruszko
https://sites.google.com/a/pgcps.org/livecode/
https://sites.google.com/a/setonhs.org/app-and-game-workshop/home
https://learntolivecode.com/
https://sites.google.com/a/pgcps.org/livecode/
https://sites.google.com/a/setonhs.org/app-and-game-workshop/home
https://learntolivecode.com/
-
- VIP Livecode Opensource Backer
- Posts: 10052
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Is it possible to lock the size of an object?
Don't provide a pointer tool mode for your users and they'll have no means of resizing the objects.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Is it possible to lock the size of an object?
Yep, please spread the word: Standalone <> IDE!
In a standalone the user will only be able to do things that YOU, the developer, will allow him!

In a standalone the user will only be able to do things that YOU, the developer, will allow him!
Re: Is it possible to lock the size of an object?
Look at "grab" in the dictionary. As the others mentioned, you don't have to provide a way to "select" the object (as in edit mode of the ide) if you want it movable, just use grab to allow it to be moved around and the problem goes away entirely.
Re: Is it possible to lock the size of an object?
Thank you all. Those are all good answers and conceptually, they make sense.
The problem is, I do not know how to do what you are suggesting and can't find any examples or documentation on it. I looked in the Dictionary, Resources, Lessons and found not much to help on those topics. I read a number of forum links but they are mostly on interactive/developer tasks
I hate to bother you again but...
1) How do you use the "grab" to grab an object, drag it and then let it go? At that point I want to lock the location of that graphic.
2) How do you turn off the 'pointer tool mode' for the user?
Thank you all for your help and I apologize for being dumb and asking so many questions.
The problem is, I do not know how to do what you are suggesting and can't find any examples or documentation on it. I looked in the Dictionary, Resources, Lessons and found not much to help on those topics. I read a number of forum links but they are mostly on interactive/developer tasks
I hate to bother you again but...
1) How do you use the "grab" to grab an object, drag it and then let it go? At that point I want to lock the location of that graphic.
2) How do you turn off the 'pointer tool mode' for the user?
Thank you all for your help and I apologize for being dumb and asking so many questions.
Cyril Pruszko
https://sites.google.com/a/pgcps.org/livecode/
https://sites.google.com/a/setonhs.org/app-and-game-workshop/home
https://learntolivecode.com/
https://sites.google.com/a/pgcps.org/livecode/
https://sites.google.com/a/setonhs.org/app-and-game-workshop/home
https://learntolivecode.com/
Re: Is it possible to lock the size of an object?
To see how it might work (this is a VERY simple example, hard to know how to give a more concrete example without knowing what you're trying to end up with)
Create a new mainstack.
Drop a graphic on it, I used a rectangle.
Set the "opaque" property of the rectangle to true in the inspector.
Edit the script of the rectangle and put the following
Apply the changes to the script, then go into run mode, click and drag the square and it should follow right along. Release the mouse button and it stays where you put it.
As indicated by Klaus, when you build a standalone, run mode is the default, you have to specifically go out of your way to code methods to select objects so that you can access their "handles". In the IDE of course thats not the case.
Also, don't know if you've been referred to these resources yet..
http://www.runrev.com/developers/docume ... rs-course/
http://lessons.runrev.com/
Both are very helpful when you're just starting out.
Create a new mainstack.
Drop a graphic on it, I used a rectangle.
Set the "opaque" property of the rectangle to true in the inspector.
Edit the script of the rectangle and put the following
Code: Select all
on mouseDown
grab me
end mouseDown
As indicated by Klaus, when you build a standalone, run mode is the default, you have to specifically go out of your way to code methods to select objects so that you can access their "handles". In the IDE of course thats not the case.
Also, don't know if you've been referred to these resources yet..
http://www.runrev.com/developers/docume ... rs-course/
http://lessons.runrev.com/
Both are very helpful when you're just starting out.