void __newFoldout_OnClick(IUEditorWidgetClickable sender, System.EventArgs e) { if (this._controlKeyPressed) { UEditorWidgetBase __castSender = (UEditorWidgetBase)sender; //TODO: if the current object is the root form bail out!!!!! //Is the selected widget a container if (__castSender.BoundObject.GetType().IsSubclassOf(typeof(UEditorPanelBase)) || __castSender.BoundObject.GetType().IsSubclassOf(typeof(UEditorPanelBase))) { IWidgetContainer __newParent = (IWidgetContainer)__castSender.BoundObject; UEditorWidgetBase __widgetToMove = (UEditorWidgetBase)this.SelectedFoldout.BoundObject; IWidgetContainer __oldParent = ((UEditorWidgetBase)this.SelectedFoldout.BoundObject).parent; __oldParent.RemoveChild(__widgetToMove); __newParent.AddChild(__widgetToMove); } } //Update the selected foldout //TODO: Consider wrapping some type saftey around this this.SelectedFoldout = (UEditorWidgetFoldout)sender; }
void _btnRemoveWidget_OnClick(IUEditorWidgetClickable sender, System.EventArgs e) { if (Canvas.SelectedWidget == null) { return; } //Remove the widget //If the selected widget is a container then we need to remove from it's parent if (Canvas.SelectedWidget.GetType().IsSubclassOf(typeof(UEditorPanelBase))) { ((UEditorPanelBase)Canvas.CurrentContainer).parent.RemoveChild(Canvas.SelectedWidget); } else //Else remove from the CurrentContainer { Canvas.CurrentContainer.RemoveChild(Canvas.SelectedWidget); } //Update the selected widget if a parent exists if (Canvas.SelectedWidget.parent.GetType().IsSubclassOf(typeof(UEditorWidgetBase))) { Canvas.SelectedWidget = (UEditorWidgetBase)Canvas.SelectedWidget.parent; } else { Canvas.SelectedWidget = null; } }
private void __formItem_OnClick(IUEditorWidgetClickable sender, EventArgs e) { if (this._activeButton != null) { this._activeButton.FontStyle = FontStyle.Normal; } this._activeButton = sender as UEditorWidgetButton; this._activeButton.FontStyle = FontStyle.Bold; this._btnOpenForm.GUIEnabled = true; }
void AddControl_OnClick(IUEditorWidgetClickable sender, EventArgs e) { UEditorWidgetButton __buttonPressed = (UEditorWidgetButton)sender; widgetDef __widgetDef = (widgetDef)__buttonPressed.BoundObject; this._lastSelectedType = __widgetDef.WidgetFQName; if (this.OnClick != null) { this.OnClick(this, new EventArgs()); } }
void _btnMoveDown_OnClick(IUEditorWidgetClickable sender, System.EventArgs e) { IWidgetContainer __parentContainer = Canvas.SelectedWidget.parent; int __widgetIndex = __parentContainer.Children.IndexOf(Canvas.SelectedWidget); //Did we find the widget and is it in a position we can move down from if (__widgetIndex != -1 && __widgetIndex <= __parentContainer.Children.Count - 2) { //Update the canvas __parentContainer.Children.RemoveAt(__widgetIndex); __parentContainer.Children.Insert(__widgetIndex + 1, Canvas.SelectedWidget); __parentContainer.Raise_onContainerChange(); } }
private void _btnOpenForm_OnClick(IUEditorWidgetClickable sender, System.EventArgs e) { if (this._activeButton != null) { foreach (var item in _listFormTypes) { if (item.Name == _activeButton.Label) { EditorDesignerEngine.LoadEditor(item.ItemType); this.CloseWindow = true; } } } }
void RemoveButton_OnClick(IUEditorWidgetClickable sender, EventArgs e) { UEditorWidgetButton __castButton = (UEditorWidgetButton)sender; int __index = __castButton.GetBoundValue <int>(); //If the index is the "new item" we can't remove here if (__index == -1) { return; } this.StringList.RemoveAt(__castButton.GetBoundValue <int>()); BuildPanel(); if (this.onItemRemoved != null) { this.onItemRemoved(this, __index); } }
void AddButton_OnClick(IUEditorWidgetClickable sender, EventArgs e) { UEditorWidgetButton __castButton = (UEditorWidgetButton)sender; int __index = __castButton.GetBoundValue <int>(); if (__index == -1) { this.StringList.Add(string.Empty); } else { this.StringList.Insert((__index), string.Empty); } BuildPanel(); if (this.onItemAdded != null) { this.onItemAdded(this, __index); } }
void _btnTBA_OnClick(IUEditorWidgetClickable sender, EventArgs e) { AddNewWidget(UWidget.Create <UControlDesignerTools>()); }
void _toolbox_OnClick(IUEditorWidgetClickable sender, EventArgs e) { UEditorWidgetBase __newControl = UWidget.Create(Type.GetType(_toolbox.LastSelectedType)); AddNewWidget(__newControl); }
void _btnControls_OnClick(IUEditorWidgetClickable sender, EventArgs e) { this.ActiveGroup = _vertControls; }
void _btnDecorators_OnClick(IUEditorWidgetClickable sender, EventArgs e) { this.ActiveGroup = _vertDecorators; }
private void _btnGenerateCode_OnClick(IUEditorWidgetClickable sender, System.EventArgs e) { this.BuildCode(); }
private void _btnCancel_OnClick(IUEditorWidgetClickable sender, System.EventArgs e) { this.CloseWindow = true; }