Пример #1
0
 private void tabsToSpacesToolStripMenuItem_Click(object sender, EventArgs e)
 {
     VROWorkFlow.WorkFlowItem wfi = multiTabs.SelectedTab.Tag as VROWorkFlow.WorkFlowItem;
     if (wfi != null)
     {
         RichTextBox rtb = multiTabs.SelectedTab.Controls["RTB-" + wfi.itemName] as RichTextBox;
         rtb.Text = rtb.Text.Replace("\t", "    ");
     }
 }
Пример #2
0
 private void NewTabPage(object sender, TabControlEventArgs e)
 {
     currentBox   = null;
     currentLabel = null;
     if (e.TabPage == null)
     {
         return;
     }
     System.Diagnostics.Debug.Print("New Tab : " + e.TabPage.Name + " Orig : " + multiTabs.SelectedTab.Name);
     if (e.TabPage.Tag != null)
     {
         VROWorkFlow.WorkFlowItem wfi = e.TabPage.Tag as VROWorkFlow.WorkFlowItem;
         currentBox   = e.TabPage.Controls["RTB-" + wfi.itemName] as RichTextBox;
         currentLabel = e.TabPage.Controls["LABEL-" + wfi.itemName] as Label;
         alternateNextToolStripMenuItem.Enabled = wfi.altOutItemName != null;
         buttonALTNEXT.Enabled         = alternateNextToolStripMenuItem.Enabled;
         nextToolStripMenuItem.Enabled = wfi.outItemName != null;
         buttonNEXT.Enabled            = nextToolStripMenuItem.Enabled;
         lastToolStripMenuItem.Enabled = false;
         buttonLAST.Enabled            = false;
         if (history.Count == 0 || history.Peek() != e.TabPage)
         {
             history.Push(e.TabPage);
         }
     }
     else
     {
         nextToolStripMenuItem.Enabled          = false;
         buttonNEXT.Enabled                     = false;
         lastToolStripMenuItem.Enabled          = false;
         buttonLAST.Enabled                     = false;
         alternateNextToolStripMenuItem.Enabled = false;
         buttonALTNEXT.Enabled                  = false;
     }
     if (history.Count > 1)
     {
         lastToolStripMenuItem.Enabled = true;
         buttonLAST.Enabled            = true;
     }
 }
Пример #3
0
 private void alternateNextToolStripMenuItem_Click(object sender, EventArgs e)
 {
     VROWorkFlow.WorkFlowItem cwfi = multiTabs.SelectedTab.Tag as VROWorkFlow.WorkFlowItem;
     multiTabs.SelectedTab = multiTabs.TabPages[cwfi.altOutItemName];
 }
Пример #4
0
        private void DisplayWorkFlowItems()
        {
            multiTabs.TabPages.Clear();
            RichTextBox box    = null;
            TextBox     sumBox = null;
            TabPage     page   = null;
            Label       lab    = null;

            String[] tabs = { "Inputs", "Attributes" }; // Removed Sequence
            //foreach (TabPage cPage in multiTabs.TabPages)
            //{
            //    cPage.Controls.Clear();
            //    multiTabs.TabPages.Remove(cPage);
            //}
            foreach (String tabName in tabs)
            {
                page      = new TabPage();
                page.Text = tabName;
                page.Name = tabName;
                box       = new RichTextBox();
                page.Controls.Add(box);
                multiTabs.TabPages.Add(page);
                CopyRTB(templateRTB, ref box, true);
                box.ContextMenuStrip = null;

                switch (tabName)
                {
                case "Inputs":
                    foreach (VROWorkFlow.Variables iVar in workflowitems.inputs.Values)
                    {
                        box.AppendText(iVar.ToString() + Environment.NewLine);
                    }
                    break;

                case "Attributes":
                    foreach (VROWorkFlow.Variables iVar in workflowitems.attribs.Values)
                    {
                        box.AppendText(iVar.ToString() + Environment.NewLine);
                    }
                    break;

                case "Sequence":
                    VROWorkFlow.WorkFlowItem wfi = workflowitems.workitems[workflowitems.rootItem];
                    box.AppendText("Root Item : " + wfi.ToString() + Environment.NewLine);
                    while (wfi.wfiType != "end")
                    {
                        wfi = workflowitems.workitems[wfi.outItemName];
                        box.AppendText("Next Item : " + wfi.ToString() + Environment.NewLine);
                    }
                    break;
                }
            }
            List <String> wfkeys = workflowitems.itemKeys.Keys.ToList();

            wfkeys.Sort();
            foreach (String key in wfkeys)
            {
                String wfiItemName = workflowitems.itemKeys[key];
                page = new TabPage();
                VROWorkFlow.WorkFlowItem wfi = workflowitems.workitems[wfiItemName];
                page.Text = wfi.displayName == null ? wfi.itemName : wfi.displayName;
                page.Tag  = wfi;
                page.Name = wfi.itemName;


                box          = new RichTextBox();
                box.Name     = "RTB-" + wfi.itemName;
                box.KeyDown += TextBoxMonitorKeyDown;
                box.KeyUp   += TextBoxMonitorKeyUp;
                box.Click   += RTBBoxClicked;
                sumBox       = new TextBox();
                sumBox.Name  = "SUMMARY-" + wfi.itemName;

                lab      = new Label();
                lab.Name = "LABEL-" + wfi.itemName;

                page.Controls.Add(sumBox);
                page.Controls.Add(box);
                page.Controls.Add(lab);
                multiTabs.TabPages.Add(page);

                CopyRTB(templateRTB, ref box);
                CopyBOX(templateSummary, ref sumBox);
                CopyLabel(PositionMarker, lab);

                box.Lines = wfi.lines;
                sumBox.AppendText(wfi.ToString() + Environment.NewLine);
                if (wfi.inputs.Count > 0)
                {
                    foreach (String eName in wfi.inputs.Keys)
                    {
                        sumBox.AppendText("Input : " + eName + " - " + wfi.inputs[eName].ToString() + Environment.NewLine);
                    }
                }
                if (wfi.outputs.Count > 0)
                {
                    foreach (String eName in wfi.outputs.Keys)
                    {
                        sumBox.AppendText("Output : " + eName + " - " + wfi.outputs[eName].ToString() + Environment.NewLine);
                    }
                }
            }
        }