Webinar Session Questions 30/04/2014

Moderators: LCNeil, heatherlaine, kevinmiller, elanorb

Post Reply
LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Webinar Session Questions 30/04/2014

Post by LCNeil » Thu May 01, 2014 1:45 pm

Hi All,

Here are some responses for questions asked in yesterdays webinar-

How to add a group to a group?

There are a few methods that you can use to do this-

1) using relayerGroupControls

Something like the following script will allow you to add two separate layers into the one layer-

Code: Select all

on mouseUp
   put the layer of group "groupTop" into tWhatLayer
   set the relayerGroupedControls to true
   set the layer of group "groupOvals" to tWhatLayer +1
   set the relayerGroupedControls to false
end mouseUp
You will need to adjust the group names to ones you are using

2) Using copy

You can also use copy to insert a group into another group. This will leave the original group in place, so you may need to delete this-

copy group "groupOvals” to group "groupTop”


How to automatically reposition controls if one is deleted-

The following script has been taken from the distribution section of the property inspector. I altered it to only work on buttons but you should be able to adjust it for all control.

Simply add this script to a button called “test” and add multiple buttons to your card. Pressing the test button should distribute them evenly

Code: Select all

on mouseUp
   
   -- repeating through your card to get long id's of all buttons
   repeat with x = 1 to the number of buttons of this card
      -- want to ignore button that triggers the script
      if the name of button x is "button "&quote&"test"&quote then
         next repeat
      end if
      put the long id of button x & cr after tObjectNames
   end repeat
   put the number of lines in tObjectNames into tNumberOfObjects
   put 0 into tWidth
   
   --where the magic happens, and positions the buttons equally accross the cards
   if tNumberOfObjects < 1 then exit to top
   repeat with i = 1 to tNumberOfObjects
      get line i of tObjectNames
      add the width of it to tWidth
   end repeat
   get line 1 of tObjectNames
   put word 5 to (the number of words in it) of it into tCardName
   put the width of tCardName into tCardWidth
   put (tCardWidth - tWidth) / (tNumberOfObjects + 1) into tPerSpace
   put tPerSpace into tOffset
   repeat with i = 1 to tNumberOfObjects
      get line i of tObjectNames
      set the left of it to round(tOffset)
      add the width of it + tPerSpace to tOffset
   end repeat
   
end mouseUp
The recording of yesterdays webinar should also be in your codingschool accounts.

Kind Regards,


Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
——

pink
Posts: 272
Joined: Wed Mar 12, 2014 6:18 pm

Re: Webinar Session Questions 30/04/2014

Post by pink » Fri May 02, 2014 1:46 pm

Hi Neil, you had brought up a webpage listing various ways to test on iOS devices (the last one being TestFlight). Could you post that link?

Thanks,
Greg
Greg (pink) Miller

MadPink, LLC
I'm Mad, Pink and Dangerous to Know

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: Webinar Session Questions 30/04/2014

Post by LCNeil » Tue May 06, 2014 3:58 pm

Hi Greg,

Here ya go :)

http://mobiledan.net/2012/03/02/5-optio ... e-legally/

Kind Regards,


Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
——

Post Reply

Return to “idea2app and Coding School”