Group items lose group height when button clicked

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Group items lose group height when button clicked

Post by cusingerBUSCw5N » Sun Jun 26, 2016 11:07 pm

I have a card with buttons and fields that take up a space larger than a normal device. I have grouped the items, set the height of the group to be less than the actual height, and created a native scroller so people can scroll to see the hidden buttons.

When someone clicks on a button that opens another button or field (still within the group) the hidden buttons and fields appear, and the height of the group reverts to the original height.

Simultaneously, the native scroller disappears.

Do I have to resize the group and create a new scroller every time someone clicks a button within my group?

Please tell me there is an easier way.

I have also tried it with the new item that is being opened NOT part of the group - but the same result happens.

The only script inside the button is set the vis of button "statuschoice_biz" to false
set the vis of field "choices_biz" to true - it is to handle a dropdown, since mobile devices can't handle dropdowns. Thanks!

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Group items lose group height when button clicked

Post by Klaus » Mon Jun 27, 2016 9:01 am

Hi cusingerBUSCw5N,

did you set the groups "lockloc" to TRUE right after resizing?
In the inspector for the group check "lockloc" (or maybe it reads "Lock size and position", depending on your prefs).


Best

Klaus

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: Group items lose group height when button clicked

Post by cusingerBUSCw5N » Wed Jun 29, 2016 6:41 pm

Hi. So putting set the lockloc of group "group_newforum" to true after resizing gave me a group height - but didn't solve my basic problem - which is the scroller.. Before, I thought the scroller was failing because it didn't have a group height. Now, I realize that the scroller needs to be killed and recreated whenever new buttons or fields are introduced.

So, I can do that. Since I want the person to stay at the same place, I have the scroller save the vOffset in a hidden field. Then I kill the scroller, create a new one, and set vOffset on the new scroller to the number saved in the hidden field.

Works.... until it switches from landscape to portrait, or vice versa. Then it becomes a mess.

It sets up everything from the vOffset point down correctly - and even creates a scroller that works. The part ABOVE the vOffset gets put in the screen first - according to the instructions on the card script. Then the group starting with vOffset is shown. The group part works fine - it even has a scroller that accesses the buttons below. But the part ABOVE the voffset is not part of the scroller - and just sits beyond the group... when it is supposed to be the top part of the group.

The last line of the card script: set the top of group "group_newforum" to the bottom of image "background_app.png" + tverticalspace places the group correctly - but leaves the part above the vOffset point on the screen - - creating a mess. Also, those fields are not scrollable when you move the scroller up...

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9665
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Group items lose group height when button clicked

Post by dunbarx » Wed Jun 29, 2016 6:56 pm

So glad I do not develop for mobile.

Craig Newman

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: Group items lose group height when button clicked

Post by cusingerBUSCw5N » Wed Jun 29, 2016 8:32 pm

believe I figured it out - and as usual, it is my fault.

I set a few settings in the buttons...so when it resizes, it doesn't go through the button instructions.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”