FCXCtrlMeasurementEdit

Extends FCMCtrlEdit

Summary of modifications:

  • Parent window must be an instance of FCXCustomLuaWindow
  • Displayed measurement unit will be automatically updated with the parent window
  • Measurement edits can be set to one of three types which correspond to the GetMeasurement*, SetMeasurement* and GetRangeMeasurementmethods. The type affects which methods are used for changing measurement units, for events, and for interacting with anFCXCtrlUpDown` control.
  • All measurement get and set methods no longer accept a measurement unit as this is taken from the parent window.
  • Change event has been overridden to pass a measurement.
  • Added hooks for restoring control state

Functions

Init

fcxctrlmeasurementedit.Init(self)

View source

[Internal]

Input Type Description
self FCXCtrlMeasurementEdit

SetText

fcxctrlmeasurementedit.SetText(self, str)

View source

[Fluid] [Override] Ensures that the overridden Change event is triggered.

Input Type Description
self FCXCtrlMeasurementEdit
str `FCString string

SetInteger

fcxctrlmeasurementedit.SetInteger(self, anint)

View source

[Fluid] [Override] Ensures that the overridden Change event is triggered.

Input Type Description
self FCXCtrlMeasurementEdit
anint number

SetFloat

fcxctrlmeasurementedit.SetFloat(self, value)

View source

[Fluid] [Override] Ensures that the overridden Change event is triggered.

Input Type Description
self FCXCtrlMeasurementEdit
value number

GetMeasurement

fcxctrlmeasurementedit.GetMeasurement(self)

View source

[Override] Removes the measurement unit parameter, taking it instead from the parent window.

Input Type Description
self FCXCtrlMeasurementEdit
Return type Description
number

GetRangeMeasurement

fcxctrlmeasurementedit.GetRangeMeasurement(self, minimum, maximum)

View source

[Override] Removes the measurement unit parameter, taking it instead from the parent window.

Input Type Description
self FCXCtrlMeasurementEdit
minimum number
maximum number
Return type Description
number

SetMeasurement

fcxctrlmeasurementedit.SetMeasurement(self, value)

View source

[Fluid] [Override] Removes the measurement unit parameter, taking it instead from the parent window. Also ensures that the overridden Change event is triggered.

Input Type Description
self FCXCtrlMeasurementEdit
value number

GetMeasurementInteger

fcxctrlmeasurementedit.GetMeasurementInteger(self)

View source

[Override] Removes the measurement unit parameter, taking it instead from the parent window.

Input Type Description
self FCXCtrlMeasurementEdit
Return type Description
number

GetRangeMeasurementInteger

fcxctrlmeasurementedit.GetRangeMeasurementInteger(self, minimum, maximum)

View source

[Override] Removes the measurement unit parameter, taking it instead from the parent window.

Input Type Description
self FCXCtrlMeasurementEdit
minimum number
maximum number
Return type Description
number

SetMeasurementInteger

fcxctrlmeasurementedit.SetMeasurementInteger(self, value)

View source

[Fluid] [Override] Removes the measurement unit parameter, taking it instead from the parent window. Also ensures that the overridden Change event is triggered.

Input Type Description
self FCXCtrlMeasurementEdit
value number

GetMeasurementEfix

fcxctrlmeasurementedit.GetMeasurementEfix(self)

View source

[Override] Removes the measurement unit parameter, taking it instead from the parent window.

Input Type Description
self FCXCtrlMeasurementEdit
Return type Description
number

GetRangeMeasurementEfix

fcxctrlmeasurementedit.GetRangeMeasurementEfix(self, minimum, maximum)

View source

[Override] Removes the measurement unit parameter, taking it instead from the parent window.

Input Type Description
self FCXCtrlMeasurementEdit
minimum number
maximum number
Return type Description
number

SetMeasurementEfix

fcxctrlmeasurementedit.SetMeasurementEfix(self, value)

View source

[Fluid] [Override] Removes the measurement unit parameter, taking it instead from the parent window. Also ensures that the overridden Change event is triggered.

Input Type Description
self FCXCtrlMeasurementEdit
value number

GetType

fcxctrlmeasurementedit.GetType(self)

View source

Returns the measurement edit’s type. Can also be appended to "Get", "GetRange", or "Set" to use type-specific methods.

Input Type Description
self FCXCtrlMeasurementEdit
Return type Description
string "Measurement", "MeasurementInteger", or "MeasurementEfix"

IsTypeMeasurement

fcxctrlmeasurementedit.IsTypeMeasurement(self)

View source

Checks if the type is "Measurement".

Input Type Description
self FCXCtrlMeasurementEdit
Return type Description
boolean

IsTypeMeasurementInteger

fcxctrlmeasurementedit.IsTypeMeasurementInteger(self)

View source

Checks if the type is "MeasurementInteger".

Input Type Description
self FCXCtrlMeasurementEdit
Return type Description
boolean

IsTypeMeasurementEfix

fcxctrlmeasurementedit.IsTypeMeasurementEfix(self)

View source

Checks if the type is "MeasurementEfix".

Input Type Description
self FCXCtrlMeasurementEdit
Return type Description
boolean

SetTypeMeasurement

fcxctrlmeasurementedit.SetTypeMeasurement(self)

View source

[Fluid] Sets the type to "Measurement". This means that the setters & getters used in events, measurement unit changes, and up down controls are GetMeasurement, GetRangeMeasurement, and SetMeasurement.

Input Type Description
self FCXCtrlMeasurementEdit

SetTypeMeasurementInteger

fcxctrlmeasurementedit.SetTypeMeasurementInteger(self)

View source

[Fluid] Sets the type to "MeasurementInteger". This is the default type. This means that the setters & getters used in events, measurement unit changes, and up down controls are GetMeasurementInteger, GetRangeMeasurementInteger, and SetMeasurementInteger.

Input Type Description
self FCXCtrlMeasurementEdit

SetTypeMeasurementEfix

fcxctrlmeasurementedit.SetTypeMeasurementEfix(self)

View source

[Fluid] Sets the type to "MeasurementEfix". This means that the setters & getters used in events, measurement unit changes, and up down controls are GetMeasurementEfix, GetRangeMeasurementEfix, and SetMeasurementEfix.

Input Type Description
self FCXCtrlMeasurementEdit

UpdateMeasurementUnit

fcxctrlmeasurementedit.UpdateMeasurementUnit(self)

View source

[Fluid] [Internal] Checks the parent window for a change in measurement unit and updates the control if needed.

Input Type Description
self FCXCtrlMeasurementEdit

HandleChange

fcxctrlmeasurementedit.HandleChange(control, last_value)

View source

[Callback Template] [Override] The type and unit of last_value will change depending on the measurement edit’s type. The possibilities are:

  • "Measurement" => EVPUs (with fractional part)
  • "MeasurementInteger" => whole EVPUs (without fractional part)
  • "MeasurementEfix" => EFIXes (1 EFIX is 1/64th of an EVPU)
Input Type Description
control FCXCtrlMeasurementEdit The control that was changed.
last_value number The previous measurement value of the control.

AddHandleChange

fcxctrlmeasurementedit.AddHandleChange(self, callback)

View source

[Fluid] [Override] Adds a handler for when the value of the control changes. The even will fire when:

  • The window is created (if the value of the control is not an empty string)
  • The value of the control is changed by the user
  • The value of the control is changed programmatically (if the value of the control is changed within a handler, that same handler will not be called again for that change.)
  • A measurement unit change will only trigger the event if the underlying measurement value has changed.
Input Type Description
self FCXCtrlMeasurementEdit
callback function See HandleChange for callback signature.

RemoveHandleChange

fcxctrlmeasurementedit.RemoveHandleChange(self, callback)

View source

[Fluid] [Override] Removes a handler added with AddHandleChange.

Input Type Description
self FCXCtrlMeasurementEdit
callback function