Re: Organization chart
Hi,
Finally, I've been found the way to add nodes!!!
Here you are the rigth code:
Code:
Procedure DoAddNodo
Handle hoFlowGraphPaintManager hoFlowGraphPage hoNode hoFlowGraphNodes
Variant vActivePage vPaintManager vNodes vAddResourceNode
Get ComActivePage of oComFlowGraph to vActivePage
Get ComPaintManager of oComFlowGraph to vPaintManager
Get Create (RefClass(cComFlowGraphPaintManager)) to hoFlowGraphPaintManager
Set pvComObject of hoFlowGraphPaintManager to vPaintManager
Set ComConnectorType of hoFlowGraphPaintManager to OLExtpFlowGraphConnectorStraight
Set ComConnectionColor of hoFlowGraphPaintManager to clRed
Set ComNodeBackgroundColor of hoFlowGraphPaintManager to clWhite
Get Create (RefClass(cComFlowGraphPage)) to hoFlowGraphPage
Set pvComObject of hoFlowGraphPage to vActivePage
Get ComNodes of hoFlowGraphPage to vNodes
Get Create (RefClass(cComFlowGraphNodeCustom)) to hoNode
Get Create (RefClass(cComFlowGraphNodes)) to hoFlowGraphNodes
Set pvComObject of hoFlowGraphNodes to vNodes
Get ComAddResourceNode of hoFlowGraphNodes OLExtpFlowGraphShapeRectangleRounded to vAddResourceNode
Set pvComObject of hoNode to vAddResourceNode
Set ComCaptionPosition of hoNode to OLExtpFlowGraphCustomNodeCaptionCenter
Set ComLocationX of hoNode to 1
Set ComLocationY of hoNode to 1
Set ComHeight of hoNode to 30
Set ComWidth of hoNode to 200
Set ComCaption of hoNode to "Nuevo Nodo"
Set ComColor of hoNode to clWhite
Get ComAddCustomNode of hoFlowGraphNodes to vAddResourceNode
Send ComRedrawControl of oComFlowGraph
Send Destroy of hoFlowGraphNodes
Send Destroy of hoNode
Send Destroy of hoFlowGraphPage
Send Destroy of hoFlowGraphPaintManager
End_Procedure
Now, all I have to do is to find a way to distinguish between node and connector!!
Regards,
Antonio Jiménez
Granada (Spain)