Harry Potter's magic button - a solution to another tricky group bug

Wilhelm Sanke sanke at hrz.uni-kassel.de
Sat Aug 7 10:54:23 CDT 2010


On Sat Aug 7, 2010, Richard Gaskin ambassador at fourthworld.com wrote


> Wilhelm Sanke wrote:
>
> > Richard,
> >
> > Thanks for this really valuable information.
> >
> > "set the boundingrect of group x to the rect of group x" solves the
> > complete list of problems, the "setting" and "keeping" bugs are no
> > longer interfering and all side effects have gone away - like with the
> > magic button, but with even less effort.
>
> Yeah, the boundingRect property been a godsend on some projects, and I
> was quite pleased when Raney added it.  Makes short work of things that
> can get quite complicated without it.
>
> As much as I enjoy using Rev, there are a few things I miss from when
> when I was using SuperCard daily; this was one of them.
>
> > They must be a great amount of similarities between what the
> > boundingrect and the magic button achieve,  and if the Rev engineers
> > will still try to fix the "set the loc" bug they should also look how
> > the boundingrect is coded in the engine.
>
> I think I missed that bug - what's the RQCC#


The first post of this thread of August 3 was intended to be a first 
draft of the report. I did not yet submit the report as I wanted to see 
and possibly include relevant feedback from the list, which seems to be 
justified now.

> > The Revolution docs/dictionary should be updated to reflect the
> > dependency of "set the loc" in groups on the "boundingrect" property.
>
> Good idea - I've just added this note to the Dictionary entry for the
> location property:
>
>      If you encounter difficulties setting the loc of objects
>      within a group, see the boundingRect group property in
>      this dictionary.
>
> --
>   Richard Gaskin


I took a look at the comments in the Dictionary: Here are the comments:

> Use the boundingRect property to control how a group responds when you 
> move one of the group's controls to the edge of the group.
>
> Value:
> The boundingRect of a group consists of four integers separated by commas.
>
> By default, the boundingRect property of a group is set to empty.
>
> Comments:
> If a group's boundingRect is empty and its lockLocation is false, when 
> you drag an object toward the boundary of the group, the group 
> automatically expands, resizing itself to fit. If the lockLocation is 
> true, the object is clipped to the group's rectangle.
>
> If a group's boundingRect is not empty and its lockLocation is false, 
> when you drag an object toward the boundary of the group, the group 
> does not automatically resize to fit its objects. Instead, the object 
> is clipped at the boundingRect. (In group-editing mode, the entire 
> control is shown, but when you exit group-editing mode, controls 
> outside the boundingRect are clipped.)
>
> If the group is a scrolling group, dragging an object in it 
> automatically scrolls the group. When you drag beyond the scrollable 
> area, the object is clipped.

Some remarks to these comments:

I doubt that a user could see any indication of  the problem of setting 
and keeping the loc in groups in these comments.

Setting the loc of an object is not mentioned.

There seems to be no difference between "boundingrect empty and 
locLocation true" and "boundingrect not empty and lockLocation false", 
the option of "boundingrect not empty and lockLocaction true", which 
would describe the properties of the group as I use it now, is absent in 
the comments.

I could *not* verify the last sentence of the comments: "If the group is 
a scrolling group, dragging an object in it automatically scrolls the 
group".

I think this entry for "boundingrect" in the docs needs to be updated, 
too. And I also recommend to change the note for entry "location" to

"If you want to set the loc of an object inside a group reliably, set 
the boundingrect of the group to the rect of the group".-

If the boundingrect of a group is such a powerful property I wonder why 
the default for groups isn't "boundingrect not empty" and is 
automatically set to the coordinates when a group is created or resized ?

I will test which of the other bugs in my substantial collection of 
group bugs is positively affected by using the "boundingrect" property.

Regards,

Wilhelm Sanke




More information about the use-livecode mailing list