Groups an attempt at understanding.
Posted: Mon May 27, 2019 3:00 pm
In a recent post I mentioned that I struggled to understand how some of the more advanced features of a LC group worked. So in an attempt to gain some insight I have created a stack that allows some properties of a simple group to be toggled on and off. The group comprises eight LC graphic objects with the option of adding and deleting a ninth.
The interaction between the rect of the group and the boundingRect of the group is worth experimenting with, it seems that setting are only applied when an object is added or deleted (and probably moved but I have not tried this). Confusion may occur if the scroll bars are scrolled when the boundingRect is set. Well it confuses me!
I am attaching my test stack as someone else may find it useful, however I make no claims for accuracy or correctness, so buyer beware.
I have two questions which I hope someone will answer:
1) Why does deleting an object from a group requires the use of a odd construct (see button add control ); the code linefails and throws an error when called from the mouseup handler. It requires that the mouseup handler finishes before the delete will work. This is achieved by putting the line in its own handler and using a send message from the mouseup.
Why is this needed and where else is it needed?
2) The object inspector of a group includes a boolean property named "resize". This may be toggled on or off but does not seem to do anything. I have not found a dictionary entry. I have not been able to set the value using code either in a handler or from the message box. Lastly the message box will only read the value once: what I mean is that the line will return either true or false when first called depending on what has been set in the property inspector. However, when the value is changed in the inspector the change is not returned by the line in the message box.
I apologise in advance for any "Schoolboy errors" that I have made.
best wishes
Simon
The interaction between the rect of the group and the boundingRect of the group is worth experimenting with, it seems that setting are only applied when an object is added or deleted (and probably moved but I have not tried this). Confusion may occur if the scroll bars are scrolled when the boundingRect is set. Well it confuses me!
I am attaching my test stack as someone else may find it useful, however I make no claims for accuracy or correctness, so buyer beware.
I have two questions which I hope someone will answer:
1) Why does deleting an object from a group requires the use of a odd construct (see button add control ); the code line
Code: Select all
delete graphic "OneExtra" of group "viewergroup"
Code: Select all
On mouseUp
Send "DeleteLast" to me in 0 seconds
end mouseUp
On DeleteLast
delete graphic "OneExtra" of group "viewergroup"
UpdateSizeAndLocationFields
end DeleteLast
2) The object inspector of a group includes a boolean property named "resize". This may be toggled on or off but does not seem to do anything. I have not found a dictionary entry. I have not been able to set the value using code either in a handler or from the message box. Lastly the message box will only read the value once: what I mean is that the line
Code: Select all
put the resize of group "my group"
I apologise in advance for any "Schoolboy errors" that I have made.
best wishes
Simon