Class NodeEditorBase<T>
- Namespace
- NanoByte.StructureEditor.EtoForms
- Assembly
- NanoByte.StructureEditor.EtoForms.dll
Common base class for controls that edit a node in the structure.
public abstract class NodeEditorBase<T> : Panel, IHandlerSource, IDisposable, IBindable, IMouseInputSource, IKeyboardInputSource, ICallbackSource, IBindableWidgetContainer, INodeEditor<T>, INodeEditor, IPendingChanges where T : class
Type Parameters
TThe type of element to edit.
- Inheritance
-
objectWidgetBindableWidgetControlContainerPanelNodeEditorBase<T>
- Implements
-
IHandlerSourceIBindableIMouseInputSourceIKeyboardInputSourceICallbackSourceIBindableWidgetContainerINodeEditor<T>
- Derived
- Inherited Members
-
Panel.Remove(Control)Panel.ControlsPanel.PaddingPanel.MinimumSizePanel.ContextMenuPanel.ContentContainer.RemoveAll()Container.RemoveParent(Control)Container.SetLogicalParent(Control)Container.RemoveLogicalParent(Control)Container.ClientSizeContainer.ChildrenContainer.VisualChildrenContainer.StyleProviderContainer.StylesControl.SizeChangedEventControl.KeyDownEventControl.KeyUpEventControl.TextInputEventControl.MouseDownEventControl.MouseUpEventControl.MouseMoveEventControl.MouseLeaveEventControl.MouseEnterEventControl.MouseDoubleClickEventControl.MouseWheelEventControl.GotFocusEventControl.LostFocusEventControl.ShownEventControl.ThemeChangedEventControl.DragDropEventControl.DragOverEventControl.DragEnterEventControl.DragLeaveEventControl.DragEndEventControl.EnabledChangedEventControl.OnKeyDown(KeyEventArgs)Control.OnKeyUp(KeyEventArgs)Control.OnTextInput(TextInputEventArgs)Control.OnMouseDown(MouseEventArgs)Control.OnMouseUp(MouseEventArgs)Control.OnMouseMove(MouseEventArgs)Control.OnMouseLeave(MouseEventArgs)Control.OnMouseEnter(MouseEventArgs)Control.OnMouseDoubleClick(MouseEventArgs)Control.OnMouseWheel(MouseEventArgs)Control.OnDragDrop(DragEventArgs)Control.OnDragOver(DragEventArgs)Control.OnDragEnter(DragEventArgs)Control.OnDragLeave(DragEventArgs)Control.OnDragEnd(DragEventArgs)Control.Invalidate()Control.Invalidate(Rectangle)Control.UpdateLayout()Control.GetPreferredSize()Control.GetPreferredSize(SizeF)Control.CaptureMouse()Control.ReleaseMouseCapture()Control.Detach()Control.AttachNative()Control.DetachNative()Control.Focus()Control.SuspendLayout()Control.ResumeLayout()Control.PointFromScreen(PointF)Control.PointToScreen(PointF)Control.RectangleToScreen(RectangleF)Control.RectangleFromScreen(RectangleF)Control.DoDragDrop(DataObject, DragEffects)Control.DoDragDrop(DataObject, DragEffects, Image, PointF)Control.TriggerStyleChanged()Control.OnApplyCascadingStyles()Control.Print()Control.GetCallback()Control.IsDesignModeControl.HandlerControl.GesturesControl.LoadedControl.VisualControlsControl.TagControl.LogicalParentControl.IsVisualControlControl.SizeControl.IsMouseCapturedControl.WidthControl.HeightControl.EnabledControl.VisibleControl.ParentControl.VisualParentControl.IsAttachedControl.BackgroundColorControl.HasFocusControl.IsSuspendedControl.ParentWindowControl.SupportedPlatformCommandsControl.BoundsControl.LocationControl.CursorControl.ToolTipControl.TabIndexControl.TabStopControl.AllowDropControl.SizeChangedControl.KeyDownControl.KeyUpControl.TextInputControl.MouseDownControl.MouseUpControl.MouseMoveControl.MouseLeaveControl.MouseEnterControl.MouseDoubleClickControl.MouseWheelControl.GotFocusControl.LostFocusControl.ShownControl.ThemeChangedControl.PreLoadControl.LoadControl.LoadCompleteControl.UnLoadControl.DragDropControl.DragOverControl.DragEnterControl.DragLeaveControl.DragEndControl.EnabledChangedBindableWidget.Unbind()BindableWidget.UpdateBindings(BindingUpdateMode)BindableWidget.ParentsBindableWidget.DataContextBindableWidget.BindingsBindableWidget.IsDataContextChangingBindableWidget.DataContextChangedWidget.Initialize()Widget.Dispose()Widget.ToString()Widget.PlatformWidget.NativeHandleWidget.PropertiesWidget.IDWidget.StyleWidget.ControlObjectWidget.IsDisposedWidget.StyleChanged
Remarks
Use the Bind() methods to connect controls to properties of the Target and then place them in a layout assigned to Eto.Forms.Panel.Content.
Constructors
NodeEditorBase()
protected NodeEditorBase()
Properties
CommandExecutor
An optional undo system to use for editing.
public virtual ICommandExecutor? CommandExecutor { get; set; }
Property Value
Target
The element to be edited.
public virtual T? Target { get; set; }
Property Value
- T
Methods
Bind(CheckBox, PropertyPointer<bool>)
Binds a Eto.Forms.CheckBox to a bool property through the live editing and Undo system.
protected CheckBox Bind(CheckBox control, PropertyPointer<bool> pointer)
Parameters
controlCheckBoxThe control to hook up.
pointerPropertyPointer<bool>Read/write access to the value the
controlrepresents.
Returns
- CheckBox
The
control, for placing in a layout.
Bind(ComboBox, PropertyPointer<string?>)
Binds an editable Eto.Forms.ComboBox to a string property through the live editing and Undo system.
protected ComboBox Bind(ComboBox control, PropertyPointer<string?> pointer)
Parameters
controlComboBoxThe control to hook up.
pointerPropertyPointer<string>Read/write access to the value the
controlrepresents.
Returns
- ComboBox
The
control, for placing in a layout.
Bind(UriTextBox, PropertyPointer<Uri?>)
Binds a UriTextBox to an Uri property through the live editing and Undo system.
protected UriTextBox Bind(UriTextBox control, PropertyPointer<Uri?> pointer)
Parameters
controlUriTextBoxThe control to hook up.
pointerPropertyPointer<Uri>Read/write access to the value the
controlrepresents.
Returns
- UriTextBox
The
control, for placing in a layout.
Bind<TControl>(TControl, PropertyPointer<string?>)
Binds a text control (e.g., a Eto.Forms.TextBox or Eto.Forms.TextArea) to a string property through the live editing and Undo system.
protected TControl Bind<TControl>(TControl control, PropertyPointer<string?> pointer) where TControl : TextControl
Parameters
controlTControlThe control to hook up.
pointerPropertyPointer<string>Read/write access to the value the
controlrepresents.
Returns
- TControl
The
control, for placing in a layout.
Type Parameters
TControl
Remarks
Input is applied when the control loses focus, when Enter is pressed in a single-line control and when CommitPendingChanges() is called.
Bind<TControl, TChild>(TControl, Func<TChild>)
Binds a INodeEditor<T> as child editor through the live editing and Undo system.
protected TControl Bind<TControl, TChild>(TControl control, Func<TChild> getTarget) where TControl : Control, INodeEditor<TChild> where TChild : class
Parameters
controlTControlThe control to hook up.
getTargetFunc<TChild>Callback to retrieve the (child) target of the
control.
Returns
- TControl
The
control, for placing in a layout.
Type Parameters
TControlThe specific INodeEditor<T> type.
TChildThe type the child editor handles.
CommitPendingChanges()
Applies any user input that has not been applied yet.
public virtual void CommitPendingChanges()
Remarks
Call this before relying on the data being edited to be up-to-date, e.g., before saving.
Refresh()
Updates the control to reflect the current state of the node being edited, e.g., after it was modified externally.
public virtual void Refresh()
SetValue<TValue>(PropertyPointer<TValue>, TValue)
Sets a new value through the Undo system, if available.
protected void SetValue<TValue>(PropertyPointer<TValue> pointer, TValue value)
Parameters
pointerPropertyPointer<TValue>Read/write access to the value.
valueTValueThe new value.
Type Parameters
TValue
Events
CommandExecutorChanged
Is raised when CommandExecutor has been changed.
protected event Action? CommandExecutorChanged
Event Type
OnCommitPendingChanges
Is raised when CommitPendingChanges() is called.
protected event Action? OnCommitPendingChanges
Event Type
OnRefresh
Is raised when Refresh() is called.
protected event Action? OnRefresh
Event Type
TargetChanged
Is raised when Target has been changed.
protected event Action? TargetChanged