FCMCtrlComboBox

The PDK offers FCCtrlCombox which is an edit box with a pulldown menu attached. It has the following features:

  • It is an actual subclass of FCCtrlEdit, which means FCMCtrlComboBox is a subclass of FCMCtrlEdit.
  • The text contents of the control does not have to match any of the pulldown values.

The PDK manages the pulldown values and selectied item well enough for our purposes. Furthermore, the order in which you set text or set the selected item matters as to which one you’ll end up with when the window opens. The PDK takes the approach that setting text takes precedence over setting the selected item. For that reason, this module (at least for now) does not manage those properties separately.

Summary of Modifications

  • Overrode AddString to allows Lua string or number in addition to FCString.
  • Added AddStrings that accepts multiple arguments of table, FCString, Lua string, or number.
  • Added localized versions AddStringLocalized and AddStringsLocalized.

Functions

AddString

fcmctrlcombobox.AddString(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 FCMCtrlComboBox
str `FCString string

AddStringLocalized

fcmctrlcombobox.AddStringLocalized(self)

View source

[Fluid]

Localized version of AddString.

@ key (string | FCString, number) The key into the localization table. If there is no entry in the appropriate localization table, the key is the text.

Input Type Description
self FCMCtrlComboBox

AddStrings

fcmctrlcombobox.AddStrings(self)

View source

[Fluid]

Adds multiple strings to the combobox.

@ … (FCStrings | FCString | string | number | table)

Input Type Description
self FCMCtrlComboBox

AddStringsLocalized

fcmctrlcombobox.AddStringsLocalized(self)

View source

[Fluid]

Adds multiple localized strings to the combobox.

@ … (FCStrings | FCString | string | number | table) keys of strings to be added. If no localization is found, the key is added.

Input Type Description
self FCMCtrlComboBox