|
'Imports MindFusion.FlowChartX 'Imports System.Drawing 'Imports System.Drawing.Drawing2D
Private miUniqueCmdCount as Integer = 1 Private WFNodeWidth as Single = 40 Private WFNodeHeight as Single = 30
Private Sub btnWFUndo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnWFUndo.Click flwChart.UndoManager.Undo() End Sub
Private Sub btnWFAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnWFAdd.Click
Dim iTopLeft As Single = (flwChart.GridSize / 2) + flwChart.GridSize miUniqueCmdCount += 1 Dim cmd As Commands.CompositeCmd = flwChart.UndoManager.StartComposite("BoxAdd" + miUniqueCmdCount.ToString) Dim bx As MindFusion.FlowChartX.Box = flwChart.CreateBox(iTopLeft, iTopLeft, Constants.WFNodeWidth, Constants.WFNodeHeight) InitialiseWorkflowNode(flwChart, bx, System.Guid.NewGuid.ToString, True) cmd.Execute() End Sub
Public Sub InitialiseWorkflowNode(ByRef flwChart As FlowChart, ByRef bx As MindFusion.FlowChartX.Box, ByVal csiID as String, ByVal newBox As Boolean)
Dim alEmpty As New ArrayList Dim i As Integer Dim tbl As Table Dim grp As Group
bx.Tag = csiID bx.Text = vbCrLf + vbCrLf + csi.ProcessName
If newBox Then
bx.MnpHandlesMask = 256 bx.Resize(WFNodeWidth, WFNodeHeight) bx.SelStyle = ESelStyle.sstHatchHandles3
Dim alBX As New ArrayList
alBX.Add(New AnchorPoint(0, 0, True, True, EMarkStyle.msCircle, Color.Black)) alBX.Add(New AnchorPoint(25, 0, True, True, EMarkStyle.msCircle, Color.Black)) alBX.Add(New AnchorPoint(50, 0, True, True, EMarkStyle.msCircle, Color.Black)) alBX.Add(New AnchorPoint(75, 0, True, True, EMarkStyle.msCircle, Color.Black))
alBX.Add(New AnchorPoint(0, 25, True, True, EMarkStyle.msCircle, Color.Black)) alBX.Add(New AnchorPoint(0, 50, True, True, EMarkStyle.msCircle, Color.Black)) alBX.Add(New AnchorPoint(0, 75, True, True, EMarkStyle.msCircle, Color.Black)) alBX.Add(New AnchorPoint(0, 100, True, True, EMarkStyle.msCircle, Color.Black))
alBX.Add(New AnchorPoint(100, 0, True, True, EMarkStyle.msCircle, Color.Black)) alBX.Add(New AnchorPoint(100, 25, True, True, EMarkStyle.msCircle, Color.Black)) alBX.Add(New AnchorPoint(100, 50, True, True, EMarkStyle.msCircle, Color.Black)) alBX.Add(New AnchorPoint(100, 75, True, True, EMarkStyle.msCircle, Color.Black))
alBX.Add(New AnchorPoint(25, 100, True, True, EMarkStyle.msCircle, Color.Black)) alBX.Add(New AnchorPoint(50, 100, True, True, EMarkStyle.msCircle, Color.Black)) alBX.Add(New AnchorPoint(75, 100, True, True, EMarkStyle.msCircle, Color.Black)) alBX.Add(New AnchorPoint(100, 100, True, True, EMarkStyle.msCircle, Color.Black))
bx.AnchorPattern = New AnchorPattern(alBX.ToArray(GetType(AnchorPoint)))
tbl = flwChart.CreateTable(bx.BoundingRect.Location.X, bx.BoundingRect.Location.Y, WFNodeWidth, WFTableHeight) tbl.CaptionHeight = 8 tbl.RowsCount = 0 tbl.Locked = True tbl.Style = ETableStyle.tsRect tbl.ZIndex = bx.ZIndex + 1 tbl.AnchorPattern = Nothing tbl.ShadowOffsetX = 0 tbl.ShadowOffsetY = 0
tbl.PicturePos = EImagePos.imgCenterLeft Dim tbrush As New MindFusion.FlowChartX.LinearGradientBrush(Color.White, Color.DarkGoldenrod, 90) Dim blend As New ColorBlend(3)
blend.Colors(0) = Color.DarkGoldenrod blend.Colors(1) = Color.White blend.Colors(2) = Color.DarkGoldenrod
blend.Positions(0) = 0 blend.Positions(1) = 0.5 blend.Positions(2) = 1
tbrush.InterpolationColor = blend tbl.Brush = tbrush
grp = flwChart.CreateGroup(bx) grp.AttachToCorner(tbl, 0) grp.AutoDeleteItems = True
Else
tbl = bx.SubordinateGroup.AttachedObjects(0)
End If
tbl.Caption = "My Caption" 'tbl.Picture = SomePicture
bx.ToolTip = "My Tooltip"
End Sub
|