FCMCtrlSwitcher

Summary of modifications:

  • Setters that accept FCString now also accept Lua string and number.
  • Additional methods for accessing and adding pages and page titles.
  • Added PageChange custom control event.

Functions

Init

fcmctrlswitcher.Init(self)

View source

[Internal]

Input Type Description
self FCMCtrlSwitcher

AddPage

fcmctrlswitcher.AddPage(self, title)

View source

[Fluid] [Override] Accepts Lua string and number in addition to FCString.

Input Type Description
self FCMCtrlSwitcher
title `FCString string

AddPages

fcmctrlswitcher.AddPages(self)

View source

[Fluid] Adds multiple pages, one page for each argument.

@ … (FCString|string|number)

Input Type Description
self FCMCtrlSwitcher

AttachControlByTitle

fcmctrlswitcher.AttachControlByTitle(self, control, title)

View source

Attaches a control to a page.

Input Type Description
self FCMCtrlSwitcher
control FCMControl The control to attach.
title `FCString string
Return type Description
boolean

SetSelectedPage

fcmctrlswitcher.SetSelectedPage(self, index)

View source

[Fluid] [Override]

Input Type Description
self FCMCtrlSwitcher
index number

SetSelectedPageByTitle

fcmctrlswitcher.SetSelectedPageByTitle(self, title)

View source

[Fluid] Set the selected page by its title. If the page is not found, an error will be thrown.

Input Type Description
self FCMCtrlSwitcher
title `FCString string

GetSelectedPageTitle

fcmctrlswitcher.GetSelectedPageTitle(self, title)

View source

Returns the title of the currently selected page.

Input Type Description
self FCMCtrlSwitcher
title (optional) FCString Optional FCString object to populate.
Return type Description
string|nil Nil if no page is selected

GetPageTitle

fcmctrlswitcher.GetPageTitle(self, index, str)

View source

Returns the title of a page.

Input Type Description
self FCMCtrlSwitcher
index number The 0-based index of the page.
str (optional) FCString An optional FCString object to populate.
Return type Description
string

HandlePageChange

fcmctrlswitcher.HandlePageChange(control, last_page, last_page_title)

View source

[Callback Template]

Input Type Description
control FCMCtrlSwitcher The control on which the event occurred.
last_page number The 0-based index of the previously selected page. If no page was previously selected, this will be -1 (eg when the window is created).
last_page_title string The title of the previously selected page.

AddHandlePageChange

fcmctrlswitcher.AddHandlePageChange(self, callback)

View source

[Fluid] Adds an event listener for PageChange events. The event fires when:

  • The window is created (if pages have been added)
  • The user switches page
  • The selected page is changed programmatically (if the selected page is changed within a handler, that same handler will not be called for that change)
Input Type Description
self FCMCtrlSwitcher
callback function See HandlePageChange for callback signature.

RemoveHandlePageChange

fcmctrlswitcher.RemoveHandlePageChange(self, callback)

View source

[Fluid] Removes a handler added with AddHandlePageChange.

Input Type Description
self FCMCtrlSwitcher
callback function