Thanks Scott. formattedRect doesn't quite work on its own because it positions the stack at the top left of the screen. However you put me on the right track because I can use the measurements in it to set the correct rectangle.
Pete lcSQL Software <http://www.lcsql.com> Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html> On Thu, Jul 10, 2014 at 12:23 PM, Scott Rossi <sc...@tactilemedia.com> wrote: > I think you meant the formattedRect property, not formattedWidth. If you > check the formattedRect property, you should be able to get right/bottom > positions you want without looping through the card objects. > > Regards, > > Scott Rossi > Creative Director > Tactile Media, UX/UI Design > > > > > On 7/10/14 12:02 PM, "Peter Haworth" <p...@lcsql.com> wrote: > > >Hi SCott, > >Yes, I'm currently doing what you suggest by looking at all the controls > >on > >the card. > > > >What I don't understand is why the formattedWidth of a card doesn't return > >what's described in the dictionary. It appears to simply return the width > >of the widest control on the card when what it should do is return the > >right of the rightmost control. Seems like a bug to me but that property > >has been around for a long time so not sure what it hasn't come up before. > > > > > >Pete > >lcSQL Software <http://www.lcsql.com> > >Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and > >SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html> > > > > > >On Thu, Jul 10, 2014 at 10:35 AM, Scott Rossi <sc...@tactilemedia.com> > >wrote: > > > >> I'm still not quite clear on what you're trying to accomplish. If you > >> want to size a stack to the rect of all visible elements on a card, you > >> need to check the extents of those objects -- the right-most and > >> bottom-most edges -- not the space they occupy with formattedWidth or > >> height. > >> > >> If I understand what you're looking to do, loop through your card > >>objects, > >> grab the greatest right and bottom extents, and that should give you the > >> dimensions to use for your stack. > >> > >> Regards, > >> > >> Scott Rossi > >> Creative Director > >> Tactile Media, UX/UI Design > >> > >> > >> > >> > >> On 7/10/14 10:07 AM, "Peter Haworth" <p...@lcsql.com> wrote: > >> > >> >I recently posted about how to adjust the size of different cards > >>within a > >> >stack and part of the solution I tried was using the formattedWidth and > >> >formattedHeight properties (actually the effective versions of them). > >> > > >> >I'm now seeing that the formattedWidth (and probably formattedHeight) > >> >return very unexpected values. > >> > > >> >The dictionary says it returns the width of a rectangle that contains > >>all > >> >objects in the card whose visible property is true but I'm not seeing > >> >that. > >> > > >> >Make yourself a stack with a field on it with it's left edge in the > >>middle > >> >of the stack and it's right edge somewhere off the right edge of the > >> >stack. > >> > > >> >Put a button on the card with the following code: > >> > > >> >get the rectangle of this stack > >> >put item 1 of it + the formattedWidth of this card into item 3 of it > >> >set the rectangle of this stack to it > >> > > >> >When you click the button, the stack will resize to the width of the > >> >field, > >> >in other words, the right edge of the field will still be off the right > >> >edge of the stack. The only way this works correctly is if the field's > >> >left edge is at the left edge of the stack. > >> > > >> >I'm sure this is way formattedWIdth has always worked so it's not > >>likely > >> >to > >> >be changed but it seems to be a not very useful implementation to me. > >> > > >> >Is there some other property that can be used to set the width of a > >>stack > >> >to something that really does include all the objects on it? > >> > > >> >Pete > >> >lcSQL Software <http://www.lcsql.com> > >> >Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and > >> >SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html> > >> >_______________________________________________ > >> >use-livecode mailing list > >> >use-livecode@lists.runrev.com > >> >Please visit this url to subscribe, unsubscribe and manage your > >> >subscription preferences: > >> >http://lists.runrev.com/mailman/listinfo/use-livecode > >> > >> > >> > >> _______________________________________________ > >> use-livecode mailing list > >> use-livecode@lists.runrev.com > >> Please visit this url to subscribe, unsubscribe and manage your > >> subscription preferences: > >> http://lists.runrev.com/mailman/listinfo/use-livecode > >> > >_______________________________________________ > >use-livecode mailing list > >use-livecode@lists.runrev.com > >Please visit this url to subscribe, unsubscribe and manage your > >subscription preferences: > >http://lists.runrev.com/mailman/listinfo/use-livecode > > > > _______________________________________________ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode > _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode