Print Page | Close Window

how to configure a connection in runtime

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Suite Pro
Forum Description: Topics Related to Codejock Suite Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=23525
Printed Date: 19 April 2024 at 3:51am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: how to configure a connection in runtime
Posted By: Rui
Subject: how to configure a connection in runtime
Date Posted: 15 December 2017 at 11:09am
How can i in run time configure a connection line between two nodes with a broken line, or a line that make 90ยบ degress ?
At design time it's easy to broke the line and make how we want, but i need to make it at run time.



Replies:
Posted By: olebed
Date Posted: 19 December 2017 at 12:29pm
Set pConnection = Page.Connections.Connection(0)
pConnection.Style = xtpFlowGraphConnectorCurvedArrow


Posted By: Rui
Date Posted: 20 December 2017 at 2:34pm
Maybe i didn't explain very well, I know how to make a connection in run time what i don't know is to make a connection like line like (see image) between node "test2" and "test3" or "test2 and "test4". At design time it's easy to change but in run time how i can do it like that ? It's a connection line but actually are two lines.





Posted By: olebed
Date Posted: 20 December 2017 at 3:42pm
For testing I have added my code in SelectAll menu item handler. So when I press in run time SelectAll then appropriate connection line change style to CurvedArrow.
You can save pointer to desired connection or search it by name, or get it by ID and then set new style.


Posted By: olebed
Date Posted: 21 December 2017 at 7:43pm


Dim connType As FlowGraphConnectorType

Private Sub mnuSelectAll_Click()
    'FlowGraph.SelectAll
    
    connType = connType + 1
    
    If connType > xtpFlowGraphConnectorElbowDoubleArrow Then
        connType = xtpFlowGraphConnectorStraight
    End If
    
    Dim Page As FlowGraphPage
    Set Page = FlowGraph.ActivePage
    
    Dim pConnection As FlowGraphConnection
    Dim i As Integer
    For i = 0 To Page.Connections.Count - 1
        
        Set pConnection = Page.Connections.Connection(i)
        pConnection.Style = connType
    Next i
End Sub



Posted By: Rui
Date Posted: 23 December 2017 at 1:13pm
It was really useful your answer, thank you, but i have one more question.
After i change a straight line to a elbow line in run time how can i access in code to the new elbow line properties ?


Posted By: olebed
Date Posted: 23 December 2017 at 1:39pm
Object of line still the same, you just change its style. So you can get it in the same way as before.

If you want to break straight line by code (not with mouse) - It isn't possible in ActiveX version.


Posted By: Rui
Date Posted: 27 December 2017 at 10:53am
Ok, thank you



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net