Important: lockLocation and selectGroupedControls

This is the place to discuss anything relating to MobGUI

Moderators: heatherlaine, kevinmiller, robinmiller, malte, splash21

Post Reply
gcbrackett
Posts: 16
Joined: Sun Apr 16, 2006 6:13 pm
Location: Boston MA
Contact:

Important: lockLocation and selectGroupedControls

Post by gcbrackett » Mon Jul 25, 2011 8:57 pm

I have complicated controls consisting of things like a scroller containing a group containing a series of list items. When changing the location and size of grouped controls, it's tempting to turn off lockLocation. It's also tempting to turn on selectGroupedControls so that the Application Browser will show all levels and allow selecting internal parts without using "Edit Group" again and again. If you do either of these things, BE SURE TO UNDO THEM BEFORE PROCEEDING, AND ESPECIALLY BEFORE TESTING IN A SIMULATOR. Very strange behavior can result, in particular having what looks fine in the IDE go completely to pieces in the simulator with controls out of place or even invisible because they've been moved.

I have two recommendations for avoiding these problems:

(1) Use altLayerTools, a free plugin from Chipp Walters, to select and edit properties of internal parts of groups. It can be downloaded from http://www.gadgetplugins.com/altplugins ... rTools.rev .
(2) Run this little handler from time to time:

Code: Select all

on utilityFixGroups
   # make sure all groups are set properly for MobGUI
   local tNumGroups
   repeat with tCard = 1 to the number of cards in this stack
      put the number of groups in card tCard of this stack into tNumGroups
      if tNumGroups > 0 then
         repeat with tGroup = 1 to tNumGroups
            set the selectGroupedControls of group tGroup of card tCard to false
            set the lockLocation of group tGroup of card tCard to true
         end repeat
      end if
   end repeat
end utilityFixGroups
The same approach may be a good idea for any control that MobGUI rescales with its own controls. I don't know yet.

George
George C Brackett
Principal, George Brackett Associates
http://luceatlux.com

splash21
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 369
Joined: Sun Dec 19, 2010 1:10 am
Location: UK
Contact:

Re: Important: lockLocation and selectGroupedControls

Post by splash21 » Wed Jul 27, 2011 8:10 am

Hi, George. The selectGroupedControls property is really only to treat a group of objects as one control, so you don't see all the components. For normal groups of controls, you would probably want to see the controls contained in the group.

MobGUI doesn't require that you lock all your groups - if they're not locked, groups will resize to fit their content whether you are using MobGUI or not (it's normal LiveCode behaviour). If you DO lock all your groups, then you'll have to manually resize them in your scripts if you alter their contents and require objects to be visible that are not in the original group bounds!


John
LiveCode Development & Training : http://splash21.com

Post Reply

Return to “MobGUI”