Placing a group on topleft of open stack

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
capellan
Posts: 654
Joined: Wed Aug 15, 2007 11:09 pm

Placing a group on topleft of open stack

Post by capellan » Tue May 02, 2017 2:06 pm

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

shaosean
Posts: 906
Joined: Thu Nov 04, 2010 7:53 am

Re: Placing a group on topleft of open stack

Post by shaosean » Tue May 02, 2017 2:09 pm

The place command should do what you want..

Klaus
Posts: 14198
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Placing a group on topleft of open stack

Post by Klaus » Tue May 02, 2017 2:42 pm

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

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10049
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Placing a group on topleft of open stack

Post by FourthWorld » Tue May 02, 2017 5:01 pm

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.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

capellan
Posts: 654
Joined: Wed Aug 15, 2007 11:09 pm

Re: Placing a group on topleft of open stack

Post by capellan » Tue May 02, 2017 8:49 pm

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

Post Reply