FCString
will 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
.FCStrings
will also accept multiple arguments of FCString
, Lua string
, or number
.AddStrings
that accepts multiple arguments of table
, FCString
, Lua string
, or number
.SelectionChange
custom control event.fcmctrlpopup.Init(self)
[Internal]
Input | Type | Description |
---|---|---|
self |
FCMCtrlPopup |
fcmctrlpopup.StoreState(self)
[Fluid] [Internal] [Override]
Override Changes:
FCMCtrlPopup
-specific properties.Do not disable this method. Override as needed but call the parent first.
Input | Type | Description |
---|---|---|
self |
FCMCtrlPopup |
fcmctrlpopup.RestoreState(self)
[Fluid] [Internal] [Override]
Override Changes:
FCMCtrlPopup
-specific properties.Do not disable this method. Override as needed but call the parent first.
Input | Type | Description |
---|---|---|
self |
FCMCtrlPopup |
fcmctrlpopup.Clear(self)
[Fluid] [Override]
Override Changes:
SelectionChange
event is triggered.Input | Type | Description |
---|---|---|
self |
FCMCtrlPopup |
fcmctrlpopup.GetCount(self)
[Override]
Override Changes:
Input | Type | Description |
---|---|---|
self |
FCMCtrlPopup |
Return type | Description |
---|---|
number |
fcmctrlpopup.GetSelectedItem(self)
[Override]
Override Changes:
Input | Type | Description |
---|---|---|
self |
FCMCtrlPopup |
Return type | Description |
---|---|
number |
fcmctrlpopup.SetSelectedItem(self, index)
[Fluid] [Override]
Override Changes:
SelectionChange
event is triggered.Input | Type | Description |
---|---|---|
self |
FCMCtrlPopup |
|
index |
number |
fcmctrlpopup.SetSelectedLast(self)
[Fluid]
Selects the last item in the popup. If the popup is empty, SelectedItem
will be set to -1.
Input | Type | Description |
---|---|---|
self |
FCMCtrlPopup |
fcmctrlpopup.HasSelection(self)
Checks if the popup has a selection. If the parent window does not exist (ie WindowExists() == false
), this result is theoretical.
Input | Type | Description |
---|---|---|
self |
FCMCtrlPopup |
Return type | Description |
---|---|
boolean |
true if something is selected, false if no selection. |
fcmctrlpopup.ItemExists(self, index)
Checks if there is an item at the specified index.
Input | Type | Description |
---|---|---|
self |
FCMCtrlPopup |
|
index |
number |
0-based item index. |
Return type | Description |
---|---|
boolean |
true if the item exists, false if it does not exist. |
fcmctrlpopup.AddString(self, str)
[Fluid] [Override]
Override Changes:
string
or number
in addition to FCString
.Input | Type | Description |
---|---|---|
self |
FCMCtrlPopup |
|
str |
`FCString | string |
fcmctrlpopup.AddStringLocalized(self, key)
[Fluid]
Localized version of AddString
.
Input | Type | Description |
---|---|---|
self |
FCMCtrlPopup |
|
key |
`string | FCString` |
fcmctrlpopup.AddStrings(self)
[Fluid]
Adds multiple strings to the popup.
@ … (FCStrings | FCString | string | number | table)
Input | Type | Description |
---|---|---|
self |
FCMCtrlPopup |
fcmctrlpopup.AddStringsLocalized(self)
[Fluid]
Adds multiple localized strings to the popup.
@ … (FCStrings | FCString | string | number | table) keys of strings to be added. If no localization is found, the key is added.
Input | Type | Description |
---|---|---|
self |
FCMCtrlPopup |
fcmctrlpopup.GetStrings(self, strs)
[?Fluid]
Returns a copy of all strings in the popup.
Input | Type | Description |
---|---|---|
self |
FCMCtrlPopup |
|
strs (optional) |
FCStrings |
An optional FCStrings object to populate with strings. |
Return type | Description |
---|---|
table |
Returned if strs is omitted. A table of strings (1-indexed - beware when accessing by key!). |
fcmctrlpopup.SetStrings(self)
[Fluid] [Override]
Override Changes:
FCString
or Lua string
or number
in addition to FCStrings
.@ … (FCStrings | FCString | string | number) number
s will be automatically cast to string
Input | Type | Description |
---|---|---|
self |
FCMCtrlPopup |
fcmctrlpopup.GetItemText(self, index, str)
[?Fluid]
Returns the text for an item in the popup.
Input | Type | Description |
---|---|---|
self |
FCMCtrlPopup |
|
index |
number |
0-based index of the item. |
str (optional) |
FCString |
Optional FCString object to populate with text. |
Return type | Description |
---|---|
string | nil |
Returned if str is omitted. nil if the item doesn’t exist |
fcmctrlpopup.SetItemText(self, index, str)
[Fluid] [PDK Port]
Sets the text for an item.
Port Changes:
string
or number
in addition to FCString
.Input | Type | Description |
---|---|---|
self |
FCMCtrlPopup |
|
index |
number |
0-based index of the item. |
str |
`FCString | string |
fcmctrlpopup.GetSelectedString(self, str)
[?Fluid]
Returns the text for the item that is currently selected.
Input | Type | Description |
---|---|---|
self |
FCMCtrlPopup |
|
str (optional) |
FCString |
Optional FCString object to populate with text. If no item is currently selected, it will be populated with an empty string. |
Return type | Description |
---|---|
string | nil |
Returned if str is omitted. nil if no item is currently selected. |
fcmctrlpopup.SetSelectedString(self, str)
[Fluid]
Sets the currently selected item to the first item with a matching text value.
If no match is found, the current selected item will remain selected. Matching is case-sensitive.
Input | Type | Description |
---|---|---|
self |
FCMCtrlPopup |
|
str |
`FCString | string |
fcmctrlpopup.InsertString(self, index, str)
[Fluid] [PDKPort]
Inserts a string at the specified index. If index is <= 0, will insert at the start. If index is >= GetCount(), will insert at the end.
Port Changes:
string
or number
in addition to FCString
.Input | Type | Description |
---|---|---|
self |
FCMCtrlPopup |
|
index |
number |
0-based index to insert new item. |
str |
`FCString | string |
fcmctrlpopup.DeleteItem(self, index)
[Fluid] [PDK Port]
Deletes an item from the popup.
If the currently selected item is deleted, it will be deselected (ie SelectedItem = -1
)
Input | Type | Description |
---|---|---|
self |
FCMCtrlPopup |
|
index |
number |
0-based index of item to delete. |
fcmctrlpopup.HandleSelectionChange(control, last_item, last_item_text, is_deleted)
[Callback Template]
Input | Type | Description |
---|---|---|
control |
FCMCtrlPopup |
|
last_item |
number |
The 0-based index of the previously selected item. If no item was selected, the value will be -1 . |
last_item_text |
string |
The text value of the previously selected item. |
is_deleted |
boolean |
true if the previously selected item is no longer in the control. |
fcmctrlpopup.AddHandleSelectionChange(self, callback)
[Fluid]
Adds a handler for SelectionChange events. If the selected item is changed by a handler, that same handler will not be called again for that change.
The event will fire in the following cases:
Clear
and SetStrings
)Input | Type | Description |
---|---|---|
self |
FCMCtrlPopup |
|
callback |
function |
See HandleSelectionChange for callback signature. |
fcmctrlpopup.RemoveHandleSelectionChange(self, callback)
[Fluid]
Removes a handler added with AddHandleSelectionChange
.
Input | Type | Description |
---|---|---|
self |
FCMCtrlPopup |
|
callback |
function |
Handler to remove. |