Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic ZIndex questions (Read 1505 times)
Dexter
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 62
Joined: Jun 25th, 2009
ZIndex questions
Oct 22nd, 2009 at 8:41am
Print Post  
Hi there,

During creation of diagram items the zindex of it is not set. In the event diagram_nodeCreated the zindex of the node given in the event args has the zindex set to 0. In the node modified event the zindex value changes. I am not using containers or attached nodes. There are simple shapes nodes and table nodes.

Can you please help?

Regards,
Dexter
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ZIndex questions
Reply #1 - Oct 22nd, 2009 at 11:36am
Print Post  
Hi,

If you are trying to set ZIndex of all nodes to 0, that won't work. The ZIndex of diagram items corresponds to their position in the Diagram.Items collection. Once an item is added to the diagram,  it's ZIndex is kept to a unique value in the range 0..n-1, where n is the number of items. If in NodeCreated you set ZIndex to 0, this will shift the ZIndex of all other items.

Stoyan
  
Back to top
 
IP Logged
 
Dexter
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 62
Joined: Jun 25th, 2009
Re: ZIndex questions
Reply #2 - Oct 22nd, 2009 at 11:40am
Print Post  
I do not set any ZIndex values. So, to understand better, at creating a new diagram item and adding it to the collection of items the insert is actually at index 0? Because this is what I am seeing. Is this correct?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ZIndex questions
Reply #3 - Oct 22nd, 2009 at 11:51am
Print Post  
Nope, I'm seeing consecutive integers printed with this code while drawing nodes:

private void diagram_NodeCreated(object sender, NodeEventArgs e)
{
     Debug.WriteLine(e.Node.ZIndex);
}

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