From e24869d73019689b3612e624f0620667fbd7609d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20R=C3=BCegg?= Date: Mon, 6 Mar 2023 03:18:47 +0100 Subject: [PATCH] Add sections for `item`, `menu`, & `separator` --- docs/syntax/dynamic.html | 153 +++++++++++++++++++++++++++++++++------ 1 file changed, 132 insertions(+), 21 deletions(-) diff --git a/docs/syntax/dynamic.html b/docs/syntax/dynamic.html index 3e7a38b..bc627d2 100644 --- a/docs/syntax/dynamic.html +++ b/docs/syntax/dynamic.html @@ -1,11 +1,35 @@ -

Dynamic Items

-
-

This section adds new menu items to the context menu.

-

Dynamic items have three types (menu, item, and separator). with properties to add new items with customization - explained below in more details.
The types (menu and item) must contain the property title at least and their - value cannot be null.
A separator-type item can be added without any - properties.

-

In the following example, it shows how to write add an items to dynamic:

+

Dynamic Items

+
+

The dynamic section adds new menu items to the context menu.

+ +
Sub-items
+

The section can have the following entry types, all of which are optional:

+ +

While the var block should be at the top of the section, the other entries can appear in any order.

+ +
Example
+

In the following example, one top-level item is created, that is separated with a horizontal line from an adjacent sub-menu, + which in turn has one sub-item + on its own:

shell 
 {
     dynamic
@@ -14,13 +38,79 @@
         separator
         menu(title = 'sub menu' image = #0000ff)
         {
-            item(title = 'test subitem')
+            item(title = 'test sub-item')
         }
     }
 }
-
-
-

Properties

+
+ +

Items

+ +

items create a single menu entry.

+ +
Properties
+

Only the title property is mandatory (set to a non-null value). Please refer to the properties section below for further + details.

+ +
Syntax
+
item( title = value [property = value [...] ])
+
+ + + +

menu entries create a new sub-menu. They have properties + and sub-entries.

+ + +

Only the title property is mandatory (set to a non-null value). Please refer to the properties section below for further + details.

+ + +

menus can have the following entry types, all of which are + optional:

+ + + +
menu( title = value [property = value [...] ])
+{
+	[ item() [...] ]
+	[ menu(){} [...] ]
+	[ separator [...] ]
+	[ import 'path/to/import.nss' [...] ]
+}
+
+ +

Separators

+ +

separators create a horizontal line.

+ +
Properties
+

separators do not have any mandatory properties. Please refer to the properties section below for further + details.

+ +
Syntax
+
separator
+separator( property = value [property = value [...] ])
+
+ + +

Properties

@@ -41,8 +131,12 @@ @@ -246,7 +340,9 @@ -
Title Sets a value indicating the caption of the menuitem.
-

This property must be included with menu and item if image propery is not - defined, not required for separator.

+

For menu and item entries, this property must be included with if no + image + property is defined.

Default = null

Required for menu, item.

Position (pos)The position at which a menuitem should be inserted into the menu.
Position can have one of the +
The position at which a menuitem should be inserted into the menu.
Position can have one of the following parameters: @@ -255,15 +351,24 @@ - + - + - + @@ -458,7 +563,9 @@ @@ -490,7 +598,10 @@
MiddleInsert the menuitem to the middle of the menu.Insert the menuitem to the middle of the menu. +
TopInsert the menuitem to the top of the menu.Insert the menuitem to the top of the menu. +
BottomInsert the menuitem to the bottom of the menu.Insert the menuitem to the bottom of the menu. +
Number sets
Default -

Specifies that the menuitem is the default. A menu can contain only one default menuitem, which is +

Specifies that the menuitem is the default. A menu can contain only one default menuitem, which is displayed in bold.

Default = false

Required for item.

@@ -468,7 +575,8 @@
Expanded -

Move items to the parent item.

+

Move items to the parent menu.

Default = false

Required for menu.

Tip -

Show a tip for the current item

+

Show a tip for the current menu or item. +

Default = null
Syntax