Skip to content

Commit abf821a

Browse files
committed
add Tab and TabbedPanel
1 parent 96cad4d commit abf821a

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

shared/ScriptUI.d.ts

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2110,6 +2110,43 @@ declare class Panel extends _Control {
21102110
remove(what: any): void
21112111
}
21122112

2113+
/**
2114+
* A container for other types of controls.
2115+
* Differs from a panel element in that is must be a direct child of a tabbedpanel element, the title is shown in the selection tab, and it does not have a script-definable border.
2116+
*/
2117+
declare class Tab extends Panel {
2118+
/**
2119+
* The parent element.
2120+
*/
2121+
readonly parent: TabbedPanel
2122+
}
2123+
2124+
/**
2125+
* A container for selectable tab containers.
2126+
* Differs from a panel element in that it can contain only tab elements as direct children.
2127+
*/
2128+
declare class TabbedPanel extends Panel {
2129+
/**
2130+
* An array of child elements.
2131+
*/
2132+
readonly children: Tab[]
2133+
2134+
/**
2135+
* The currently selected tab.
2136+
* Setting this value causes the specified tab to be enabled in the panel.
2137+
* You can set the value using the index of an item, rather than an object reference.
2138+
* If set to an index value that is out of range, the operation is ignored.
2139+
* When set with an index value, the property still returns an object reference.
2140+
* When the value of the selection property changes, either by a user selecting a different tab, or by a script setting the property, the TabbedPanel receives an onChange notification.
2141+
*/
2142+
selection: Tab | number
2143+
2144+
/**
2145+
* An event-handler callback function, called when the selected tab has changed.
2146+
*/
2147+
onChange(): void
2148+
}
2149+
21132150
/**
21142151
* Defines the location of a window or UI element. Contains a 2-element array.
21152152
* Specifies the origin point of an element as horizontal and vertical pixel offsets from the origin of the element's coordinate space.
@@ -2862,6 +2899,20 @@ interface _AddControl {
28622899
properties?: Partial<_AddControlPropertiesStaticText>,
28632900
): StaticText
28642901

2902+
(
2903+
type: "tab",
2904+
bounds: Bounds | [number, number, number, number],
2905+
text?: string[],
2906+
properties?: Partial<_AddControlProperties>,
2907+
): Tab
2908+
2909+
(
2910+
type: "tabbedpanel",
2911+
bounds?: Bounds | [number, number, number, number],
2912+
text?: string,
2913+
properties?: Partial<_AddControlProperties>,
2914+
): TabbedPanel
2915+
28652916
(
28662917
type: "treeview",
28672918
bounds?: Bounds | [number, number, number, number],

0 commit comments

Comments
 (0)