DgsCreateTab

From Multi Theft Auto: Wiki

This function creates a tab on a pre-existing tab panel. A tab is a button as well as a 'dimension' that can be used to switch between information by clicking on the tabs. Tabs are sorted on a tab panel in the order that they are created.

Syntax

element dgsCreateTab ( string text, element parent [,int scalex = 1, int scaley = 1, int textcolor = 0xFFFFFFFF, element bgimg = nil, int bgcolor = 0x000000C8, element tabdefimg = nil, element tabhovimg = nil, element tabcliimg = nil, int tabdefcolor = 282828B4, int tabhovcolor = 0x505050BE, int tabclicolor = 0X000000C8])

Required Arguments

Example tab panel with two tabs.
  • text: The caption for the tab
  • parent: The parent tab panel, as a tab panel element type

Optional Arguments

  • scalex: A float of the 2D x scale of the text of the tab.
  • scaley: A float of the 2D y scale of the text of the tab.
  • bgimg: An image element of the background image of the panel of the tab.
  • bgcolor: An integer of the background color of the panel of the tab.
  • tabdefimg: An image element of the background image of the tab (default state).
  • tabhovimg: An image element of the background imag of the tab (hovered state).
  • tabcliimg: An image element of the background image of the tab (clicked state).
  • tabdefcolor: An integer of the background color of the tab (default state).
  • tabselcolor: An integer of the background color of the tab (hovered state).
  • tabclicolor: An integer of the background color of the tab (clicked state).

Returns

Returns a dgs-dxtab element if successful, false otherwise.

Example

This example creates a information window and adds two tabs to a "tabPanel" tabpanel, and adds some other dgs elements to it.

DGS = exports.dgs
local myWindow = DGS:dgsCreateWindow ( 0, 0, 0.5, 0.4, "Information", true )--create a window which has "Information" in the title bar.
local tabPanel = DGS:dgsCreateTabPanel ( 0, 0.1, 1, 1, true, myWindow ) --create a tab panel which fills the whole window
local tabMap = DGS:dgsCreateTab( "Map Information", tabPanel ) -- create a tab named "Map Information" on 'tabPanel'
local tabHelp = DGS:dgsCreateTab( "Help", tabPanel ) -- create another tab named "Help" on 'tabPanel'

-- adds a label (text) to each tab
DGS:dgsCreateLabel(0.02,0.04,0.94,0.2,"This is information about the current map",true,tabMap)
DGS:dgsCreateLabel(0.02,0.04,0.94,0.92,"This is help text.",true,tabHelp)

See Also

Multi Language Supports

Animation

3D Interface

3D Text

Arrow List

Browser

Button

Check Box

Combo Box

Custom Renderer

Edit

Ellipse Detect Area

Detect Area

Grid List

Image

Memo

Label

Progress Bar

Radio Button

Scroll Bar

Scroll Pane

Switch Button

Tab Panel

Window

Plugin

Media Browser

Rounded Rectangle

Color Picker

Blur Box

Effect 3D

Nine Slice