Table of Contents

Class ConstructAction.LengthInput

Namespace
CADability.Actions
Assembly
CADability.dll

Defines an input object for an action derived from ConstructAction. This input object extpects the input of a length or distance. The length may be either entered on the keyboard or by moving the mouse. The calculation of a length from the mouse position depends on various settings. Pressing enter or TAB or clicking the mouse proceeds to the next input object.

public class ConstructAction.LengthInput : ConstructAction.InputObject
Inheritance
ConstructAction.LengthInput
Inherited Members

Constructors

LengthInput(string)

Constructs a LengthInput object.

public LengthInput(string resourceId)

Parameters

resourceId string

the 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.

LengthInput(string, double)

Constructs a LengthInput object with a start value

public LengthInput(string resourceId, double StartValue)

Parameters

resourceId string

the 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.

StartValue double

the initial value

Properties

DefaultLength

Sets a DefaultLength, which should be a static value, that carries the last input value of this length to the next instantiation of the action.

public ConstructAction.DefaultLength DefaultLength { set; }

Property Value

ConstructAction.DefaultLength

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

object

Length

The current value of this input in model units. 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 Length { get; }

Property Value

double

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

bool

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 field is updated accordingly.

public void ForceValue(double val)

Parameters

val double

the value to set

SetDistanceFromLine(GeoPoint, GeoPoint)

Sets the line as a basis for the calculation of the distance or length. The calculated length is the distance of the mouseposition from this line

public void SetDistanceFromLine(GeoPoint startPoint, GeoPoint endPoint)

Parameters

startPoint GeoPoint

startpoint of the line

endPoint GeoPoint

endpoint of the line

SetDistanceFromPlane(Plane)

Sets the given plane as a basis for the calculation of the distance or length. The calculated length is the distance of the mouseposition from this plane.

public void SetDistanceFromPlane(Plane p)

Parameters

p Plane

the plane

SetDistanceFromPoint(GeoPoint)

Sets the point as a basis for the calculation of the distance or length. The calculated length is the distance of the mouseposition from this point.

public void SetDistanceFromPoint(GeoPoint basePoint)

Parameters

basePoint GeoPoint

the point

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

errorMessage string

The text to display, or an empty string to clear the error

Events

CalculateLengthEvent

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.LengthInput.CalculateLengthDelegate CalculateLengthEvent

Event Type

ConstructAction.LengthInput.CalculateLengthDelegate

GetLengthEvent

Provide a method here, if the length not only depends from this input, but is also modified by other means.

public event ConstructAction.LengthInput.GetLengthDelegate GetLengthEvent

Event Type

ConstructAction.LengthInput.GetLengthDelegate

InputValueChangedEvent

Event will be rasied if the Length property changed

public event ConstructAction.LengthInput.InputValueChangedDelegate InputValueChangedEvent

Event Type

ConstructAction.LengthInput.InputValueChangedDelegate

MouseClickEvent

Event that is fired when a mousclick happens and this input has the focus.

public event ConstructAction.MouseClickDelegate MouseClickEvent

Event Type

ConstructAction.MouseClickDelegate

SetLengthEvent

Provide a method here to get the result of this input (and modify your object)

public event ConstructAction.LengthInput.SetLengthDelegate SetLengthEvent

Event Type

ConstructAction.LengthInput.SetLengthDelegate