Constrained Grab
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Livecode Opensource Backer
- Posts: 9385
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Constrained Grab
Well: not perfect:
Here's the stack: https://www.dropbox.com/s/il0n1wa3ol0gl ... e.zip?dl=0
Images "stolen shamelessly" from here:
http://www.stefanv.com/calculators/aristo970/index.html
Here's the stack: https://www.dropbox.com/s/il0n1wa3ol0gl ... e.zip?dl=0
Images "stolen shamelessly" from here:
http://www.stefanv.com/calculators/aristo970/index.html
-
- Livecode Opensource Backer
- Posts: 9385
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Constrained Grab
2 hours on a dentist's chair while she does a "happy" root-canal thing on me, and another, almost as painful,
operation on my bank account; and the result is that I trip out on the anaesthetic (not quite up the the standard of
Bill Atkinson's LSD I'm afraid) and do this:
Another thing I really LOVE about Livecode is that when loads of people make
really intelligent suggestions about how to do things I can still be a thorn in the flesh
and go for another way to do that.
Here's the second version of the Slide-Rule: https://www.dropbox.com/s/fb868icd5cg3x ... e.zip?dl=0
operation on my bank account; and the result is that I trip out on the anaesthetic (not quite up the the standard of
Bill Atkinson's LSD I'm afraid) and do this:
Another thing I really LOVE about Livecode is that when loads of people make
really intelligent suggestions about how to do things I can still be a thorn in the flesh
and go for another way to do that.
Here's the second version of the Slide-Rule: https://www.dropbox.com/s/fb868icd5cg3x ... e.zip?dl=0
-
- Livecode Opensource Backer
- Posts: 9385
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Constrained Grab
In the second method it is almost impossible for an end-user to move the slide of the slide-rule with any precision.
-
- Livecode Opensource Backer
- Posts: 9385
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Constrained Grab
After a longish time, here's version 3 of my Slide Rule stack:
https://www.dropbox.com/s/td1dbu923rh3t ... e.zip?dl=0
The underlying scripts are both different and considerably simpler: although the slides still
wobble in a most annoying fashion.
https://www.dropbox.com/s/td1dbu923rh3t ... e.zip?dl=0
The underlying scripts are both different and considerably simpler: although the slides still
wobble in a most annoying fashion.
Re: Constrained Grab
I do too on occaisionrichmond62 wrote: ↑Wed Dec 20, 2017 9:46 pm... although the slides still wobble in a most annoying fashion.
-
- Livecode Opensource Backer
- Posts: 9385
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Constrained Grab
Face facts: most of us are kinky in one way or another; and as a person who believes in "letting it all hang out" I'm offering you the chance to do just that with this:
Better than unwrapping another pair of socks from your ancient aunty in Melbourne!
Better than unwrapping another pair of socks from your ancient aunty in Melbourne!
Re: Constrained Grab
Ok ive got a button inside of a group that you click the button to drag the group. The first post in here looked like it should have worked but it doesnt.
Code: Select all
local returnLocation
local currentScroll
on mouseDown
set the idleRate to 0
put the location of the owner of me into returnLocation
grab the owner of me
put (item 1 of the loc of the owner of me,item 2 of returnLocation) into resetloc
set the text of fld "testlocation" to resetloc
set the loc of the owner of me to resetloc
end mouseDown
on mouseStillDown
put (item 1 of the loc of the owner of me,item 2 of returnLocation) into resetloc
set the text of fld "testlocation" to resetloc
set the loc of the owner of me to resetloc
end mouseStillDown
on mouseUp
put the location of the owner of me into newlocation
put item 1 of newlocation into xclocation
put item 1 of returnLocation into xrlocation
if (xclocation > (xrlocation + 200)) then
--do something
end if
set the location of the owner of me to returnLocation
end mouseUp
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: Constrained Grab
Hi,
A way using mouse move.
Btn script
Best regards
Jean-Marc
A way using mouse move.
Btn script
Code: Select all
local cX,yLoc,sMove,sLaCible
on mousedown
put the owner of the target into sLaCible
put true into sMove
put (the mouseH - item 1 of the loc of sLaCible) into cX
put (the mouseV - item 2 of the loc of sLaCible) into yLoc
end mousedown
on mousemove x,y
if sMove then
if there is a sLaCible then
set loc of sLaCible to x-cX,y-yLoc
end if
end if
end mousemove
on mouseup
put false into sMove
end mouseup
Jean-Marc
https://alternatic.ch
Re: Constrained Grab
Still doesnt work. i will try to strip down the project to post it
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: Constrained Grab
Hi Da_Elf,
If you want drag a group when you click only on a btn of this group as I understand your prev post
Jean-Marc
If you want drag a group when you click only on a btn of this group as I understand your prev post
It should worka button inside of a group that you click the button to drag the group
Jean-Marc
https://alternatic.ch
-
- Livecode Opensource Backer
- Posts: 9385
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Constrained Grab
Code: Select all
on mouseDown
grab me
put item 1 of the loc of me into WUN
set the idleRate to -1
set the loc of me to WUN,WUN
put the loc of me into fld "LOQ"
end mouseDown
on mouseMove
set the idleRate to -1
put item 1 of the loc of me into WUN
set the loc of me to WUN,WUN
put the loc of me into fld "LOQ"
end mouseMove
on mouseUp
set the idleRate to -1
put item 1 of the loc of me into WUN
set the loc of me to WUN,WUN
put the loc of me into fld "LOQ"
end mouseUp
Re: Constrained Grab
I cant seem to open that file.
This is my file
This is my file
- Attachments
-
- swipe.zip
- (4.93 KiB) Downloaded 181 times
-
- Livecode Opensource Backer
- Posts: 9385
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Constrained Grab
Um:
Someone maybe about to get his prawns cut off for accidently releasing a confidential file; THIS
is what was inside "swipe.zip":
2 can play at that gameI cant seem to open that file.
Someone maybe about to get his prawns cut off for accidently releasing a confidential file; THIS
is what was inside "swipe.zip":