Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic diagram editor problem? (Read 3556 times)
Taivan
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 37
Joined: Jun 15th, 2012
diagram editor problem?
Jul 2nd, 2012 at 10:26am
Print Post  
Hi stoyan.

Thanks for all useful reply.

I have a problem Cheesy.

MyDiagram.Directions = AllDirections;
My project is user drag link diagram's left outside. It is resize the diagram and next create control node location seted cursor's mousePoint. It is wrong point.
I debug my event points are correct.

What should i do?
My user controlMain's Code is here :

<Grid x:Name="LayoutRoot" Background="White" MouseRightButtonDown="LayoutRoot_MouseRightButtonDown" ShowGridLines="False">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="300"></ColumnDefinition>
            <ColumnDefinition Width="*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <Grid Grid.Column="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="30" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <ScrollViewer Grid.Column="1" Grid.Row="1" HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Visible" IsTabStop="False">
                <my:Diagram x:Name="diagram" Behavior="DrawLinks" MouseRightButtonUp="diagram_MouseRightButtonUp" MouseMove="diagram_MouseMove" AutoResize="AllDirections" DelKeyAction="DeleteActiveItem" AutoAlignNodes="True"  AllowUnconnectedLinks="True"  HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Width="1000" LinkCreated="diagram_LinkCreated" LinkCreating="diagram_LinkCreating" />
            </ScrollViewer>
            <dxe:TrackBarEdit x:Name="trackZoom" HorizontalAlignment="Left" Height="20" Margin="5,4,0,0" Minimum="0" Maximum="1000" SmallStep="50" LargeStep="100" VerticalAlignment="Top" Width="189" />
        </Grid>
    </Grid>



thank u
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: diagram editor problem?
Reply #1 - Jul 2nd, 2012 at 12:55pm
Print Post  
Do you mean you are creating a node from the LinkCreated event raised for unconnected link? In such case, you can use e.Link.EndPoint as the node's position - it should already contain the diagram logical coordinate where the mouse was released.

If you are creating a node from some event raised by the base Control class, such as MouseLeftButtonUp, you will have to convert the mouse position to diagram coordinates by calling MouseButtonEventArgs.GetPosition(diagram.DocumentPlane).

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Taivan
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 37
Joined: Jun 15th, 2012
Re: diagram editor problem?
Reply #2 - Jul 4th, 2012 at 9:19am
Print Post  
THEEEEEEEENKS GOOD JOB
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint