Esempio n. 1
0
        // Get the text from a pop-up dialog and then set it?
        public override bool setText(int x, int y, Visual_Flow_Form form)
        {
            bool successor_settext = false;
            bool before_settext    = false;
            bool after_settext     = false;

            bool textset = false;

            //if (over_Diamond(x,y))
            if (contains(x, y))
            {
                Control_Dlg CD = new Control_Dlg(this, form, true);
                CD.ShowDialog();
                textset = true;
                return(textset);
            }

            if (this.Successor != null)
            {
                successor_settext = this.Successor.setText(x, y, form);
            }

            if (this.before_Child != null)
            {
                before_settext = this.before_Child.setText(x, y, form);
            }
            if (this.after_Child != null)
            {
                after_settext = this.after_Child.setText(x, y, form);
            }

            return(successor_settext || before_settext || after_settext);
        }
Esempio n. 2
0
        // Get the text from a pop-up dialog and then set it?
        public override bool setText(int x, int y, Visual_Flow_Form form)
        {
            bool textset = false;

            if (contains(x, y))
            {
                if (this.kind == Kind_Of.Assignment)
                {
                    Assignment_Dlg AD = new Assignment_Dlg(this, form);
                    AD.ShowDialog();
                }
                else
                {
                    Call_Dialog CD = new Call_Dialog(this, form);
                    CD.ShowDialog();
                }


                textset = true;
                return(textset);
            }

            if (this.Successor != null)
            {
                return(this.Successor.setText(x, y, form));
            }

            return(textset);
        }
Esempio n. 3
0
        // Get the text from a pop-up dialog and then set it?
        public override bool setText(int x, int y, Visual_Flow_Form form)
        {
            bool textset = false;

            if (contains(x, y))
            {
                if (this.is_input)
                {
                    Input_Dlg IOD = new Input_Dlg(this, form);
                    IOD.ShowDialog();
                }
                else
                {
                    Output_Dlg IOD = new Output_Dlg(this, form);
                    IOD.ShowDialog();
                }
                textset = true;
                return(textset);
            }

            if (this.Successor != null)
            {
                return(this.Successor.setText(x, y, form));
            }

            return(textset);
        }
Esempio n. 4
0
        public static void Make_Undoable(Visual_Flow_Form form)
        {
            Subchart current = form.selectedTabMaybeNull();

            if (current == null)
            {
                return;
            }
            Action new_action;
            bool   was_enabled;

            new_action       = new Action();
            new_action.clone = current.Start.Clone();
            new_action.kind  = Action_Kind.Change_Tab;
            new_action.chart = current;
            if (!Component.BARTPE && !Component.VM && !Component.MONO)
            {
                was_enabled = new_action.chart.tab_overlay.Enabled;
                new_action.chart.tab_overlay.Enabled = false;
                new_action.ink = new_action.chart.tab_overlay.Ink.Clone();
                new_action.chart.tab_overlay.Enabled = was_enabled;
            }
            Add_Undo_Action(new_action, form);
            Clear_Redo(form);
        }
Esempio n. 5
0
        // Get the text from a pop-up dialog and then set it?
        public override bool setText(int x, int y, Visual_Flow_Form form)
        {
            bool successor_settext = false;
            bool left_settext      = false;
            bool right_settext     = false;

            bool textset = false;

            if (contains(x, y))
            {
                Control_Dlg CD = new Control_Dlg(this, form, false);
                CD.ShowDialog();
                textset = true;
                return(textset);
            }

            if (this.Successor != null)
            {
                successor_settext = this.Successor.setText(x, y, form);
            }

            if (this.left_Child != null && !this.is_compressed)
            {
                left_settext = this.left_Child.setText(x, y, form);
            }
            if (this.right_Child != null && !this.is_compressed)
            {
                right_settext = this.right_Child.setText(x, y, form);
            }

            return(successor_settext || left_settext || right_settext);
        }
Esempio n. 6
0
        public string RunDialog(string name, Visual_Flow_Form form)
        {
            string result = ((Oval_Procedure)this.Start).RunDialog(name, form);

            this.flow_panel.Invalidate();
            return(result);
        }
Esempio n. 7
0
        public Assignment_Dlg(Rectangle parent_Rec, Visual_Flow_Form form)
        {
            int index;

            Rec      = parent_Rec;
            the_form = form;
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            Dialog_Helpers.Init();
            this.label1.Text = "Enter an assignment." +
                               '\n' + '\n' + "Examples:" + '\n' + "   Set Coins to 5" +
                               '\n' + "   Set Count to Count + 1" +
                               '\n' + "   Set Board[3,3] to 0";
            this.labelGraphics = label2.CreateGraphics();
            if (Rec.Text != null)
            {
                index = Rec.Text.IndexOf(":=");
                if (index > 0)
                {
                    this.lhsTextBox.Text      = Rec.Text.Substring(0, index);
                    this.assignment_Text.Text =
                        Rec.Text.Substring(index + 2,
                                           Rec.Text.Length - (index + 2));
                }
                else
                {
                    this.lhsTextBox.Text = Rec.Text;
                }
            }
        }
Esempio n. 8
0
 public static void Update_MRU_Menus(Visual_Flow_Form form)
 {
     try
     {
         RegistryKey HKCU     = Registry.CurrentUser;
         RegistryKey Software = HKCU.OpenSubKey("Software");
         RegistryKey Raptor   = Software.OpenSubKey("Raptor");
         string      MRU1     = (string)Raptor.GetValue("MRU1");
         form.menuMRU1.Text = "&1 - " + MRU1;
         string MRU2 = (string)Raptor.GetValue("MRU2");
         form.menuMRU2.Text = "&2 - " + MRU2;
         string MRU3 = (string)Raptor.GetValue("MRU3");
         form.menuMRU3.Text = "&3 - " + MRU3;
         string MRU4 = (string)Raptor.GetValue("MRU4");
         form.menuMRU4.Text = "&4 - " + MRU4;
         string MRU5 = (string)Raptor.GetValue("MRU5");
         form.menuMRU5.Text = "&5 - " + MRU5;
         string MRU6 = (string)Raptor.GetValue("MRU6");
         form.menuMRU6.Text = "&6 - " + MRU6;
         string MRU7 = (string)Raptor.GetValue("MRU7");
         form.menuMRU7.Text = "&7 - " + MRU7;
         string MRU8 = (string)Raptor.GetValue("MRU8");
         form.menuMRU8.Text = "&8 - " + MRU8;
         string MRU9 = (string)Raptor.GetValue("MRU9");
         form.menuMRU9.Text = "&9 - " + MRU9;
     }
     catch
     {
     }
 }
Esempio n. 9
0
 // copy selected objects
 public override bool copy(Visual_Flow_Form VF)
 {
     if (this.selected)
     {
         return(base.copy(VF));
     }
     else
     {
         if (this.before_Child != null)
         {
             if (this.before_Child.copy(VF))
             {
                 return(true);
             }
         }
         if (this.after_Child != null)
         {
             if (this.after_Child.copy(VF))
             {
                 return(true);
             }
         }
         if (this.Successor != null)
         {
             return(this.Successor.copy(VF));
         }
         else
         {
             return(false);
         }
     }
 }
Esempio n. 10
0
        protected void initialize(Visual_Flow_Form the_form, string s)
        {
            form      = the_form;
            this.Text = s;

            this.panel1     = new System.Windows.Forms.Panel();
            this.flow_panel = new raptor.Buffered();
            //
            // panel1
            //
            this.panel1.AutoScroll = true;
            this.panel1.BackColor  = System.Drawing.SystemColors.Window;
            this.panel1.Controls.Add(this.flow_panel);
            this.panel1.Dock     = System.Windows.Forms.DockStyle.Fill;
            this.panel1.Location = new System.Drawing.Point(136, 32);
            this.panel1.Name     = "panel1";
            this.panel1.Size     = new System.Drawing.Size(578, 480);
            this.panel1.TabIndex = 3;

            //
            // flow_panel
            //
            this.flow_panel.AllowDrop        = true;
            this.flow_panel.AutoScrollMargin = new System.Drawing.Size(5, 5);
            this.flow_panel.BackColor        = System.Drawing.SystemColors.Window;
            this.flow_panel.Location         = new System.Drawing.Point(0, 0);
            this.flow_panel.Name             = "flow_panel";
            this.flow_panel.Size             = new System.Drawing.Size(512, 296);
            this.flow_panel.TabIndex         = 2;
            this.flow_panel.MouseUp         += new System.Windows.Forms.MouseEventHandler(this.flow_panel_MouseUp);
            this.flow_panel.Paint           += new System.Windows.Forms.PaintEventHandler(this.flow_panel_Paint);
            this.flow_panel.MouseEnter      += new System.EventHandler(this.flow_panel_MouseEnter);
            this.flow_panel.Leave           += new System.EventHandler(this.flow_panel_Leave);
            this.flow_panel.DoubleClick     += new System.EventHandler(this.flow_dbl_Click);
            this.flow_panel.MouseMove       += new System.Windows.Forms.MouseEventHandler(this.Set_Hover);
            this.flow_panel.MouseLeave      += new System.EventHandler(this.flow_panel_MouseLeave);
            this.flow_panel.MouseDown       += new System.Windows.Forms.MouseEventHandler(this.select_flow_shape);
            this.flow_panel.DragDrop        += new DragEventHandler(carlisle_DragDrop);
            this.flow_panel.DragEnter       += new DragEventHandler(carlisle_DragEnter);
            this.flow_panel.DragOver        += new DragEventHandler(carlisle_DragOver);

            form.GiveFeedback += new GiveFeedbackEventHandler(form_GiveFeedback);
            this.GiveFeedback += new GiveFeedbackEventHandler(carlisle_GiveFeedback);
            ((System.Windows.Forms.Control)flow_panel).KeyDown +=
                new System.Windows.Forms.KeyEventHandler(form.Visual_Flow_Form_KeyDown);
            this.Controls.Add(this.panel1);
            End = new Oval(Visual_Flow_Form.flow_height, Visual_Flow_Form.flow_width, "Oval");
            if (!Component.USMA_mode)
            {
                End.Text = "End";
            }
            else
            {
                End.Text = "Stop";
            }
        }
Esempio n. 11
0
        public static string RunDialog(string s, Visual_Flow_Form the_form)
        {
            Subchart_name dialog = new Subchart_name();

            dialog.textBox1.Text = s;
            dialog.init_name     = s.ToLower();
            dialog.form          = the_form;
            dialog.ShowDialog();
            return(result);
        }
Esempio n. 12
0
 public static void Clear_Undo(Visual_Flow_Form form)
 {
     num_undo = 0;
     num_redo = 0;
     form.redoButton.ImageIndex = No_Redo;
     form.menuItemRedo.Enabled  = false;
     form.undoButton.ImageIndex = No_Undo;
     form.menuItemUndo.Enabled  = false;
     form.modified = false;
 }
Esempio n. 13
0
 public static void Decrement_Undoable(Visual_Flow_Form form)
 {
     num_undo--;
     if (num_undo < 1)
     {
         form.undoButton.ImageIndex = No_Undo;
         form.menuItemUndo.Enabled  = false;
         form.modified = false;
     }
 }
Esempio n. 14
0
        // Get the text from a pop-up dialog and then set it?
        public void setText(Visual_Flow_Form form)
        {
            Comment_Dlg CD = new Comment_Dlg(this, form);

            CD.ShowDialog();
            if (this.text_change)
            {
                this.resize(form.CreateGraphics());
                this.text_change = false;
            }
        }
Esempio n. 15
0
 private static void Decrement_Redoable(Visual_Flow_Form form)
 {
     num_redo--;
     if (num_redo < 1)
     {
         form.redoButton.ImageIndex = No_Redo;
         form.menuItemRedo.Enabled  = false;
         form.modified = false;
         num_redo      = 0;
     }
 }
Esempio n. 16
0
        public static void Make_Delete_Tab_Undoable(Visual_Flow_Form form, Subchart chart)
        {
            Action new_action;

            form.modified    = true;
            new_action       = new Action();
            new_action.kind  = Action_Kind.Delete_Tab;
            new_action.chart = chart;
            Add_Undo_Action(new_action, form);
            Clear_Redo(form);
        }
Esempio n. 17
0
        public string RunDialog(string name, Visual_Flow_Form form)
        {
            string result;

            result = Procedure_name.RunDialog(name, ref param_names, ref param_is_input, ref param_is_output,
                                              form);
            if (result != null && result != "")
            {
                num_params = param_is_output.Length;
                this.SetText();
            }
            return(result);
        }
Esempio n. 18
0
        public static void Make_Rename_Tab_Undoable(Visual_Flow_Form form, Subchart chart,
                                                    string old_name, string new_name)
        {
            Action new_action;

            form.modified       = true;
            new_action          = new Action();
            new_action.kind     = Action_Kind.Rename_Tab;
            new_action.new_name = new_name;
            new_action.old_name = old_name;
            new_action.chart    = chart;
            Add_Undo_Action(new_action, form);
            Clear_Redo(form);
        }
Esempio n. 19
0
 private static void Add_Redo_Action(Action new_action, Visual_Flow_Form form)
 {
     num_redo++;
     form.redoButton.ImageIndex = Can_Redo;
     form.menuItemRedo.Enabled  = true;
     if (num_redo - 1 >= Redo_array.Count)
     {
         Redo_array.Add(new_action);
     }
     else
     {
         Redo_array[num_redo - 1] = new_action;
     }
 }
Esempio n. 20
0
 public Comment_Dlg(CommentBox CBpointer, Visual_Flow_Form form)
 {
     //
     // Required for Windows Form Designer support
     //
     CB       = CBpointer;
     the_form = form;
     InitializeComponent();
     this.label1.Text = "Enter the desired line(s) of comments.";
     if (CB.Text_Array != null)
     {
         this.textBox1.Lines = CB.Text_Array;
         this.textBox1.Select(this.textBox1.Text.Length, 0);
     }
 }
Esempio n. 21
0
 public Procedure_Chart(Visual_Flow_Form the_form, string name, int param_count)
 {
     this.initialize(the_form, name);
     Start = new Oval_Procedure(End, Visual_Flow_Form.flow_height, Visual_Flow_Form.flow_width, "Oval",
                                param_count);
     Start.Text  = "Start";
     Start.scale = form.scale;
     Start.Scale(form.scale);
     this.flow_panel.Invalidate();
     this.kind = Subchart_Kinds.Procedure;
     if (!Component.MONO)
     {
         this.Initialize_Ink();
     }
 }
Esempio n. 22
0
        public Procedure_Chart(Visual_Flow_Form the_form, string name, string[] incoming_param_names,
                               bool[] is_input, bool[] is_output)
        {
            this.initialize(the_form, name);

            Start = new Oval_Procedure(End, Visual_Flow_Form.flow_height, Visual_Flow_Form.flow_width, "Oval",
                                       incoming_param_names, is_input, is_output);
            Start.scale = form.scale;
            Start.Scale(form.scale);
            this.flow_panel.Invalidate();
            this.kind = Subchart_Kinds.Procedure;
            if (!Component.MONO)
            {
                this.Initialize_Ink();
            }
        }
Esempio n. 23
0
        public Subchart(Visual_Flow_Form the_form, string s) : base()
        {
            this.initialize(the_form, s);
            Start       = new Oval(End, Visual_Flow_Form.flow_height, Visual_Flow_Form.flow_width, "Oval");
            Start.Text  = "Start";
            Start.scale = form.scale;
            Start.Scale(form.scale);

            if (!Component.MONO)
            {
                Initialize_Ink();
            }

            this.flow_panel.Invalidate();
            this.kind = Subchart_Kinds.Subchart;
        }
Esempio n. 24
0
        public override bool setText(int x, int y, Visual_Flow_Form form)
        {
            if (contains(x, y))
            {
                Return_Dlg IOD = new Return_Dlg(this, form);
                IOD.ShowDialog();
                return(true);
            }

            if (this.Successor != null)
            {
                return(this.Successor.setText(x, y, form));
            }

            return(false);
        }
Esempio n. 25
0
        // Get the text from a pop-up dialog and then set it?
        public override bool setText(int x, int y, Visual_Flow_Form form)
        {
            bool textset = false;

            if (contains(x, y))
            {
                textset = true;
                return(textset);
            }

            if (this.Successor != null)
            {
                return(this.Successor.setText(x, y, form));
            }

            return(textset);
        }
Esempio n. 26
0
        // copy selected objects
        public virtual bool copy(Visual_Flow_Form VF)
        {
            // can't copy if compiled
            if (Component.compiled_flowchart)
            {
                return(false);
            }
            Component end_selection;

            if (this.selected)
            {
                end_selection = this.find_selection_end();
                if (end_selection.Successor != null)
                {
                    Component temp = end_selection.Successor;
                    end_selection.Successor = null;

                    Component tempobj = this.Clone();
                    tempobj.reset();

                    VF.clipboard            = tempobj;
                    end_selection.Successor = temp;
                    return(true);
                }
                else
                {
                    Component tempobj = this.Clone();
                    tempobj.reset();

                    VF.clipboard = tempobj;
                    return(true);
                }
            }
            else
            {
                if (this.Successor != null)
                {
                    return(this.Successor.copy(VF));
                }
                else
                {
                    return(false);
                }
            }
        }
Esempio n. 27
0
        public Return_Dlg(Oval_Return Parent_Oval, Visual_Flow_Form form)
        {
            RETURN   = Parent_Oval;
            the_form = form;
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            Dialog_Helpers.Init();
            if ((RETURN.Text != null) && (RETURN.Text.CompareTo("") != 0))
            {
                this.textBox1.Text = RETURN.Text;
            }
            this.labelGraphics = label4.CreateGraphics();
            stringFormat       = new System.Drawing.StringFormat();

            // Center the block of text (top to bottom) in the rectangle.
            stringFormat.LineAlignment = System.Drawing.StringAlignment.Center;
        }
Esempio n. 28
0
        public Call_Dialog(Rectangle parent_Rec, Visual_Flow_Form form)
        {
            Rec      = parent_Rec;
            the_form = form;
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            Dialog_Helpers.Init();

            this.label1.Text = "Enter a procedure call." +
                               '\n' + '\n' + "Examples:" + '\n' + "   Wait_For_Mouse_Button(Left_Button)" +
                               '\n' + "   Open_Graph_Window(300,300)";
            this.labelGraphics = label2.CreateGraphics();
            if (Rec.Text != null)
            {
                this.assignment_Text.Text = Rec.Text;
            }
        }
Esempio n. 29
0
        public static void Load_Generators(Visual_Flow_Form form)
        {
            System.IO.DirectoryInfo exe_path = Directory.GetParent(
                System.Windows.Forms.Application.ExecutablePath);
            System.IO.FileInfo[] files = exe_path.GetFiles("generator*.dll");
            Assembly             assembly;

            for (int i = 0; i < files.Length; i++)
            {
                try
                {
                    assembly = Assembly.LoadFrom(files[i].FullName);
                    Process_Assembly(form, assembly);
                }
                catch
                {
                }
            }
        }
Esempio n. 30
0
		// Get the comment text from a pop-up dialog and then set it?
		public virtual void addComment(Visual_Flow_Form form)
		{
			if (this.My_Comment == null)
			{
				form.Make_Undoable();
				this.My_Comment = new CommentBox(this);
				if (this.drawing_text_width > this.W)
				{
					this.My_Comment.X = (int) (((float) (this.drawing_text_width/2 + 20))/form.scale);
				}
				else
				{
					this.My_Comment.X = (int) (((float) (this.W/2+20))/form.scale);
				}
				this.My_Comment.Y = 0;
				this.My_Comment.Scale(form.scale);
			}
			this.My_Comment.setText(form);
		}