Difference between revisions of "Lua:Class:PageControl"

From Cheat Engine
Jump to navigation Jump to search
(Create page about Lua class PageControl)
 
m (Re-word warning note)
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
[[Category:Lua]]
 
[[Category:Lua]]
'''PageControl Class''': (Inheritence: ''[[WinControl]]'')
+
'''PageControl Class''': (Inheritence: ''[[WinControl]]'' > ''[[Control]]'' > ''[[Component]]'' > ''[[Object]]'')
  
<span style="color:red; font-weight:bold; font-style:italic;">WARNING: This page is unfinished.</span>
+
<span style="color:red; font-weight:bold; font-style:italic;">WARNING: This page may be unfinished.</span>
  
 
== Description ==
 
== Description ==
  
PageControl is tabbed GUI control.
+
This is an tabbed interface that can hold multiple pages.
  
 
== Creation ==
 
== Creation ==
Line 12: Line 12:
 
; createPageControl(''owner'') &#58; ''PageControl''
 
; createPageControl(''owner'') &#58; ''PageControl''
 
: Returns a newly created PageControl.
 
: Returns a newly created PageControl.
 +
 +
== Properties ==
 +
 +
; ShowTabs &#58; ''boolean''
 +
: Tabs are shown if ''true'', hidden if ''false''.
 +
: Default: ''true''
 +
 +
; TabPosition &#58; ''string''
 +
: Defines along which edge tabs are located.
 +
: Options: ''tpTop'', ''tpBottom'', ''tpLeft'', ''tpRight''.
 +
: Default: ''"tpTop"''
 +
 +
; TabIndex &#58; ''integer''
 +
: Index of the currently selected tab (beginning at ''0'').
 +
: Default: ''0''
 +
 +
; TabOrder &#58; ''integer''
 +
: Default: ''0''
 +
 +
; TabStop &#58; ''boolean''
 +
: Default: true
 +
 +
; ActivePage &#58; ''TabSheet''
 +
: Contains the currently selected tab.
 +
 +
; PageCount &#58; ''integer''
 +
: The total number of pages.
 +
 +
; Page &#58; ''table''
 +
: Table of current TabSheets.
  
 
== Methods ==
 
== Methods ==
  
; addTab() : [[Lua:Class:TabSheet|TabSheet]]
+
; addTab() &#58; ''TabSheet''
 
: Creates & returns new TabSheet.
 
: Creates & returns new TabSheet.
  
; getPageCount() &#58; ''int''
+
; getPageCount() &#58; ''integer''
:
+
: ''Not available?''
  
 
; getPage()
 
; getPage()
:
+
: ''Not currently available?''
 +
 
 +
== Events ==
 +
 
 +
; OnChange()
 +
: Action executed when selected tab changes.
 +
 
 +
; OnCloseTabClicked()
 +
: ''Not currently available?''
 +
 
 +
== Examples ==
 +
 
 +
<pre>
 +
-- main window
 +
local form = createForm()
 +
 
 +
-- create tabbed interface
 +
local tabs = createPageControl(form)
 +
tabs.Align = alClient
 +
 
 +
-- add tabs
 +
local tabMain = tabs.addTab()
 +
tabMain.setCaption("Main")
 +
local tabSec = tabs.addTab()
 +
tabSec.setCaption("Secondary")
  
; addMetaData()
+
-- put tabs at bottom of interface
:
+
tabs.TabPosition = "tpBottom"
 +
</pre>
  
 
{{LuaSeeAlso}}
 
{{LuaSeeAlso}}
Line 34: Line 89:
 
=== Related Classes ===
 
=== Related Classes ===
 
* [[Lua:Class:Panel|Panel]]
 
* [[Lua:Class:Panel|Panel]]
 +
* [[Lua:Class:TabSheet|TabSheet]]

Latest revision as of 14:34, 14 February 2019

PageControl Class: (Inheritence: WinControl > Control > Component > Object)

WARNING: This page may be unfinished.

Description[edit]

This is an tabbed interface that can hold multiple pages.

Creation[edit]

createPageControl(owner) : PageControl
Returns a newly created PageControl.

Properties[edit]

ShowTabs : boolean
Tabs are shown if true, hidden if false.
Default: true
TabPosition : string
Defines along which edge tabs are located.
Options: tpTop, tpBottom, tpLeft, tpRight.
Default: "tpTop"
TabIndex : integer
Index of the currently selected tab (beginning at 0).
Default: 0
TabOrder : integer
Default: 0
TabStop : boolean
Default: true
ActivePage : TabSheet
Contains the currently selected tab.
PageCount : integer
The total number of pages.
Page : table
Table of current TabSheets.

Methods[edit]

addTab() : TabSheet
Creates & returns new TabSheet.
getPageCount() : integer
Not available?
getPage()
Not currently available?

Events[edit]

OnChange()
Action executed when selected tab changes.
OnCloseTabClicked()
Not currently available?

Examples[edit]

-- main window
local form = createForm()

-- create tabbed interface
local tabs = createPageControl(form)
tabs.Align = alClient

-- add tabs
local tabMain = tabs.addTab()
tabMain.setCaption("Main")
local tabSec = tabs.addTab()
tabSec.setCaption("Secondary")

-- put tabs at bottom of interface
tabs.TabPosition = "tpBottom"

See also[edit]

Related Functions[edit]

Related Classes[edit]