<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/DgsGetSelectedTab?action=history&amp;feed=atom</id>
	<title>DgsGetSelectedTab - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/DgsGetSelectedTab?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DgsGetSelectedTab&amp;action=history"/>
	<updated>2026-05-21T08:30:39Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DgsGetSelectedTab&amp;diff=54053&amp;oldid=prev</id>
		<title>Thisdp: Created page with &quot;{{Client function}} __NOTOC__ This function returns the currently selected tab in the specified dgs tab panel.  ==Syntax==  &lt;syntaxhighlight lang=&quot;lua&quot;&gt; dgsElement dgsGetSelec...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DgsGetSelectedTab&amp;diff=54053&amp;oldid=prev"/>
		<updated>2018-02-24T13:39:36Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Client function}} __NOTOC__ This function returns the currently selected tab in the specified dgs tab panel.  ==Syntax==  &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; dgsElement dgsGetSelec...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function returns the currently selected tab in the specified dgs tab panel.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
dgsElement dgsGetSelectedTab ( dgsElement tabPanel )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''tabPanel:''' The dgs tab panel which current tab you want to retrieve.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a dgsElement of the dgs-dxtab if a tab was selected or [[nil]] if no tab was selected. If passed arguments were invalid or something went wrong, the function will return ''false''.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example gets the current selected tab and sets the selected tab to the next available tab.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
DGS = exports.dgs&lt;br /&gt;
local tabPanel = DGS:dgsCreateTabPanel ( 0, 0.1, 1, 1, true) --create a tab panel which fills the whole window&lt;br /&gt;
local tab1 = DGS:dgsCreateTab(&amp;quot;Welcome&amp;quot;,tabPanel) --create a tab for the tab panel above&lt;br /&gt;
local tab2 = DGS:dgsCreateTab(&amp;quot;Info&amp;quot;,tabPanel)--create another tab for the tab panel at the top&lt;br /&gt;
&lt;br /&gt;
function check()&lt;br /&gt;
   if(DGS:dgsGetSelectedTab(tabPanel)==tab1)then --Check what tab is currently shown&lt;br /&gt;
      DGS:dgsSetSelectedTab(tabPanel,tab2) --if the &amp;quot;Welcome&amp;quot; tab is selected, change it to tab2(&amp;quot;Info&amp;quot; tab)&lt;br /&gt;
   else&lt;br /&gt;
      DGS:dgsSetSelectedTab(tabPanel,tab1) --if the &amp;quot;Info&amp;quot; tab is selected, change it to tab1(&amp;quot;Welcome&amp;quot; tab)&lt;br /&gt;
   end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{DGSFUNCTIONS}}&lt;/div&gt;</summary>
		<author><name>Thisdp</name></author>
	</entry>
</feed>