Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Workflow Designer (Read 5736 times)
Peyman
YaBB Newbies
*
Offline


I Really Love MindFusion!

Posts: 12
Joined: Mar 4th, 2013
Workflow Designer
Mar 4th, 2013 at 10:17am
Print Post  
Hi,
after web searchs in internet i find your component for my program idea and download pro (still in trial).
but after 4 days i cant achive my idea Sad (my idea is similar to Workflow Designer Demo in Wpf section) so i want know
there is a possible way to implement Workflow Designer with Activex ? if yes you have any vb sample code ? or a piece of code ?
atall its a amazing component

thx for answer,
Peyman.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Workflow Designer
Reply #1 - Mar 4th, 2013 at 11:09am
Print Post  
Hi,

You can see how to implement drag-and-drop in the "Drag and Drop" and "More Drag and Drop" VB sample projects. This modification of the latter shows how to insert a node, splitting an existing link into two new ones, which happens in the WPF WorkflowDesigner example:

Code
Select All
Private Sub FlowChart1_DropInDocVB(ByVal dataObj As FLOWCHARTLibCtl.IVBDataObject, ByVal docX As Long, ByVal docY As Long, ByVal keyState As Long, effect As Long)
    Dim s As String
    Dim b As FLOWCHARTLibCtl.box
    Dim i As Integer

    Dim a As arrow
    Set a = FlowChart1.GetArrowAt(docX, docY)

    If dataObj.GetFormat(vbCFFiles) Then
        'some file are dropped
        For i = 0 To dataObj.FileCount - 1
            s = dataObj.Files(i)
            Set b = FlowChart1.CreateBox(docX + i * 10, docY + i * 50, 250, 40)
            b.Text = s
        Next i
    Else
        'some text is dropped
        s = dataObj.GetData(vbCFText)
        Set b = FlowChart1.CreateBox(docX, docY, 100, 100)
        b.Text = s

        If Not a Is Nothing Then
            SplitLink a, b
        End If
    End If

    effect = vbDropEffectCopy
End Sub

Sub SplitLink(a As arrow, b As box)
    Dim a2 As arrow
    Set a2 = FlowChart1.CreateArrow(b, a.DestinationBox)
    a.Destination = b
End Sub 



If you are interested in the sample layout code, it should be pretty straightforward to port. Our controls' API has evolved a lot since the ActiveX days, but you can still find one-to-one correspondence between the WPF and ActiveX members. E.g. a node.Bounds assignment will become a call to box.SetRect, and link.ControlPoints assignments will become arrow.CtrlPtX/Y assignments.

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


I Really Love MindFusion!

Posts: 12
Joined: Mar 4th, 2013
Re: Workflow Designer
Reply #2 - Mar 4th, 2013 at 5:59pm
Print Post  
thanks stoyo for quick answer and infos im going to download WorkFlow designer and try to convert it, maybe you can add this example in next version of Activex Smiley
thx anyway

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