<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/DgsMenuAddSeparator?action=history&amp;feed=atom</id>
	<title>DgsMenuAddSeparator - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/DgsMenuAddSeparator?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DgsMenuAddSeparator&amp;action=history"/>
	<updated>2026-05-07T11:45:58Z</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=DgsMenuAddSeparator&amp;diff=82221&amp;oldid=prev</id>
		<title>Mohab at 09:09, 10 July 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DgsMenuAddSeparator&amp;diff=82221&amp;oldid=prev"/>
		<updated>2025-07-10T09:09:46Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 09:09, 10 July 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l3&quot;&gt;Line 3:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 3:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This function adds a separator to a DGS menu. A separator is a visual divider that can be used to organize menu items into logical groups. It can be displayed as a horizontal line or as text.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This function adds a separator to a DGS menu. A separator is a visual divider that can be used to organize menu items into logical groups. It can be displayed as a horizontal line or as text.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[File:Dgs seperator.png|frame|right|alt=Dgs Seperator|A thin horizontal &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;line or vertical &lt;/del&gt;line used to visually divide sections of a DGS Menu]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[File:Dgs seperator.png|frame|right|alt=Dgs Seperator|A thin horizontal line used to visually divide sections of a DGS Menu]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[File:DGS Text Seperator.png|frame|right|alt=DGS Text Seperator|DGS Text Seperator]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[File:DGS Text Seperator.png|frame|right|alt=DGS Text Seperator|DGS Text Seperator]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki-wiki_dev_:diff::1.12:old-82219:rev-82221 --&gt;
&lt;/table&gt;</summary>
		<author><name>Mohab</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DgsMenuAddSeparator&amp;diff=82219&amp;oldid=prev</id>
		<title>Mohab at 08:32, 10 July 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DgsMenuAddSeparator&amp;diff=82219&amp;oldid=prev"/>
		<updated>2025-07-10T08:32:41Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 08:32, 10 July 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l2&quot;&gt;Line 2:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 2:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;__NOTOC__&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;__NOTOC__&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This function adds a separator to a DGS menu. A separator is a visual divider that can be used to organize menu items into logical groups. It can be displayed as a horizontal line or as text.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This function adds a separator to a DGS menu. A separator is a visual divider that can be used to organize menu items into logical groups. It can be displayed as a horizontal line or as text.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[File:Dgs seperator.png|frame|right|alt=Dgs Seperator|A thin horizontal line or vertical line used to visually divide sections of a DGS Menu]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[File:DGS Text Seperator.png|frame|right|alt=DGS Text Seperator|DGS Text Seperator]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Syntax==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Syntax==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki-wiki_dev_:diff::1.12:old-82217:rev-82219 --&gt;
&lt;/table&gt;</summary>
		<author><name>Mohab</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DgsMenuAddSeparator&amp;diff=82217&amp;oldid=prev</id>
		<title>Mohab: Created page with &quot;{{Client function}} __NOTOC__ This function adds a separator to a DGS menu. A separator is a visual divider that can be used to organize menu items into logical groups. It can be displayed as a horizontal line or as text.  ==Syntax== &lt;syntaxhighlight lang=&quot;lua&quot;&gt; int uniqueID, int position dgsMenuAddSeparator ( element menu [, string text, int parentItemID, int position ] ) &lt;/syntaxhighlight&gt;  ===Required Arguments=== *'''menu:''' The DGS menu element to add the separator...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DgsMenuAddSeparator&amp;diff=82217&amp;oldid=prev"/>
		<updated>2025-07-10T08:28:58Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Client function}} __NOTOC__ This function adds a separator to a DGS menu. A separator is a visual divider that can be used to organize menu items into logical groups. It can be displayed as a horizontal line or as text.  ==Syntax== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; int uniqueID, int position dgsMenuAddSeparator ( element menu [, string text, int parentItemID, int position ] ) &amp;lt;/syntaxhighlight&amp;gt;  ===Required Arguments=== *&amp;#039;&amp;#039;&amp;#039;menu:&amp;#039;&amp;#039;&amp;#039; The DGS menu element to add the separator...&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 adds a separator to a DGS menu. A separator is a visual divider that can be used to organize menu items into logical groups. It can be displayed as a horizontal line or as text.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int uniqueID, int position dgsMenuAddSeparator ( element menu [, string text, int parentItemID, int position ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''menu:''' The DGS menu element to add the separator to&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''text:''' The text to display for the separator. If not specified or ''nil'', a horizontal line will be drawn instead&lt;br /&gt;
*'''parentItemID:''' The unique ID of the parent item. If not specified, the separator will be added to the root menu&lt;br /&gt;
*'''position:''' The position where the separator should be inserted. If not specified, it will be added at the end&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the unique ID of the separator and its position if successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
===Example 1: Basic Separator (Line)===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
loadstring(exports.dgs:dgsImportFunction())()-- load functions&lt;br /&gt;
&lt;br /&gt;
-- Create a menu with items and separators&lt;br /&gt;
local menu = dgsCreateMenu(200, 200, 200, 150, false)&lt;br /&gt;
&lt;br /&gt;
-- Add some menu items&lt;br /&gt;
local item1 = dgsMenuAddItem(menu, &amp;quot;New File&amp;quot;, &amp;quot;file.new&amp;quot;)&lt;br /&gt;
local item2 = dgsMenuAddItem(menu, &amp;quot;Open File&amp;quot;, &amp;quot;file.open&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
-- Add a separator line&lt;br /&gt;
dgsMenuAddSeparator(menu)&lt;br /&gt;
&lt;br /&gt;
-- Add more items after the separator&lt;br /&gt;
local item3 = dgsMenuAddItem(menu, &amp;quot;Save&amp;quot;, &amp;quot;file.save&amp;quot;)&lt;br /&gt;
local item4 = dgsMenuAddItem(menu, &amp;quot;Save As&amp;quot;, &amp;quot;file.saveas&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
-- Add another separator&lt;br /&gt;
dgsMenuAddSeparator(menu)&lt;br /&gt;
&lt;br /&gt;
-- Add exit item&lt;br /&gt;
local item5 = dgsMenuAddItem(menu, &amp;quot;Exit&amp;quot;, &amp;quot;file.exit&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
-- Show the menu&lt;br /&gt;
dgsMenuShow(menu)&lt;br /&gt;
&lt;br /&gt;
-- Handle menu selections&lt;br /&gt;
addEventHandler(&amp;quot;onDgsMenuSelect&amp;quot;, menu, function(subMenu, uniqueID)&lt;br /&gt;
    if uniqueID == -1 then return end&lt;br /&gt;
    &lt;br /&gt;
    local command = dgsMenuGetItemCommand(source, uniqueID)&lt;br /&gt;
    outputChatBox(&amp;quot;Selected: &amp;quot; .. command)&lt;br /&gt;
    dgsMenuHide(source)&lt;br /&gt;
end, false)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example 2: Text Separator===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
loadstring(exports.dgs:dgsImportFunction())()-- load functions&lt;br /&gt;
&lt;br /&gt;
-- Create a menu with text separators (wider menu for better text visibility)&lt;br /&gt;
local menu = dgsCreateMenu(200, 200, 300, 250, false)&lt;br /&gt;
&lt;br /&gt;
-- Add file operations&lt;br /&gt;
local item1 = dgsMenuAddItem(menu, &amp;quot;New&amp;quot;, &amp;quot;file.new&amp;quot;)&lt;br /&gt;
local item2 = dgsMenuAddItem(menu, &amp;quot;Open&amp;quot;, &amp;quot;file.open&amp;quot;)&lt;br /&gt;
local item3 = dgsMenuAddItem(menu, &amp;quot;Save&amp;quot;, &amp;quot;file.save&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
-- Add a text separator&lt;br /&gt;
dgsMenuAddSeparator(menu, &amp;quot;--- Edit Operations ---&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
-- Add edit operations&lt;br /&gt;
local item4 = dgsMenuAddItem(menu, &amp;quot;Copy&amp;quot;, &amp;quot;edit.copy&amp;quot;)&lt;br /&gt;
local item5 = dgsMenuAddItem(menu, &amp;quot;Paste&amp;quot;, &amp;quot;edit.paste&amp;quot;)&lt;br /&gt;
local item6 = dgsMenuAddItem(menu, &amp;quot;Cut&amp;quot;, &amp;quot;edit.cut&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
-- Add another text separator&lt;br /&gt;
dgsMenuAddSeparator(menu, &amp;quot;--- View Options ---&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
-- Add view operations&lt;br /&gt;
local item7 = dgsMenuAddItem(menu, &amp;quot;Zoom In&amp;quot;, &amp;quot;view.zoomin&amp;quot;)&lt;br /&gt;
local item8 = dgsMenuAddItem(menu, &amp;quot;Zoom Out&amp;quot;, &amp;quot;view.zoomout&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
-- Show the menu&lt;br /&gt;
dgsMenuShow(menu)&lt;br /&gt;
&lt;br /&gt;
-- Handle menu selections&lt;br /&gt;
addEventHandler(&amp;quot;onDgsMenuSelect&amp;quot;, menu, function(subMenu, uniqueID)&lt;br /&gt;
    if uniqueID == -1 then return end&lt;br /&gt;
    &lt;br /&gt;
    local command = dgsMenuGetItemCommand(source, uniqueID)&lt;br /&gt;
    outputChatBox(&amp;quot;Selected: &amp;quot; .. command)&lt;br /&gt;
    dgsMenuHide(source)&lt;br /&gt;
end, false)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example 3: Separator with Position and Parent Item===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
loadstring(exports.dgs:dgsImportFunction())()-- load functions&lt;br /&gt;
&lt;br /&gt;
-- Create a menu with nested items and separators&lt;br /&gt;
local menu = dgsCreateMenu(200, 200, 200, 200, false)&lt;br /&gt;
&lt;br /&gt;
-- Add main menu items&lt;br /&gt;
local fileItem = dgsMenuAddItem(menu, &amp;quot;File&amp;quot;, &amp;quot;file&amp;quot;)&lt;br /&gt;
local editItem = dgsMenuAddItem(menu, &amp;quot;Edit&amp;quot;, &amp;quot;edit&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
-- Add items to the File submenu&lt;br /&gt;
local newItem = dgsMenuAddItem(menu, &amp;quot;New&amp;quot;, &amp;quot;file.new&amp;quot;, fileItem)&lt;br /&gt;
local openItem = dgsMenuAddItem(menu, &amp;quot;Open&amp;quot;, &amp;quot;file.open&amp;quot;, fileItem)&lt;br /&gt;
&lt;br /&gt;
-- Add a separator in the File submenu at position 3&lt;br /&gt;
local separatorID = dgsMenuAddSeparator(menu, nil, fileItem, 3)&lt;br /&gt;
&lt;br /&gt;
-- Add more items to the File submenu&lt;br /&gt;
local saveItem = dgsMenuAddItem(menu, &amp;quot;Save&amp;quot;, &amp;quot;file.save&amp;quot;, fileItem)&lt;br /&gt;
local exitItem = dgsMenuAddItem(menu, &amp;quot;Exit&amp;quot;, &amp;quot;file.exit&amp;quot;, fileItem)&lt;br /&gt;
&lt;br /&gt;
-- Add another separator with text in the File submenu&lt;br /&gt;
dgsMenuAddSeparator(menu, &amp;quot;Recent Files&amp;quot;, fileItem)&lt;br /&gt;
&lt;br /&gt;
-- Add recent file items&lt;br /&gt;
local recent1 = dgsMenuAddItem(menu, &amp;quot;document1.txt&amp;quot;, &amp;quot;file.recent1&amp;quot;, fileItem)&lt;br /&gt;
local recent2 = dgsMenuAddItem(menu, &amp;quot;document2.txt&amp;quot;, &amp;quot;file.recent2&amp;quot;, fileItem)&lt;br /&gt;
&lt;br /&gt;
-- Show the menu&lt;br /&gt;
dgsMenuShow(menu)&lt;br /&gt;
&lt;br /&gt;
-- Handle menu selections&lt;br /&gt;
addEventHandler(&amp;quot;onDgsMenuSelect&amp;quot;, menu, function(subMenu, uniqueID)&lt;br /&gt;
    if uniqueID == -1 then return end&lt;br /&gt;
    &lt;br /&gt;
    local command = dgsMenuGetItemCommand(source, uniqueID)&lt;br /&gt;
    outputChatBox(&amp;quot;Selected: &amp;quot; .. command)&lt;br /&gt;
    dgsMenuHide(source)&lt;br /&gt;
end, false)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example 4: Context Menu with Separators===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
loadstring(exports.dgs:dgsImportFunction())()-- load functions&lt;br /&gt;
&lt;br /&gt;
-- Create a context menu that appears on right-click&lt;br /&gt;
local contextMenu = dgsCreateMenu(200, 200, 180, 150, false)&lt;br /&gt;
&lt;br /&gt;
-- Add context menu items&lt;br /&gt;
local cutItem = dgsMenuAddItem(contextMenu, &amp;quot;Cut&amp;quot;, &amp;quot;cut&amp;quot;)&lt;br /&gt;
local copyItem = dgsMenuAddItem(contextMenu, &amp;quot;Copy&amp;quot;, &amp;quot;copy&amp;quot;)&lt;br /&gt;
local pasteItem = dgsMenuAddItem(contextMenu, &amp;quot;Paste&amp;quot;, &amp;quot;paste&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
-- Add separator&lt;br /&gt;
dgsMenuAddSeparator(contextMenu)&lt;br /&gt;
&lt;br /&gt;
-- Add more options&lt;br /&gt;
local selectAllItem = dgsMenuAddItem(contextMenu, &amp;quot;Select All&amp;quot;, &amp;quot;selectall&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
-- Add separator with text&lt;br /&gt;
dgsMenuAddSeparator(contextMenu, &amp;quot;Properties&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
-- Add properties item&lt;br /&gt;
local propertiesItem = dgsMenuAddItem(contextMenu, &amp;quot;Item Properties&amp;quot;, &amp;quot;properties&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
-- Create a button that shows the context menu&lt;br /&gt;
local button = dgsCreateButton(400, 400, 200, 50, &amp;quot;Right Click Me&amp;quot;, false)&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onDgsMouseClickUp&amp;quot;, button, function(mouseButton)&lt;br /&gt;
    if mouseButton == &amp;quot;right&amp;quot; then&lt;br /&gt;
        local x, y = dgsGetCursorPosition()&lt;br /&gt;
        dgsMenuShow(contextMenu, x, y)&lt;br /&gt;
    end&lt;br /&gt;
end)&lt;br /&gt;
&lt;br /&gt;
-- Handle context menu selections&lt;br /&gt;
addEventHandler(&amp;quot;onDgsMenuSelect&amp;quot;, contextMenu, function(subMenu, uniqueID)&lt;br /&gt;
    if uniqueID == -1 then return end&lt;br /&gt;
    &lt;br /&gt;
    local command = dgsMenuGetItemCommand(source, uniqueID)&lt;br /&gt;
    outputChatBox(&amp;quot;Context action: &amp;quot; .. command)&lt;br /&gt;
    dgsMenuHide(source)&lt;br /&gt;
end, false)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
*[[dgsMenuAddItem]]&lt;br /&gt;
*[[dgsMenuRemoveItem]]&lt;br /&gt;
*[[dgsCreateMenu]]&lt;br /&gt;
*[[dgsMenuShow]]&lt;br /&gt;
*[[dgsMenuHide]]&lt;br /&gt;
&lt;br /&gt;
==Author==&lt;br /&gt;
[[User:Mohab|Mohab]].&lt;/div&gt;</summary>
		<author><name>Mohab</name></author>
	</entry>
</feed>