FCXCtrlMeasurementEdit
Extends FCMCtrlEdit
Note that the type should be set before setting any values.
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 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 an
FCXCtrlUpDown` 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(self)
- SetText(self, str)
- SetInteger(self, anint)
- SetFloat(self, value)
- GetType(self)
- GetMeasurement(self)
- GetRangeMeasurement(self, minimum, maximum)
- SetMeasurement(self, value)
- IsTypeMeasurement(self)
- SetTypeMeasurement(self)
- GetMeasurementInteger(self)
- GetRangeMeasurementInteger(self, minimum, maximum)
- SetMeasurementInteger(self, value)
- IsTypeMeasurementInteger(self)
- SetTypeMeasurementInteger(self)
- GetMeasurementEfix(self)
- GetRangeMeasurementEfix(self, minimum, maximum)
- SetMeasurementEfix(self, value)
- IsTypeMeasurementEfix(self)
- SetTypeMeasurementEfix(self)
- GetMeasurement10000th(self)
- GetRangeMeasurement10000th(self, minimum, maximum)
- SetMeasurement10000th(self, value)
- IsTypeMeasurement10000th(self)
- SetTypeMeasurement10000th(self)
- UpdateMeasurementUnit(self)
- HandleChange(control, last_value)
- AddHandleChange(self, callback)
- RemoveHandleChange(self, callback)
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 |
|
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
[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 |
|
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
[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 |
|
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
[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 |
|
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
[Override]
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
[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 |
|
SetMeasurement10000th
fcxctrlmeasurementedit.SetMeasurement10000th(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 |
|
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)
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 |
|