Hi Malte,
I can use ConstrainRectangular to move fields around inside a group of other fields (the rect of these grouped fields constitutes the constraint). However, when I try to make these groups into more complex objects (e.g. a group of a field and 2 graphics), I can't get the constrained group to move. I've taken the ConstrainRectangular property from the field and put it in the group, but the group just won't move. The group's lockLoc is false.
If I put a "grab me" inside a mouseDown of the group, then I can move the group inside the wider group. A mouseUp message goes to the group, but even with nothing but your "Constrain.." handlers inside the group nothing happens. In fact, a breakpoint on "constrainRectangularInit" is never triggered.
Is it that AnimationEngine is not supposed to work with grouped controls, or is there some property I'm missing?
Bernard
Constraining a group within a group's rectangle
Moderators: heatherlaine, kevinmiller, robinmiller, malte
Hi Bernard,
constraining groups is currently not supported. I will look into this for an update, but have to say this is tricky, due to the way the engine handles messages (you will not receive mouseDown in a group, if you click into an empty area for example). If one wants to take nesting into account this is even trickier. As a workaround, try to create a graphic on top of all controls in the group, set its ink to noop and update the locations of all controls in the group. I know this is some sort of pain, however at the moment the only solution I can think of.
Cheers,
Malte
constraining groups is currently not supported. I will look into this for an update, but have to say this is tricky, due to the way the engine handles messages (you will not receive mouseDown in a group, if you click into an empty area for example). If one wants to take nesting into account this is even trickier. As a workaround, try to create a graphic on top of all controls in the group, set its ink to noop and update the locations of all controls in the group. I know this is some sort of pain, however at the moment the only solution I can think of.
Cheers,
Malte