Ejemplo n.º 1
0
 private void Insert_Figure(Component c)
 {
     form.Make_Undoable();
     if (Start.insert(c, form.mouse_x, form.mouse_y, 0))
     {
         this.Current_Selection = Start.select(-1000, -1000);
     }
     else
     {
         Undo_Stack.Decrement_Undoable(form);
         this.Current_Selection = Start.select(form.mouse_x, form.mouse_y);
     }
 }
Ejemplo n.º 2
0
        private bool CreateNewTab(string s)
        {
            for (int i = 0; i < s.Length; i++)
            {
                if (!(Char.IsLetterOrDigit(s[i]) || s[i] == '_'))
                {
                    return(false);
                }
            }
            if (!Char.IsLetter(s, 0) || !token_helpers_pkg.verify_id(s))
            {
                return(false);
            }
            DialogResult dialog_result = MessageBox.Show("Do you wish to create a new tab named "
                                                         + s, "Create new tab?", MessageBoxButtons.YesNo);

            if (dialog_result == DialogResult.Yes)
            {
                Subchart sc = new Subchart(the_form, s);
                Undo_Stack.Make_Add_Tab_Undoable(the_form, sc);
                the_form.Make_Undoable();
                the_form.carlisle.TabPages.Add(sc);
                result = interpreter_pkg.call_syntax(this.assignment_Text.Text, Rec);
                the_form.carlisle.SelectedTab = sc;
                Rec.Text       = this.assignment_Text.Text;
                Rec.parse_tree = result.tree;
                this.error     = false;
                Rec.changed();
                ((Visual_Flow_Form)the_form).flow_panel.Invalidate();
                this.Close();
                return(true);
            }
            else
            {
                return(false);
            }
        }