FCMControl

Summary of Modifications

  • Setters that accept FCString also accept a Lua string or number.
  • FCString parameter in getters is optional and if omitted, the result will be returned as a Lua string.
  • Ported GetParent from PDK to allow the parent window to be accessed from a control.
  • Added methods to allow handlers for the Command event to be set directly on the control.
  • Added methods for storing and restoring control state, allowing controls to preserve their values across multiple script executions.

Functions

Init

fcmcontrol.Init(self)

View source

[Internal]

Input Type Description
self FCMControl

GetParent

fcmcontrol.GetParent(self)

View source

[PDK Port]

Returns the control’s parent window.

Do not override or disable this method.

Input Type Description
self FCMControl
Return type Description
FCMCustomWindow

RegisterParent

fcmcontrol.RegisterParent(self, window)

View source

[Fluid] [Internal]

Used to register the parent window when the control is created.

Do not disable this method.

Input Type Description
self FCMControl
window FCMCustomWindow

GetEnable

fcmcontrol.GetEnable(self)

View source

[Override]

Override Changes:

  • Hooks into control state preservation.
Input Type Description
self FCMControl
Return type Description
boolean

SetEnable

fcmcontrol.SetEnable(self, enable)

View source

[Fluid] [Override]

Override Changes:

  • Hooks into control state preservation.
Input Type Description
self FCMControl
enable boolean

GetVisible

fcmcontrol.GetVisible(self)

View source

[Override]

Override Changes:

  • Hooks into control state preservation.
Input Type Description
self FCMControl
Return type Description
boolean

SetVisible

fcmcontrol.SetVisible(self, visible)

View source

[Fluid] [Override]

Override Changes:

  • Hooks into control state preservation.
Input Type Description
self FCMControl
visible boolean

GetLeft

fcmcontrol.GetLeft(self)

View source

[Override]

Override Changes:

  • Hooks into control state preservation.
Input Type Description
self FCMControl
Return type Description
number

SetLeft

fcmcontrol.SetLeft(self, left)

View source

[Fluid] [Override]

Override Changes:

  • Hooks into control state preservation.
Input Type Description
self FCMControl
left number

GetTop

fcmcontrol.GetTop(self)

View source

[Override]

Override Changes:

  • Hooks into control state preservation.
Input Type Description
self FCMControl
Return type Description
number

SetTop

fcmcontrol.SetTop(self, top)

View source

[Fluid] [Override]

Override Changes:

  • Hooks into control state preservation.
Input Type Description
self FCMControl
top number

GetHeight

fcmcontrol.GetHeight(self)

View source

[Override]

Override Changes:

  • Hooks into control state preservation.
Input Type Description
self FCMControl
Return type Description
number

SetHeight

fcmcontrol.SetHeight(self, height)

View source

[Fluid] [Override]

Override Changes:

  • Hooks into control state preservation.
Input Type Description
self FCMControl
height number

GetWidth

fcmcontrol.GetWidth(self)

View source

[Override]

Override Changes:

  • Hooks into control state preservation.
Input Type Description
self FCMControl
Return type Description
number

SetWidth

fcmcontrol.SetWidth(self, width)

View source

[Fluid] [Override]

Override Changes:

  • Hooks into control state preservation.
Input Type Description
self FCMControl
width number

GetText

fcmcontrol.GetText(self, str)

View source

[?Fluid] [Override]

Override Changes:

  • Passing an FCString is optional. If omitted, the result is returned as a Lua string. If passed, nothing is returned and the method is fluid.
  • Hooks into control state preservation.
Input Type Description
self FCMControl
str (optional) FCString
Return type Description
string Returned if str is omitted.

SetText

fcmcontrol.SetText(self, str)

View source

[Fluid] [Override]

Override Changes:

  • Accepts Lua string or number in addition to FCString.
  • Hooks into control state preservation.
Input Type Description
self FCMControl
str `FCString string

UseStoredState

fcmcontrol.UseStoredState(self)

View source

[Internal]

Checks if this control should use its stored state instead of the live state from the control.

Do not override or disable this method.

Input Type Description
self FCMControl
Return type Description
boolean

StoreState

fcmcontrol.StoreState(self)

View source

[Fluid] [Internal]

Stores the control’s current state.

Do not disable this method. Override as needed but call the parent first.

Input Type Description
self FCMControl

RestoreState

fcmcontrol.RestoreState(self)

View source

[Fluid] [Internal]

Restores the control’s stored state.

Do not disable this method. Override as needed but call the parent first.

Input Type Description
self FCMControl

AddHandleCommand

fcmcontrol.AddHandleCommand(self, callback)

View source

[Fluid]

Adds a handler for command events.

Input Type Description
self FCMControl
callback function See FCCustomLuaWindow.HandleCommand in the PDK for callback signature.

RemoveHandleCommand

fcmcontrol.RemoveHandleCommand(self, callback)

View source

[Fluid]

Removes a handler added with AddHandleCommand.

Input Type Description
self FCMControl
callback function

SetTextLocalized

fcmcontrol.SetTextLocalized(self, key)

View source

[Fluid]

Removes a handler added with AddHandleCommand.

Input Type Description
self FCMControl
key string The key into the localization table. If there is no entry in the appropriate localization table, the key is the text.