HomeForumSourceResearchGuide
Sign in to contribute to source. how it works
Type definition file ui.TabList by barry
expand copy to clipboardexpand
uses Color
uses Font
uses data.String

/* {"description" : "Data type to deliver event information from tab list events."} */
data TabDetails {
	/* {"@description" : "The ID of the tab to which the event relates."} */
	int id
	/* {"@description" : "The text value of the tab to which the event relates."} */
	char text[]
	/* {"@description" : "The data instance associated with the tab to which the event relates."} */
	Data value
}

/* {"description" : "API to display a list of clickable tabs in a user interface."} */
interface TabList extends KeyEventObject {
	
	/* {"@description" : "An event which reports when the user clicks on a tab that's different to the currently-selected one."} */
	event select(TabDetails t)
	/* {"@description" : "An event which reports when the user deletes a tab."} */
	event delete(TabDetails t)
	/* {"@description" : "An event which reports when the user adds a tab."} */
	event add(TabDetails t)
	/* {"@description" : "An event which reports when the user drops a file over the tab list."} */
	event fileDrop(String filePath)
	
	/* {"@description" : "Instantiate a new tab list widget."} */
	TabList()
	
	/* {"@description" : "Add a new tab to the tab list, returning an integer ID for that tab."} */
	int add(char text[], opt store Data value)

	/* {"@description" : "Update a tab with new details."} */
	void update(int id, char text[], opt store Data value)

	/* {"@description" : "Remove a tab from the tab list."} */
	void remove(int id)

	/* {"@description" : "Set a tab as the currently-selected one."} */
	void select(int id)

	/* {"@description" : "Get which tab is currently selected."} */
	int getSelected()

	/* {"@description" : "Get tab ID list."} */
	int[] getTabs()

	/* {"@description" : "Get tab details by ID."} */
	TabDetails getDetails(int id)
	
	/* {"@description" : "Set the width in pixels."} */
	void setWidth(int w)
	
	/* {"@description" : "Set the background of the tab list."} */
	void setBackground(store Color c)
	/* {"@description" : "Set the background color of nonselected tabs."} */
	void setOffColor(store Color c)
	/* {"@description" : "Set the background color of the selected tab."} */
	void setOnColor(store Color c)
	/* {"@description" : "Set the text color of non-selected tabs."} */
	void setTextOffColor(store Color c)
	/* {"@description" : "Set the text color of the selected tab."} */
	void setTextOnColor(store Color c)
	/* {"@description" : "Set the text font of the tab list."} */
	void setFont(store Font font)
	
	}
Revision history
To propose a new revision to this entity, use dana source put -ut your/new/version.dn -n ui.TabList -m "reason for update" -u yourUsername
Version 2 (this version) by barry
Notes for this version: Updates docstrings
Version 1 by barry