DgsSetSelectedTab

From Multi Theft Auto: Wiki
Revision as of 13:41, 24 February 2018 by Thisdp (talk | contribs) (Created page with "{{Client function}} __NOTOC__ This function is used to change the currently selected tab in the specified dgs tab panel. ==Syntax== <syntaxhighlight lang="lua"> bool dgsSetS...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function is used to change the currently selected tab in the specified dgs tab panel.

Syntax

bool dgsSetSelectedTab ( dgsElement tabPanel, dgsElement tab )

Required Arguments

  • tabPanel: The dgs tab panel which current tab you want to retrieve.
  • theTab: The dgs tab which will be the new active tab.

Returns

Returns true if the selected tab was changed to a new one successfully, false otherwise.

Example

This example gets the current selected tab and sets the selected tab to the next available tab.

DGS = exports.dgs
local tabPanel = DGS:dgsCreateTabPanel ( 0, 0.1, 1, 1, true) --create a tab panel which fills the whole window
local tab1 = DGS:dgsCreateTab("Welcome",tabPanel) --create a tab for the tab panel above
local tab2 = DGS:dgsCreateTab("Info",tabPanel)--create another tab for the tab panel at the top

function check()
   if(DGS:dgsGetSelectedTab(tabPanel)==tab1)then --Check what tab is currently shown
      DGS:dgsSetSelectedTab(tabPanel,tab2) --if the "Welcome" tab is selected, change it to tab2("Info" tab)
   else
      DGS:dgsSetSelectedTab(tabPanel,tab1) --if the "Info" tab is selected, change it to tab1("Welcome" tab)
   end
end

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