FCXCtrlMeasurementEdit

Extends FCMCtrlEdit

Note that the type should be set before setting any values.

Summary of Modifications

  • Parent window must be an instance of FCMCustomLuaWindow.
  • Displayed measurement unit will be automatically updated with the parent window.
  • Measurement edits can be set to one of four 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.
  • Added measures to prevent underlying value from changing when the measurement unit is changed.
  • Change event has been overridden to pass a measurement.
  • Added hooks into control state restoration

Functions

Init

fcxctrlmeasurementedit.Init(self)

View source

[Internal]

Input Type Description
self FCXCtrlMeasurementEdit

SetText

fcxctrlmeasurementedit.SetText(self, str)

View source

[Fluid] [Override]

Override Changes:

  • 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]

Override Changes:

  • Ensures that the overridden Change event is triggered.
Input Type Description
self FCXCtrlMeasurementEdit
anint number

SetFloat

fcxctrlmeasurementedit.SetFloat(self, value)

View source

[Fluid] [Override]

Override Changes:

  • 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. The result can also be appended to "Get", "GetRange", or "Set" to use type-specific methods. The default type is "MeasurementInteger".

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

GetMeasurement

fcxctrlmeasurementedit.GetMeasurement(self)

View source

[Breaking Change] [Override]

Override Changes:

  • 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

[Breaking Change] [Override]

Override Changes:

  • 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

[Breaking Change] [Fluid] [Override]

Override Changes:

  • Removes the measurement unit parameter, taking it instead from the parent window.
  • Ensures that the overridden Change event is triggered.
Input Type Description
self FCXCtrlMeasurementEdit
value number

IsTypeMeasurement

fcxctrlmeasurementedit.IsTypeMeasurement(self)

View source

Checks if the type is "Measurement".

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 getters & setters used in events, measurement unit changes, and up down controls are GetMeasurement, GetRangeMeasurement, and SetMeasurement.

Input Type Description
self FCXCtrlMeasurementEdit

GetMeasurementInteger

fcxctrlmeasurementedit.GetMeasurementInteger(self)

View source

[Breaking Change] [Override]

Override Changes:

  • 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

[Breaking Change] [Override]

Override Changes:

  • 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]

Override Changes:

  • Removes the measurement unit parameter, taking it instead from the parent window.
  • Ensures that the overridden Change event is triggered.
Input Type Description
self FCXCtrlMeasurementEdit
value number

IsTypeMeasurementInteger

fcxctrlmeasurementedit.IsTypeMeasurementInteger(self)

View source

Checks if the type is "MeasurementInteger".

Input Type Description
self FCXCtrlMeasurementEdit
Return type Description
boolean

SetTypeMeasurementInteger

fcxctrlmeasurementedit.SetTypeMeasurementInteger(self)

View source

[Fluid]

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

Input Type Description
self FCXCtrlMeasurementEdit

GetMeasurementEfix

fcxctrlmeasurementedit.GetMeasurementEfix(self)

View source

[Breaking Change] [Override]

Override Changes:

  • 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

[Breaking Change] [Override]

Override Changes:

  • 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

[Breaking Change] [Fluid] [Override]

Override Changes:

  • Removes the measurement unit parameter, taking it instead from the parent window.
  • Ensures that the overridden Change event is triggered.
Input Type Description
self FCXCtrlMeasurementEdit
value number

IsTypeMeasurementEfix

fcxctrlmeasurementedit.IsTypeMeasurementEfix(self)

View source

Checks if the type is "MeasurementEfix".

Input Type Description
self FCXCtrlMeasurementEdit
Return type Description
boolean

SetTypeMeasurementEfix

fcxctrlmeasurementedit.SetTypeMeasurementEfix(self)

View source

[Fluid]

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

Input Type Description
self FCXCtrlMeasurementEdit

GetMeasurement10000th

fcxctrlmeasurementedit.GetMeasurement10000th(self)

View source

[Breaking Change] [Override]

Override Changes:

  • Removes the measurement unit parameter, taking it instead from the parent window.
Input Type Description
self FCXCtrlMeasurementEdit
Return type Description
number

GetRangeMeasurement10000th

fcxctrlmeasurementedit.GetRangeMeasurement10000th(self, minimum, maximum)

View source

[Breaking Change] [Override]

Override Changes:

  • 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

SetMeasurement10000th

fcxctrlmeasurementedit.SetMeasurement10000th(self, value)

View source

[Breaking Change] [Fluid] [Override]

Override Changes:

  • Removes the measurement unit parameter, taking it instead from the parent window.
  • Ensures that the overridden Change event is triggered.
Input Type Description
self FCXCtrlMeasurementEdit
value number

IsTypeMeasurement10000th

fcxctrlmeasurementedit.IsTypeMeasurement10000th(self)

View source

Checks if the type is "Measurement10000th".

Input Type Description
self FCXCtrlMeasurementEdit
Return type Description
boolean

SetTypeMeasurement10000th

fcxctrlmeasurementedit.SetTypeMeasurement10000th(self)

View source

[Fluid]

Sets the type to "Measurement10000th". This means that the getters & setters used in events, measurement unit changes, and up down controls are GetMeasurement10000th, GetRangeMeasurement10000th, and SetMeasurement10000th.

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)
  • "Measurement10000th" => whole 10,000ths 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]

Override Changes:

  • Only adds a handler for the FCXCtrlMeasurementEdit-specific Change event.
  • A measurement unit change may trigger the event but only 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]

Override Changes:

  • Only removes a handler for the FCXCtrlMeasurementEdit-specific Change event.
Input Type Description
self FCXCtrlMeasurementEdit
callback function