Class EditableProperty<T>
Defines a base clas for editable properties shown on a property page (IPropertyPage) in the controlcenter (properties explorer).
It is a single entry in the property page which may have subentries.
Usually a property of type T of some object is connected with this EditableProperty, e.g. the startpoint of a line
or the distance of hatch lines or some setting value. The communication with the object which hold the property is either done via delegates
or via reflection.
When the user clicks on the value part of the IPropertyEntry, an editbox is activated to edit the value of the property. There must be
a ValueToText(T) and TextToValue(String, out T) method defined in the derived class, which
convert the property value in a string and vice versa. The value of the property may be changed by the editbox (typing) or from the outside.
Inheritance
System.Object
EditableProperty<T>
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: CADability.dll
Syntax
public abstract class EditableProperty<T> : PropertyEntryImpl, IPropertyEntry, IShowProperty, IConstructProperty
Type Parameters
Constructors
|
Improve this Doc
View Source
EditableProperty(EditableProperty<T>.GetValueDelegate, EditableProperty<T>.SetValueDelegate, String, String)
Creates an editable property entry (for the control center), which communicates with the object (which holds the property) via delegates.
Declaration
public EditableProperty(EditableProperty<T>.GetValueDelegate getValueDelegate, EditableProperty<T>.SetValueDelegate setValueDelegate, string resourceId = null, string contextMenuId = null)
Parameters
|
Improve this Doc
View Source
EditableProperty(Object, String, String, String)
Creates an editable property entry (for the control center), which communicates with the object (which holds the property) via reflection.
The object must have an accessible property with the provided getSetProperty name.
Declaration
public EditableProperty(object objectWithProperty, string getSetProperty, string resourceId = null, string contextMenuId = null)
Parameters
| Type |
Name |
Description |
| System.Object |
objectWithProperty |
The object, which holds the property
|
| System.String |
getSetProperty |
The Name of the property
|
| System.String |
resourceId |
A resource id for the text of the label
|
| System.String |
contextMenuId |
|
|
Improve this Doc
View Source
EditableProperty(String, String)
Creates an EditableProperty without specifying the communication with the object holding the property.
This must be specified before using the object by setting OnGetValue and OnSetValue
Declaration
public EditableProperty(string resourceId = null, string contextMenuId = null)
Parameters
| Type |
Name |
Description |
| System.String |
resourceId |
|
| System.String |
contextMenuId |
|
Fields
|
Improve this Doc
View Source
hotspotPosition
Declaration
protected GeoPoint hotspotPosition
Field Value
|
Improve this Doc
View Source
LabelTextChanged
Declaration
public EditableProperty<T>.LabelChangedDelegate LabelTextChanged
Field Value
|
Improve this Doc
View Source
LockedChanged
Declaration
public EditableProperty<T>.LockedChangedDelegate LockedChanged
Field Value
|
Improve this Doc
View Source
ModifyWithMouse
Declaration
public ModifyWithMouseDelegate ModifyWithMouse
Field Value
Properties
|
Improve this Doc
View Source
Declaration
public override MenuWithHandler[] ContextMenu { get; }
Property Value
Overrides
|
Improve this Doc
View Source
Flags
Override for more functionality. Only returns PropertyEntryType.ValueEditable and PropertyEntryType.LabelEditable if apropriate
Declaration
public override PropertyEntryType Flags { get; }
Property Value
Overrides
|
Improve this Doc
View Source
Highlight
Declaration
public bool Highlight { get; set; }
Property Value
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
IsSelected
Declaration
public bool IsSelected { get; set; }
Property Value
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
LabelIsEditable
Declaration
public bool LabelIsEditable { get; set; }
Property Value
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
Lockable
Declaration
public bool Lockable { get; set; }
Property Value
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
Locked
Declaration
public bool Locked { get; set; }
Property Value
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
OnGetValue
Declaration
public EditableProperty<T>.GetValueDelegate OnGetValue { set; }
Property Value
|
Improve this Doc
View Source
OnSetValue
Declaration
public EditableProperty<T>.SetValueDelegate OnSetValue { set; }
Property Value
|
Improve this Doc
View Source
additional menu items for the context menu
Declaration
public MenuWithHandler[] PrependContextMenu { set; }
Property Value
|
Improve this Doc
View Source
Declaration
public bool ShowMouseButton { get; set; }
Property Value
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
UserData
Declaration
public UserData UserData { get; }
Property Value
|
Improve this Doc
View Source
Value
Declaration
public override string Value { get; }
Property Value
| Type |
Description |
| System.String |
|
Overrides
Methods
|
Improve this Doc
View Source
Added(IPropertyPage)
Declaration
public override void Added(IPropertyPage pp)
Parameters
Overrides
|
Improve this Doc
View Source
EditTextChanged(String)
Declaration
public override bool EditTextChanged(string newValue)
Parameters
| Type |
Name |
Description |
| System.String |
newValue |
|
Returns
| Type |
Description |
| System.Boolean |
|
Overrides
|
Improve this Doc
View Source
EndEdit(Boolean, Boolean, String)
Declaration
public override void EndEdit(bool aborted, bool modified, string newValue)
Parameters
| Type |
Name |
Description |
| System.Boolean |
aborted |
|
| System.Boolean |
modified |
|
| System.String |
newValue |
|
Overrides
|
Improve this Doc
View Source
FireModifyWithMouse(Boolean)
Declaration
public void FireModifyWithMouse(bool start)
Parameters
| Type |
Name |
Description |
| System.Boolean |
start |
|
|
Improve this Doc
View Source
GetConnectedObject()
Declaration
public object GetConnectedObject()
Returns
| Type |
Description |
| System.Object |
|
|
Improve this Doc
View Source
GetConnectedPropertyName()
Declaration
public string GetConnectedPropertyName()
Returns
| Type |
Description |
| System.String |
|
|
Improve this Doc
View Source
Declaration
protected string GetContextMenuId()
Returns
| Type |
Description |
| System.String |
|
|
Improve this Doc
View Source
GetHotspotPosition()
Declaration
public GeoPoint GetHotspotPosition()
Returns
|
Improve this Doc
View Source
GetValue()
Tries to get the value of the property beeing handled from the object
Declaration
Returns
|
Improve this Doc
View Source
LabelChanged(String)
Declaration
protected virtual void LabelChanged(string newText)
Parameters
| Type |
Name |
Description |
| System.String |
newText |
|
|
Improve this Doc
View Source
SetContextMenu(String, ICommandHandler)
Declaration
public void SetContextMenu(string contextMenuId, ICommandHandler contextMenuHandler)
Parameters
| Type |
Name |
Description |
| System.String |
contextMenuId |
|
| ICommandHandler |
contextMenuHandler |
|
|
Improve this Doc
View Source
SetFocus()
Declaration
|
Improve this Doc
View Source
SetHotspotPosition(GeoPoint)
Declaration
public void SetHotspotPosition(GeoPoint Here)
Parameters
|
Improve this Doc
View Source
SetValue(T, Boolean)
Called, when the editbox or some other mechanism has a new value for the property. Transfers this value to the object holding the property.
Declaration
protected void SetValue(T val, bool notify)
Parameters
| Type |
Name |
Description |
| T |
val |
|
| System.Boolean |
notify |
|
|
Improve this Doc
View Source
StartEdit(Boolean)
Only handles value editing. If the label may also be edited, override this method and call this base implementation;
Declaration
public override void StartEdit(bool editValue)
Parameters
| Type |
Name |
Description |
| System.Boolean |
editValue |
|
Overrides
|
Improve this Doc
View Source
StartModifyWithMouse()
Declaration
public void StartModifyWithMouse()
|
Improve this Doc
View Source
TextToValue(String, out T)
Converts the text to a value. Returns true if possible, false otherwise (maybe invalid characters or outside the limit)
Declaration
protected abstract bool TextToValue(string text, out T val)
Parameters
| Type |
Name |
Description |
| System.String |
text |
|
| T |
val |
|
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
ValueToText(T)
Returns the text representation of the value.
Declaration
protected abstract string ValueToText(T val)
Parameters
| Type |
Name |
Description |
| T |
val |
|
Returns
| Type |
Description |
| System.String |
|
Implements