private void DrawParams() { using (Cell.Padded(5, 5, 5, 5)) { using (Cell.LineStd) Draw.Field(ref varName, "Name"); using (Cell.LineStd) Draw.PopupSelector(ref varType, types, typeNames, "Type"); Cell.EmptyLine(); using (Cell.LinePx(22)) { Cell.EmptyRow(); using (Cell.RowPx(70)) { Cell.current.disabled = name.Length != 0; //could not be pressed while expression is not valid if (Draw.Button("OK")) { ovd.Add(varName, varType, varType.IsValueType ? Activator.CreateInstance(varType) : null); Close(); GraphWindow.RefreshMapMagic(); Extensions.GetInspectorWindow()?.Repaint(); } } Cell.EmptyRowPx(10); using (Cell.RowPx(70)) if (Draw.Button("Cancel")) { Close(); } } } }