Beispiel #1
0
        private VariableEditor createAndRegisterNewVariableEditor(Variable var)
        {
            VariableEditor ved = new VariableEditor();

            ved.setVariable(var);

            /*        int x = variableEditorPlaceholder.Location.X;
             *      int y = variableEditorPlaceholder.Location.Y + variableEditors.Count * (variableEditorPlaceholder.Height + 5);
             *      ved.Location = new Point(x, y);*/
            ved.variableDeleted += new EventHandler(ved_variableDeleted);
            //      ved.SizeChanged += new EventHandler(ved_SizeChanged);
            ved.valueChanged += new EventHandler(ved_valueChanged);
            variableEditors.Add(ved);
            return(ved);
        }
Beispiel #2
0
 void ved_variableDeleted(object sender, EventArgs e)
 {
     if (sender is VariableEditor)
     {
         VariableEditor ved = (VariableEditor)sender;
         // faster way to delete this variable from UI,
         // if we know which specific editor it was
         variableEditors.Remove(ved);
         variablesPanel.Controls.Remove(ved);
         ved.Dispose();
     }
     else
     {
         this.layout();
     }
 }
 private VariableEditor createAndRegisterNewVariableEditor(Variable var)
 {
     VariableEditor ved = new VariableEditor();
     ved.setVariable(var);
     /*        int x = variableEditorPlaceholder.Location.X;
             int y = variableEditorPlaceholder.Location.Y + variableEditors.Count * (variableEditorPlaceholder.Height + 5);
             ved.Location = new Point(x, y);*/
     ved.variableDeleted += new EventHandler(ved_variableDeleted);
     //      ved.SizeChanged += new EventHandler(ved_SizeChanged);
     ved.valueChanged += new EventHandler(ved_valueChanged);
     variableEditors.Add(ved);
     return ved;
 }