Results 1 to 2 of 2

Thread: Organization chart

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2009
    Granada (Spain)

    Default Organization chart


    I need to implement in a one of my windows application (DataFlex 19.1) the option that the user can create a simple organization chart.
    I've created an organization chart whit the FlowGraphSample.exe, save it to xml file and I've been playng whit the codejock flowgraph control.

    I have not found any information for this control in the forum and the only guide I have had has been the source code provided by codejock in VB.
    Nevertheless, I've been able to implement somme options.

    I attach the view and the xml file with my progress on this.

    I am not able to find a way to translate certain code from VB to DataFlex.

    For example, how to implement this VB code to distinguish if what is selected is a NODE or a CONNECTOR??
    If TypeOf FlowGraph.HitTest(cX, cY) is FlowGraphNodeCustom or TypeOf FlowGraph.HitTest(cX, cY) is FlowGraphNode Then
         Set ContextNode = FlowGraph.HitTest(cX, cY)
         If TypeOf ContextNode is FlowGraphNodeCustom Then
             PropertyGrid.UpdateFromNodeCustom ContextNode
             Exit Sub
         End If
         If TypeOf ContextNode is FlowGraphNode Then
             PropertyGrid.UpdateFromNode ContextNode
             Exit Sub
         End If
     ElseIf TypeOf FlowGraph.HitTest(cX, cY) is FlowGraphConnection Then
         Set ContextConnection = FlowGraph.HitTest(cX, cY)
         If not ContextConnection is Nothing Then
             PropertyGrid.UpdateFromConnection ContextConnection
         End If
         Exit Sub
     End If

    Also not luck whit the option to create a new node.
              VB code from FlowGraphSample    
    Public Function AddCustomFlowGraphShape(nResShapeID as Long, x, y, sX, sY) as FlowGraphNodeCustom
        Dim pNode as FlowGraphNodeCustom
        Set pNode = FlowGraph.ActivePage.Nodes.AddResourceNode(nResShapeID)
        If not pNode is Nothing Then
            pNode.LocationX = x
            pNode.LocationY = y
            pNode.Width = sX
            pNode.Height = sY
            'pNode.CaptionPosition = xtpFlowGraphCustomNodeCaptionBelow
            'pNode.Caption = "New Node"
            'pNode.Tooltip = "New Node"
        End If
        Set AddCustomFlowGraphShape = pNode
    End Function
    I appreciate any help to resolve these issues.

    Best regards
    Attached Files Attached Files

    Antonio Jiménez
    Granada (Spain)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts