Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Weird group behaviour (Read 2858 times)
p.hannah
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 38
Joined: Feb 1st, 2006
Weird group behaviour
May 11th, 2006 at 2:17am
Print Post  
Hi,

I have a group of three boxes (modelbox (50% transparent), graphicbox (100% opaque), textbox (100% transparent, black text)) which have zorder set so that modelbox>graphicbox>textbox.

The group is created using:

graphicBox.AttachTo(modelBox, 0, 0, 100, 100);
textBox.AttachTo(modelBox, 0, 100, 100, 150);

The first weird thing is that this line doesn't update the position of the attaching object until I move the modelbox in some way, then the two others jump to the attach position.

Also, when I move the textbox it allows me to move it around, and leaves it there until I move the modelbox again, whereby it snaps back to the above relative position.

The behaviour I was expecting was that the initial AttachTo would put the attaching box in the right place initially.  Moving the textbox would work as it does now, and then when modelbox is moved textbox keeps the new relative position.  I've solved this last problem myself by explicitly recaltulating the %'s and recalling AttachTo in the BoxModified handler.

The other problem is related to selection.  When the modelbox is selected, even though its zorder is higher than graphicbox, the graphicbox is shown on top (with the selection indicators around the modelbox.)

Thanks.
  
Back to top
 
IP Logged
 
p.hannah
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 38
Joined: Feb 1st, 2006
Re: Weird group behaviour
Reply #1 - May 11th, 2006 at 4:03am
Print Post  
P.S.

When multiple items are selected the z-order within the groups seem to function properly.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Weird group behaviour
Reply #2 - May 11th, 2006 at 8:21am
Print Post  
Hi,

The AttachTo(percents) method just follows the behavior of the AttachTo(corner/side) methods, where the positions of subordinated items are updated only when the master items is being moved around. You could set

masterBox.BoundingRect = masterBox.BoundingRect;

after creating the group to update the positions of attached items.

Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Weird group behaviour
Reply #3 - May 11th, 2006 at 8:27am
Print Post  
Quote:
The other problem is related to selection.  When the modelbox is selected, even though its zorder is higher than graphicbox, the graphicbox is shown on top (with the selection indicators around the modelbox.)


That is by design; we implemented grouping mostly to allow attaching labels and decorations to nodes, so the control draws attached items over their master item without considering the Z order. We can add a new parameter to the AttachTo methods to control that behavior.

Stoyan
  
Back to top
 
IP Logged
 
p.hannah
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 38
Joined: Feb 1st, 2006
Re: Weird group behaviour
Reply #4 - May 11th, 2006 at 8:30am
Print Post  
That would be perfect.

An AlwaysBelow/AlwaysAbove switch defaulting to AlwaysAbove would be perfect, and would allow me to remove quite a bit of my own code...

Is the different behaviour on multi-select built-in for another reason or an oversight?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Weird group behaviour
Reply #5 - May 11th, 2006 at 4:01pm
Print Post  
No one here can remember why the Z order is handled like that. Perhaps the idea was to show what items are attached to a selected master node and would move with it when the node is modified. We will make that more consistent with multiple selection with the new AttachTo argument.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint