Page 1 of 1

Placing a group on topleft of open stack

Posted: Tue May 02, 2017 2:06 pm
by capellan
Hi All,

In a forum thread: http://forums.livecode.com/viewtopic.php?f=53&t=29207
there is a stack that lists all livecode stacks within a folder.
The user just have to click the stack's name to open.

Now, I am trying to add a group on topleft of every open stack
(A group with 4 buttons to select one of 4 fullscreen modes)
but could not find a way to do this on Android.

How could you place a group on a new stack on Android?

Thanks in advance!

Al

Re: Placing a group on topleft of open stack

Posted: Tue May 02, 2017 2:09 pm
by shaosean
The place command should do what you want..

Re: Placing a group on topleft of open stack

Posted: Tue May 02, 2017 2:42 pm
by Klaus
shaosean wrote:The place command should do what you want..
Al is not talking about the SAME stack! 8)

I guess this could work:
...
## in the standalone stack
copy grp "whatever"
go stack "the user selected other one"
paste
save this stack
...
But what do I know about mobile stuff? :D


Best

Klaus

Re: Placing a group on topleft of open stack

Posted: Tue May 02, 2017 5:01 pm
by FourthWorld
The "copy" command with the "to" option should do what you need, e.g.:

Code: Select all

copy grp "Something" of stack "SomeStack" to this cd of stack "MyStack"
The great thing about using the "copy" command's "to" clause is that it doesn't alter the user's clipboard, just faithfully performs the copy while leaving whatever the user had copied intact.

Re: Placing a group on topleft of open stack

Posted: Tue May 02, 2017 8:49 pm
by capellan
Many thanks for your answers and comments! :)
Now, I have added two buttons for changing
group's position in the opened stack.

I have posted an updated stack in this thread:
http://forums.livecode.com/viewtopic.php?f=53&t=29207

Both scripts works in Desktop, but only Richard's script
works in Android.

Code: Select all

-- Script of a locked text field
on mouseup

put fld "tPath" & slash & "test.livecode" into tOriginStack
-- fld "tPath" contains the stack's folder filepath, and this line
-- produce this result: 
-- (windows) C:/Documents and Settings/User/My Documents/test.livecode
-- (android) /mnt/sdcard/Documents/test.livecode

put fld "tPath" & slash & the value of the clickline into tStack
-- the text field contains a list of all livecode stacks within a folder 
-- the value of clickline is the stack's filename and this line
-- produce this result (for example): 
-- (windows) C:/Documents and Settings/User/My Documents/mystack.livecode
-- (android) /mnt/sdcard/Documents/mystack.livecode

go stack url "binfile:" & tStack
-- open selected stack: mystack.livecode

copy grp "FullScreenModes" of stack tOriginStack to cd 1 of this stack
-- copy group from a closed stack (test.livecode) 
-- into current opened stack (mystack.livecode)

end mouseup
Many Thanks again for your help! :D

Al