DgsCreateTab: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
m (Thisdp moved page DgsDxCreateTab to DgsCreateTab)

Revision as of 11:03, 20 January 2018

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

Custom Cursor Functions

Multi Language Supports

Animation

3D Element

3D Interface

3D Line

3D Image

3D Text

Browser

Button

Check Box

Combo Box

Custom Renderer

Edit

Detect Area

Drag'N Drop

Grid List

Image

Memo

Menu

Label

Layout

Line

Progress Bar

Radio Button

Scale Pane

Scroll Bar

Scroll Pane

Selector

Style

Switch Button

Tab Panel

Window

Basic Shape Plugins

Circle

Quadrilateral

Rounded Rectangle

Other Plugins

Blur Box

Canvas

Chart

Color Picker

Effect 3D

Gradient

Mask

Media Browser

Nine Slice

Object Preview Supports

Paste Handler

QRCode

Remote Image

Screen Source

SVG

Tooltips