Class ConstructAction.DoubleInput
- Namespace
- CADability.Actions
- Assembly
- CADability.dll
Defines an input object for an action derived from ConstructAction. This input object extpects the input of a double value. The value may be either entered on the keyboard or by moving the mouse. The calculation of a value from the mouse position is performed via a callback (event) method. Pressing enter or TAB or clicking the mouse proceeds to the next input object.
public class ConstructAction.DoubleInput : ConstructAction.InputObject
- Inheritance
-
ConstructAction.DoubleInput
- Inherited Members
Constructors
DoubleInput(string)
Constructs a DoubleInput object.
public DoubleInput(string resourceId)
Parameters
resourceIdstringthe resource id to specify a string from the StringTable. ResourceId+".Label": the Label left of the edit box. ResourceId+".ShortInfo": a short tooltip text ResourceId+"DetailedInfo": a longer tooltip text.
DoubleInput(string, double)
Constructs a DoubleInput object with a initial value.
public DoubleInput(string resourceId, double startValue)
Parameters
resourceIdstringthe resource id to specify a string from the StringTable. ResourceId+".Label": the Label left of the edit box. ResourceId+".ShortInfo": a short tooltip text ResourceId+"DetailedInfo": a longer tooltip text.
startValuedoublethe initial value
Properties
DoubleValue
The current value of this input. It is updated by mouse and keyboard input and by ForceValue(double); each change raises InputValueChangedEvent. It cannot be set directly, use ForceValue(double).
public double DoubleValue { get; }
Property Value
ForwardMouseInputTo
Mouse input should be forwarded to another input object and only processed by this input, when the other input object is fixed.
public object ForwardMouseInputTo { get; set; }
Property Value
ReadOnly
true: this input field does not accept user input, false: normal input field that requires user input
public override bool ReadOnly { get; set; }
Property Value
Methods
AdjustHighlight()
Called whenever ReadOnly, Optional or Fixed changes, so that the input can update the highlight of its entry in the property page: an input is highlighted while it still expects a value, i.e. while it is neither optional, fixed nor read-only. The default implementation does nothing; the concrete input objects override it.
protected override void AdjustHighlight()
ForceValue(double)
Forces the input object to the specified value. The input filed is updated accordingly.
public void ForceValue(double val)
Parameters
valdoublethe value to set
SetError(string)
Shows errorMessage as an error on the entry of this input in the property page, e.g. when
the value entered by the user is not acceptable for the action. The default implementation does nothing; inputs
with an edit field forward the message to their property entry, inputs without one ignore it.
public override void SetError(string errorMessage)
Parameters
errorMessagestringThe text to display, or an empty string to clear the error
Events
CalculateDoubleEvent
Provide a method here, if you want to calculate the length yourself, i.e. if distance from point, line or plane is not appropriate to your needs.
public event ConstructAction.DoubleInput.CalculateDoubleDelegate CalculateDoubleEvent
Event Type
GetDoubleEvent
Provide a method here, if the length not only depends from this input, but is also modified by other means.
public event ConstructAction.DoubleInput.GetDoubleDelegate GetDoubleEvent
Event Type
InputValueChangedEvent
Event will be rasied if the Length property changed
public event ConstructAction.DoubleInput.InputValueChangedDelegate InputValueChangedEvent
Event Type
MouseClickEvent
Event that is fired when a mousclick happens and this input has the focus.
public event ConstructAction.MouseClickDelegate MouseClickEvent
Event Type
SetDoubleEvent
Provide a method here to get the result of this input (and modify your object)
public event ConstructAction.DoubleInput.SetDoubleDelegate SetDoubleEvent