Table of Contents

Class ConstructAction.StringInput

Namespace
CADability.Actions
Assembly
CADability.dll

Defines an input object for an action derived from ConstructAction. This input object extpects the user to enter a string in a edit field. Pressing enter or TAB or clicking the mouse proceeds to the next input object.

public class ConstructAction.StringInput : ConstructAction.InputObject, ICommandHandler
Inheritance
ConstructAction.StringInput
Implements
Inherited Members

Constructors

StringInput(string)

Creates a StringInput

public StringInput(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.

Fields

FileNameFilter

Only used when IsFileNameInput is true. This is the filter for the file open dialog.

public string FileNameFilter

Field Value

string

InitOpenFile

If true there will be an file open dialog when this input becomes visible.

public bool InitOpenFile

Field Value

bool

IsFileNameInput

If true, this input can be used as a file open dialog input. In the corresponding context menu the file open dialog can be opened.

public bool IsFileNameInput

Field Value

bool

NotifyOnLostFocusOnly

If true, SetStringEvent is raised only when the edit field loses the focus or Enter is pressed, not on every keystroke. Must be set before the action is displayed. Default: false.

public bool NotifyOnLostFocusOnly

Field Value

bool

Properties

Content

The text of this input as last obtained from GetStringEvent or set by ForceValue(string); it is also the initial text of the edit field. Each change refreshes the edit field and raises InputValueChangedEvent. Text typed by the user is delivered by SetStringEvent and is not stored here unless GetStringEvent returns it. It cannot be set directly, use ForceValue(string).

public string Content { get; }

Property Value

string

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

Methods

ConnectWithTextObject(Text, IView)

Connects this input filed with a Text object. The Text object displays the carret in the view so you can edit the text in the view directly

public void ConnectWithTextObject(Text text, IView vw)

Parameters

text Text

the text object

vw IView

the view, in which the editing is supposed to happen

ForceValue(string)

Sets Content to val, which refreshes the edit field and the dependent properties of the action. SetStringEvent is not raised. Does nothing when the input is ReadOnly.

public void ForceValue(string val)

Parameters

val string

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

errorMessage string

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

Events

GetStringEvent

Provide a method here when the string also changes by other means than user input.

public event ConstructAction.StringInput.GetStringDelegate GetStringEvent

Event Type

ConstructAction.StringInput.GetStringDelegate

InputValueChangedEvent

Event will be rasied if the Length property changed

public event ConstructAction.StringInput.InputValueChangedDelegate InputValueChangedEvent

Event Type

ConstructAction.StringInput.InputValueChangedDelegate

SetStringEvent

Provide a handler here if you want to be notified about input changes.

public event ConstructAction.StringInput.SetStringDelegate SetStringEvent

Event Type

ConstructAction.StringInput.SetStringDelegate