AllLangHelp_sbasic.mk                            |    1 
 source/auxiliary/sbasic.tree                     |    1 
 source/text/sbasic/shared/03/lib_ScriptForge.xhp |   41 ++
 source/text/sbasic/shared/03/sf_chart.xhp        |    4 
 source/text/sbasic/shared/03/sf_document.xhp     |   83 +++++
 source/text/sbasic/shared/03/sf_menu.xhp         |  321 +++++++++++++++++++++++
 source/text/sbasic/shared/03/sf_popupmenu.xhp    |   91 +++---
 source/text/sbasic/shared/03/sf_writer.xhp       |    7 
 8 files changed, 495 insertions(+), 54 deletions(-)

New commits:
commit 9de15af089243bac07ce6ea9b7d505163c1b3f78
Author:     Rafael Lima <rafael.palma.l...@gmail.com>
AuthorDate: Tue Jan 25 18:43:09 2022 +0100
Commit:     Alain Romedenne <libreoffici...@gerrit.libreoffice.org>
CommitDate: Fri Jan 28 14:53:20 2022 +0100

    Create documentation for SFWidgets.Menu service
    
    Change-Id: Iaf0d10c2a1100d78098a99c93a2479d31b0f412b
    Reviewed-on: https://gerrit.libreoffice.org/c/help/+/128947
    Tested-by: Jenkins
    Reviewed-by: Alain Romedenne

diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk
index b474f1396..1c921a60d 100644
--- a/AllLangHelp_sbasic.mk
+++ b/AllLangHelp_sbasic.mk
@@ -96,6 +96,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\
     helpcontent2/source/text/sbasic/shared/03/sf_formcontrol \
     helpcontent2/source/text/sbasic/shared/03/sf_intro \
     helpcontent2/source/text/sbasic/shared/03/sf_l10n \
+    helpcontent2/source/text/sbasic/shared/03/sf_menu \
     helpcontent2/source/text/sbasic/shared/03/sf_methods \
     helpcontent2/source/text/sbasic/shared/03/sf_platform \
     helpcontent2/source/text/sbasic/shared/03/sf_popupmenu \
diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree
index 2a0b27123..5f9a653db 100644
--- a/source/auxiliary/sbasic.tree
+++ b/source/auxiliary/sbasic.tree
@@ -354,6 +354,7 @@
             <topic id="sbasic/text/sbasic/shared/03/sf_form.xhp">Form 
service</topic>
             <topic 
id="sbasic/text/sbasic/shared/03/sf_formcontrol.xhp">FormControl service</topic>
             <topic id="sbasic/text/sbasic/shared/03/sf_l10n.xhp">L10N 
service</topic>
+            <topic id="sbasic/text/sbasic/shared/03/sf_menu.xhp">Menu 
service</topic>
             <topic id="sbasic/text/sbasic/shared/03/sf_platform.xhp">Platform 
service</topic>
             <topic 
id="sbasic/text/sbasic/shared/03/sf_popupmenu.xhp">PopupMenu service</topic>
             <topic id="sbasic/text/sbasic/shared/03/sf_services.xhp">Services 
service</topic>
diff --git a/source/text/sbasic/shared/03/lib_ScriptForge.xhp 
b/source/text/sbasic/shared/03/lib_ScriptForge.xhp
index 2d1c640a2..6ef001131 100644
--- a/source/text/sbasic/shared/03/lib_ScriptForge.xhp
+++ b/source/text/sbasic/shared/03/lib_ScriptForge.xhp
@@ -58,6 +58,9 @@
        <tablecell>
          <paragraph id="par_id441613839128931" localize="false" 
role="tablehead"></paragraph>
        </tablecell>
+       <tablecell>
+         <paragraph id="par_id441613839128041" localize="false" 
role="tablehead"></paragraph>
+       </tablecell>
     </tablerow>
     <tablerow>
        <tablecell>
@@ -67,14 +70,18 @@
          <paragraph role="tablecontent" localize="false" 
id="par_id581613836728425">
            <link href="text/sbasic/shared/03/lib_ScriptForge.xhp#Array" 
name="Array service">Array</link><br/>
            <link href="text/sbasic/shared/03/lib_ScriptForge.xhp#Dictionary" 
name="Dictionary service">Dictionary</link><br/>
-           <link href="text/sbasic/shared/03/lib_ScriptForge.xhp#Exception" 
name="Exception service">Exception</link><br/>
          </paragraph>
        </tablecell>
        <tablecell>
          <paragraph role="tablecontent" localize="false" 
id="par_id731613840022120">
+           <link href="text/sbasic/shared/03/lib_ScriptForge.xhp#Exception" 
name="Exception service">Exception</link><br/>
            <link href="text/sbasic/shared/03/lib_ScriptForge.xhp#FileSystem" 
name="FileSystem service">FileSystem</link><br/>
+         </paragraph>
+       </tablecell>
+       <tablecell>
+         <paragraph id="par_id701643305576028" localize="false" 
role="tablecontent">
            <link href="text/sbasic/shared/03/lib_ScriptForge.xhp#String" 
name="String service">String</link><br/>
-           <link href="text/sbasic/shared/03/lib_ScriptForge.xhp#TextStream" 
name="TextStream service">TextStream</link>
+           <link href="text/sbasic/shared/03/lib_ScriptForge.xhp#TextStream" 
name="TextStream service">TextStream</link><br/>
          </paragraph>
        </tablecell>
     </tablerow>
@@ -86,13 +93,18 @@
          <paragraph role="paragraph" localize="false" 
id="par_id771613836902464">
            <link href="text/sbasic/shared/03/lib_ScriptForge.xhp#Base" 
name="Base service">Base</link><br/>
            <link href="text/sbasic/shared/03/lib_ScriptForge.xhp#Calc" 
name="Calc service">Calc</link><br/>
-           <link href="text/sbasic/shared/03/lib_ScriptForge.xhp#Chart" 
name="Chart service">Chart</link>
          </paragraph>
        </tablecell>
        <tablecell>
          <paragraph id="par_id441543838858931" localize="false" 
role="tablecontent">
+           <link href="text/sbasic/shared/03/lib_ScriptForge.xhp#Chart" 
name="Chart service">Chart</link><br/>
            <link href="text/sbasic/shared/03/lib_ScriptForge.xhp#Database" 
name="Database service">Database</link><br/>
-           <link href="text/sbasic/shared/03/lib_ScriptForge.xhp#Document" 
name="Document service">Document</link><br/><br/>
+         </paragraph>
+       </tablecell>
+       <tablecell>
+         <paragraph id="par_id701643305576137" localize="false" 
role="tablecontent">
+           <link href="text/sbasic/shared/03/lib_ScriptForge.xhp#Document" 
name="Document service">Document</link><br/>
+           <link href="text/sbasic/shared/03/lib_ScriptForge.xhp#Writer" 
name="Writer service">Writer</link><br/>
          </paragraph>
        </tablecell>
     </tablerow>
@@ -110,8 +122,13 @@
        <tablecell>
          <paragraph id="par_id441613885558931" localize="false" 
role="tablecontent">
            <link href="text/sbasic/shared/03/lib_ScriptForge.xhp#FormControl" 
name="FormControl service">FormControl</link><br/>
+           <link href="text/sbasic/shared/03/lib_ScriptForge.xhp#Menu" 
name="Menu service">Menu</link><br/><br/>
+         </paragraph>
+       </tablecell>
+       <tablecell>
+         <paragraph id="par_id701643305576632" localize="false" 
role="tablecontent">
            <link href="text/sbasic/shared/03/lib_ScriptForge.xhp#PopupMenu" 
name="PopupMenu service">PopupMenu</link><br/>
-           <link href="text/sbasic/shared/03/lib_ScriptForge.xhp#UI" name="UI 
service">UI</link><br/>
+           <link href="text/sbasic/shared/03/lib_ScriptForge.xhp#UI" name="UI 
service">UI</link><br/><br/>
          </paragraph>
        </tablecell>
     </tablerow>
@@ -123,14 +140,18 @@
          <paragraph role="tablecontent" localize="false" 
id="par_id461613837133275">
            <link href="text/sbasic/shared/03/lib_ScriptForge.xhp#Basic" 
name="Basic service">Basic</link><br/>
            <link href="text/sbasic/shared/03/lib_ScriptForge.xhp#L10N" 
name="L10N service">L10N</link><br/>
-           <link href="text/sbasic/shared/03/lib_ScriptForge.xhp#Platform" 
name="Platform service">Platform</link>
          </paragraph>
        </tablecell>
        <tablecell>
          <paragraph id="par_id441613723858931" localize="false" 
role="tablecontent">
+           <link href="text/sbasic/shared/03/lib_ScriptForge.xhp#Platform" 
name="Platform service">Platform</link><br/>
            <link href="text/sbasic/shared/03/lib_ScriptForge.xhp#Services" 
name="Services service">Services</link><br/>
+         </paragraph>
+       </tablecell>
+       <tablecell>
+         <paragraph id="par_id701643305572058" localize="false" 
role="tablecontent">
            <link href="text/sbasic/shared/03/lib_ScriptForge.xhp#Session" 
name="Session service">Session</link><br/>
-           <link href="text/sbasic/shared/03/lib_ScriptForge.xhp#Timer" 
name="Timer service">Timer</link>
+           <link href="text/sbasic/shared/03/lib_ScriptForge.xhp#Timer" 
name="Timer service">Timer</link><br/>
          </paragraph>
        </tablecell>
     </tablerow>
@@ -180,6 +201,9 @@
     <section id="L10N">
       <embed href="text/sbasic/shared/03/sf_l10n.xhp#abstract"/>
     </section>
+    <section id="Menu">
+      <embed href="text/sbasic/shared/03/sf_menu.xhp#abstract"/>
+    </section>
     <section id="Platform">
       <embed href="text/sbasic/shared/03/sf_platform.xhp#abstract"/>
     </section>
@@ -204,6 +228,9 @@
     <section id="UI">
       <embed href="text/sbasic/shared/03/sf_ui.xhp#abstract"/>
     </section>
+    <section id="Writer">
+      <embed href="text/sbasic/shared/03/sf_writer.xhp#abstract"/>
+    </section>
     <comment>Restricted use for SF_Root, SF_Utils modules as well as internal 
methods</comment>
     <paragraph role="paragraph" id="par_id331608220104798"><emph>Note:</emph> 
Other <literal>ScriptForge</literal> undescribed modules are reserved for 
internal use. Their content is subject to change without notice.</paragraph>
     <section id="SF_InternalUse">
diff --git a/source/text/sbasic/shared/03/sf_chart.xhp 
b/source/text/sbasic/shared/03/sf_chart.xhp
index 4e77e41d0..a5f6d22bd 100644
--- a/source/text/sbasic/shared/03/sf_chart.xhp
+++ b/source/text/sbasic/shared/03/sf_chart.xhp
@@ -10,7 +10,7 @@
 -->
 <meta>
   <topic id="SF_Chart" indexer="include" status="PUBLISH">
-    <title id="tit" xml-lang="en-US">ScriptForge.Chart service</title>
+    <title id="tit" xml-lang="en-US">SFDocuments.Chart service</title>
     <filename>/text/sbasic/shared/03/sf_chart.xhp</filename>
   </topic>
   </meta>
@@ -21,7 +21,7 @@
     </bookmark>
   </section>
   <section id="abstract">
-    <h1 id="bm_id681600788076499"><variable id="ChartService"><link 
href="text/sbasic/shared/03/sf_chart.xhp" name="Chart 
service"><literal>ScriptForge</literal>.<literal>Chart</literal> 
service</link></variable></h1>
+    <h1 id="bm_id681600788076499"><variable id="ChartService"><link 
href="text/sbasic/shared/03/sf_chart.xhp" name="Chart 
service"><literal>SFDocuments</literal>.<literal>Chart</literal> 
service</link></variable></h1>
     <paragraph role="paragraph" id="par_id181600788076612">The 
<literal>Chart</literal> service provides a set of properties and methods to 
handle charts in Calc documents. With this service it is possible 
to:</paragraph>
     <list type="unordered">
       <listitem>
diff --git a/source/text/sbasic/shared/03/sf_document.xhp 
b/source/text/sbasic/shared/03/sf_document.xhp
index 2a7f2d084..7bef27181 100644
--- a/source/text/sbasic/shared/03/sf_document.xhp
+++ b/source/text/sbasic/shared/03/sf_document.xhp
@@ -294,12 +294,14 @@
            <paragraph id="par_id761611086279902" role="tablecontent" 
localize="false">
              <link href="text/sbasic/shared/03/sf_document.xhp#Activate" 
name="Activate method">Activate</link><br/>
              <link href="text/sbasic/shared/03/sf_document.xhp#CloseDocument" 
name="CloseDocument method">CloseDocument</link><br/>
+             <link href="text/sbasic/shared/03/sf_document.xhp#CreateMenu" 
name="CreateMenu method">CreateMenu</link><br/>
              <link href="text/sbasic/shared/03/sf_document.xhp#ExportAsPDF" 
name="ExportAsPDF method">ExportAsPDF</link><br/>
            </paragraph>
        </tablecell>
        <tablecell>
            <paragraph id="par_id141611086279902" role="tablecontent" 
localize="false">
              <link href="text/sbasic/shared/03/sf_document.xhp#PrintOut" 
name="PrintOut method">PrintOut</link><br/>
+             <link href="text/sbasic/shared/03/sf_document.xhp#RemoveMenu" 
name="RemoveMenu method">RemoveMenu</link><br/>
              <link href="text/sbasic/shared/03/sf_document.xhp#RunCommand" 
name="RunCommand method">RunCommand</link><br/>
              <link href="text/sbasic/shared/03/sf_document.xhp#Save" 
name="Save method">Save</link><br/>
            </paragraph>
@@ -308,7 +310,7 @@
            <paragraph id="par_id761611086279903" role="tablecontent" 
localize="false">
              <link href="text/sbasic/shared/03/sf_document.xhp#SaveAs" 
name="SaveAs method">SaveAs</link><br/>
              <link href="text/sbasic/shared/03/sf_document.xhp#SaveCopyAs" 
name="SaveCopyAs method">SaveCopyAs</link><br/>
-             <link href="text/sbasic/shared/03/sf_document.xhp#SetPrinter" 
name="SetPrinter method">SetPrinter</link><br/>
+             <link href="text/sbasic/shared/03/sf_document.xhp#SetPrinter" 
name="SetPrinter method">SetPrinter</link><br/><br/>
            </paragraph>
        </tablecell>
    </tablerow>
@@ -371,6 +373,52 @@
   </pycode>
 </section>
 
+<section id="CreateMenu">
+  <comment> CreateMenu 
---------------------------------------------------------------------------------------------
 </comment>
+  <bookmark xml-lang="en-US" localize="false" branch="index" 
id="bm_id721589200120958">
+    <bookmark_value>Document service;CreateMenu</bookmark_value>
+  </bookmark>
+  <h2 id="hd_id261589200121339" localize="false">CreateMenu</h2>
+  <paragraph role="paragraph" id="par_id651589200121080">Creates a new menu 
entry in the menubar of a given document window.</paragraph>
+  <paragraph role="paragraph" id="par_id981611149616155">This method returns 
an instance of the <link href="text/sbasic/shared/03/sf_menu.xhp" 
name="Menu_link1"><input>SFWidgets.Menu</input></link> service.</paragraph>
+  <note id="par_id721643121487974">The menu created is only available during 
the current %PRODUCTNAME session and is not saved neither in the document nor 
in the global application settings. Hence closing the document window will make 
the menu disappear. It will only reappear when the macro that creates the menu 
is executed again.</note>
+  <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
+  <paragraph role="paragraph" localize="false" id="par_id1001622887222964">
+    <input>svc.CreateMenu(menuheader: str, [before: any], submenuchar: str = 
"&gt;"): svc</input>
+  </paragraph>
+  <embed href="text/sbasic/shared/00000003.xhp#functparameters"/>
+  <paragraph role="paragraph" 
id="par_id361589200120316"><emph>menuheader</emph>: The toplevel name of the 
new menu.</paragraph>
+  <paragraph role="paragraph" id="par_id361589200129686"><emph>before</emph>: 
The name (as a string) or position (as an integer starting at 1) of an existing 
menu before which the new menu will be placed. If no value is defined for this 
argument, the menu will be created at the last position in the 
menubar.</paragraph>
+  <paragraph role="paragraph" 
id="par_id361589200122507"><emph>submenuchar</emph>: The delimiter used to 
create menu trees when calling methods as <literal>AddItem</literal> from the 
<literal>Menu</literal> service. The default value is "&gt;".</paragraph>
+  <embed href="text/sbasic/shared/00000003.xhp#functexample"/>
+  <embed href="text/sbasic/shared/00000003.xhp#In_Basic"/>
+  <bascode>
+    <paragraph role="bascode" localize="false" id="bas_id891580290121500">Dim 
oDoc as Object, oMenu as Object</paragraph>
+    <paragraph role="bascode" localize="false" id="bas_id515892005061251">Set 
oDoc = CreateScriptService("Document")</paragraph>
+    <paragraph role="bascode" id="bas_id751622827903865">Set oMenu = 
oDoc.CreateMenu("My Menu")</paragraph>
+    <paragraph role="bascode" localize="false" id="bas_id621643120224240">With 
oMenu</paragraph>
+    <paragraph role="bascode" id="bas_id391643120224507">    ' Add items to 
the menu</paragraph>
+    <paragraph role="bascode" localize="false" id="bas_id411643120224708">    
.AddItem("Item A")</paragraph>
+    <paragraph role="bascode" localize="false" id="bas_id411643120224719">    
.AddItem("Item B")</paragraph>
+    <paragraph role="bascode" localize="false" id="bas_id461643120224936">    
' ...</paragraph>
+    <paragraph role="bascode" id="bas_id100164312025160">    ' After creating 
the menu, the service instance can be disposed of</paragraph>
+    <paragraph role="bascode" localize="false" id="bas_id401643120225361">    
.Dispose()</paragraph>
+    <paragraph role="bascode" localize="false" id="bas_id701643120225536">End 
With</paragraph>
+  </bascode>
+  <embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
+  <pycode>
+    <paragraph role="pycode" localize="false" id="pyc_id731622827946021">doc = 
CreateScriptService("Document")</paragraph>
+    <paragraph role="pycode" id="pyc_id221622827943208">menu = 
doc.CreateMenu("My Menu")</paragraph>
+    <paragraph role="pycode" localize="false" 
id="pyc_id381643120494454">menu.AddItem("Item A")</paragraph>
+    <paragraph role="pycode" localize="false" 
id="pyc_id381643120494463">menu.AddItem("Item B")</paragraph>
+    <paragraph role="pycode" localize="false" id="pyc_id361643120494723"># 
...</paragraph>
+    <paragraph role="pycode" localize="false" 
id="pyc_id151643120494942">menu.Dispose()</paragraph>
+  </pycode>
+  <section id="menu_tip">
+    <tip id="par_id271643139068194">Refer to the <link 
href="text/sbasic/shared/03/sf_menu.xhp" 
name="Menu_link2"><input>SFWidgets.Menu</input></link> help page to learn more 
about how to create/remove menus in %PRODUCTNAME document windows.</tip>
+  </section>
+</section>
+
 <section id="ExportAsPDF">
   <comment> ExportAsPDF 
--------------------------------------------------------------------------------------------
 </comment>
   <bookmark xml-lang="en-US" localize="false" branch="index" 
id="bm_id721985200121025">
@@ -447,6 +495,36 @@
   </pycode>
 </section>
 
+<section id="RemoveMenu">
+  <comment> RemoveMenu 
---------------------------------------------------------------------------------------------
 </comment>
+  <bookmark xml-lang="en-US" localize="false" branch="index" 
id="bm_id721589200129148">
+    <bookmark_value>Document service;RemoveMenu</bookmark_value>
+  </bookmark>
+  <h2 id="hd_id261589200121147" localize="false">RemoveMenu</h2>
+  <paragraph role="paragraph" id="par_id651589200165470">Removes a toplevel 
menu from the menubar of a given document window.</paragraph>
+  <paragraph role="paragraph" id="par_id981611149610695">Returns 
<literal>True</literal> if the specified menu could be removed. If the 
specified menu does not exist, the method returns 
<literal>False</literal>.</paragraph>
+  <note id="par_id571643121106014">This method can be used to remove any menu 
entry from the document window, including default menus. However, none of these 
changes in the menubar are saved to the document or to the application 
settings. To restore the menubar to the default settings, simply close and 
reopen the document window.</note>
+  <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
+  <paragraph role="paragraph" localize="false" id="par_id1001622887065864">
+    <input>svc.RemoveMenu(menuheader: str): bool</input>
+  </paragraph>
+  <embed href="text/sbasic/shared/00000003.xhp#functparameters"/>
+  <paragraph role="paragraph" 
id="par_id361589200121156"><emph>menuheader</emph>: The toplevel name of the 
menu to be removed.</paragraph>
+  <embed href="text/sbasic/shared/00000003.xhp#functexample"/>
+  <embed href="text/sbasic/shared/00000003.xhp#In_Basic"/>
+  <bascode>
+    <paragraph role="bascode" localize="false" id="bas_id891580290121522">Dim 
oDoc as Object</paragraph>
+    <paragraph role="bascode" localize="false" id="bas_id515892005060659">Set 
oDoc = CreateScriptService("Document")</paragraph>
+    <paragraph role="bascode" id="bas_id391643120223147">oDoc.RemoveMenu("My 
Menu")</paragraph>
+  </bascode>
+  <embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
+  <pycode>
+    <paragraph role="pycode" localize="false" id="pyc_id731622827946155">doc = 
CreateScriptService("Document")</paragraph>
+    <paragraph role="pycode" id="pyc_id221622827946338">doc.RemoveMenu("My 
Menu")</paragraph>
+  </pycode>
+  <embed href="text/sbasic/shared/03/sf_document.xhp#menu_tip"/>
+</section>
+
 <section id="RunCommand">
   <comment> RunCommand 
--------------------------------------------------------------- </comment>
   <bookmark xml-lang="en-US" localize="false" branch="index" 
id="bm_id601589202413561">
@@ -596,8 +674,9 @@
 
   <embed href="text/sbasic/shared/03/lib_ScriptForge.xhp#SF_InternalUse"/>
   <section id="relatedtopics">
-    <embed href="text/sbasic/shared/03/sf_ui.xhp#UIService"/>
     <embed href="text/sbasic/shared/03/sf_dictionary.xhp#SFDictionary"/>
+    <embed href="text/sbasic/shared/03/sf_ui.xhp#UIService"/>
+    <embed href="text/sbasic/shared/03/sf_menu.xhp#MenuService"/>
    </section>
 </body>
 </helpdocument>
diff --git a/source/text/sbasic/shared/03/sf_menu.xhp 
b/source/text/sbasic/shared/03/sf_menu.xhp
new file mode 100644
index 000000000..5fd426dab
--- /dev/null
+++ b/source/text/sbasic/shared/03/sf_menu.xhp
@@ -0,0 +1,321 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<helpdocument version="1.0">
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+-->
+<meta>
+  <topic id="SF_Menu" indexer="include" status="PUBLISH">
+    <title id="tit" xml-lang="en-US">SFWidgets.Menu service</title>
+    <filename>/text/sbasic/shared/03/sf_menu.xhp</filename>
+  </topic>
+</meta>
+<body>
+  <section id="ScriptForge-sf_pmenu">
+    <bookmark xml-lang="en-US" localize="false" branch="index" 
id="bm_id501600788076877">
+      <bookmark_value>Menu service</bookmark_value>
+    </bookmark>
+  </section>
+  <section id="abstract">
+    <h1 id="bm_id681600788076499"><variable id="MenuService"><link 
href="text/sbasic/shared/03/sf_menu.xhp" name="Menu 
service"><literal>SFWidgets</literal>.<literal>Menu</literal> 
service</link></variable></h1>
+    <paragraph role="paragraph" id="par_id181600788076612">The 
<literal>Menu</literal> service can be used to create and remove menus from the 
menubar of a %PRODUCTNAME document window. Each menu entry can be associated 
with a script or with a UNO command. This service provides the following 
capabilities:</paragraph>
+    <list type="unordered">
+      <listitem>
+        <paragraph id="par_id301600788076785" role="listitem">Creation of 
menus with custom entries, checkboxes, radio buttons and separators.</paragraph>
+      </listitem>
+      <listitem>
+        <paragraph id="par_id1001600788076848" role="listitem">Decoration of 
menu items with icons and tooltips.</paragraph>
+      </listitem>
+    </list>
+  </section>
+  <note id="par_id581643133675012">Menus created with this service are 
available only for a specified document window. They are not saved into the 
document or as application settings. Closing and opening the document will 
restore the default menubar settings.</note>
+  <warning id="par_id291643224925643">When OLE objects such as Math formulas 
or Calc charts are edited from within a document, %PRODUCTNAME reconfigures the 
menubar according to the object. When this happens, the menus created with the 
<literal>Menu</literal> service are removed and are not be restored after 
editing the OLE object.</warning>
+
+  <h2 id="hd_id281600788076359">Service invocation</h2>
+  <embed href="text/sbasic/shared/00000003.xhp#In_Basic"/>
+  <paragraph role="paragraph" id="par_id321614902851541">The 
<literal>Menu</literal> service is instantiated by calling the <link 
href="text/sbasic/shared/03/sf_document.xhp#CreateMenu" 
name="CreateMenu_link"><literal>CreateMenu</literal></link> method from the 
<literal>Document</literal> service. The code snippet below creates a menu 
named <emph>My Menu</emph> in the current document window with two entries 
<emph>Item A</emph> and <emph>Item B</emph>.</paragraph>
+  <bascode>
+    <paragraph role="bascode" localize="false" id="bas_id791643134557838">Sub 
CreateMenu()</paragraph>
+    <paragraph role="bascode" localize="false" id="bas_id891643134322054">    
GlobalScope.BasicLibraries.loadLibrary("ScriptForge")</paragraph>
+    <paragraph role="bascode" localize="false" id="bas_id141643134322438">    
Dim oDoc as Object, oMenu as Object</paragraph>
+    <paragraph role="bascode" localize="false" id="bas_id151643134322614">    
Set oDoc = CreateScriptService("Document")</paragraph>
+    <paragraph role="bascode" id="bas_id261643134374056">    Set oMenu = 
oDoc.CreateMenu("My Menu")</paragraph>
+    <paragraph role="bascode" localize="false" id="bas_id261643134581928">    
With oMenu</paragraph>
+    <paragraph role="bascode" id="bas_id431643134582213">        
.AddItem("Item A", Command := "About")</paragraph>
+    <paragraph role="bascode" id="bas_id571643134582396">        
.AddItem("Item B", Script := 
"vnd.sun.star.script:Standard.Module1.ItemB_Listener?language=Basic&amp;location=application")</paragraph>
+    <paragraph role="bascode" localize="false" id="bas_id531643134582588">     
   .Dispose()</paragraph>
+    <paragraph role="bascode" localize="false" id="bas_id981643134582741">    
End With</paragraph>
+    <paragraph role="bascode" localize="false" id="bas_id791643134722777">End 
Sub</paragraph>
+  </bascode>
+  <note id="par_id371643135157996">After creating the menu, it is recommended 
to call the <literal>Dispose</literal> method to free the resources used by the 
<literal>Menu</literal> service instance.</note>
+  <paragraph role="paragraph" id="par_id341636718182262">In the example above, 
<emph>Item A</emph> is associated with the UNO command 
<literal>.uno:About</literal> whereas <emph>Item B</emph> is associated with 
the script <literal>ItemB_Listener</literal> defined in 
<literal>Module1</literal> of the <literal>Standard</literal> library of the 
<literal>My Macros</literal> container.</paragraph>
+  <paragraph role="paragraph" id="par_id851635274721129">The following example 
defines <literal>ItemB_Listener</literal> that will be called when <emph>Item 
B</emph> is clicked. This listener simply splits the argument string passed to 
the <literal>Sub</literal> and shows them in a message box.</paragraph>
+  <bascode>
+    <paragraph role="bascode" localize="false" id="bas_id311643135422309">Sub 
ItemB_Listener(args As String)</paragraph>
+    <paragraph role="bascode" id="bas_id716431354225603">    ' Process the 
argument string passed to the listener</paragraph>
+    <paragraph role="bascode" localize="false" id="bas_id211643135422708">    
Dim sArgs as Object</paragraph>
+    <paragraph role="bascode" localize="false" id="bas_id461643135422860">    
sArgs = Split(args, ",")</paragraph>
+    <paragraph role="bascode" id="bas_id901643135423012">    MsgBox "Menu 
name: "   &amp; sArgs(0) &amp; Chr(13) &amp; _</paragraph>
+    <paragraph role="bascode" id="bas_id301643136028263">           "Menu 
item: "   &amp; sArgs(1) &amp; Chr(13) &amp; _</paragraph>
+    <paragraph role="bascode" id="bas_id181643136028557">           "Item ID: 
"     &amp; sArgs(2) &amp; Chr(13) &amp; _</paragraph>
+    <paragraph role="bascode" id="bas_id561643136028710">           "Item 
status: " &amp; sArgs(3)</paragraph>
+    <paragraph role="bascode" localize="false" id="bas_id241643136028871">End 
Sub</paragraph>
+  </bascode>
+  <paragraph role="paragraph" id="par_id531636493797707">As shown in the 
example above, menu entries associated with a script receive a comma-separated 
string argument with the following values:</paragraph>
+  <list type="unordered">
+    <listitem>
+      <paragraph id="par_id921643136489994" role="listitem">The toplevel name 
of the menu.</paragraph>
+    </listitem>
+    <listitem>
+      <paragraph id="par_id611643136491059" role="listitem">The string ID of 
the selected menu entry.</paragraph>
+    </listitem>
+    <listitem>
+      <paragraph id="par_id961643136491491" role="listitem">The numeric ID of 
the selected menu entry.</paragraph>
+    </listitem>
+    <listitem>
+      <paragraph id="par_id381643136494580" role="listitem">The current state 
of the menu item. This is useful for checkboxes and radio buttons. If the item 
is checked, the value "1" is returned, otherwise "0" is returned.</paragraph>
+    </listitem>
+  </list>
+
+  <embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
+  <paragraph role="paragraph" id="par_id131635275172617">The examples above 
can be written in Python as follows:</paragraph>
+  <pycode>
+    <paragraph role="pycode" localize="false" id="pyc_id631626695710139">from 
scriptforge import CreateScriptService</paragraph>
+    <paragraph role="pycode" localize="false" 
id="pyc_id441636718456158"></paragraph>
+    <paragraph role="pycode" localize="false" id="pyc_id441636718456844">def 
create_menu(args=None):</paragraph>
+    <paragraph role="pycode" localize="false" id="pyc_id981626695710433">    
oDoc = CreateScriptService("Document")</paragraph>
+    <paragraph role="pycode" localize="false" id="pyc_id981626695710122">    
oMenu = oDoc.CreateMenu("My Menu")</paragraph>
+    <paragraph role="pycode" localize="false" id="pyc_id311626695710851">    
oMenu.AddItem("Item A", command="About")</paragraph>
+    <paragraph role="pycode" localize="false" id="pyc_id211636717609237">    
oMenu.AddItem("Item B", 
script="vnd.sun.star.script:my_macros.py$item_b_listener?language=Python&amp;location=user")</paragraph>
+    <paragraph role="pycode" localize="false" id="pyc_id616367176100230">    
oMenu.Dispose()</paragraph>
+  </pycode>
+  <pycode>
+    <paragraph role="pycode" localize="false" id="pyc_id831635275439182">def 
item_b_listener(args):</paragraph>
+    <paragraph role="pycode" localize="false" id="pyc_id481643137165239">    
bas = CreateScriptService("Basic")</paragraph>
+    <paragraph role="pycode" localize="false" id="pyc_id381635275439396">    
s_args = args.split(",")</paragraph>
+    <paragraph role="pycode" id="pyc_id981636717957632">    msg = f"Menu item: 
{s_args[0]}\n"</paragraph>
+    <paragraph role="pycode" id="pyc_id851636718008427">    msg += f"Menu 
name: {s_args[1]}\n"</paragraph>
+    <paragraph role="pycode" id="pyc_id331636727047102">    msg += f"Item ID: 
{s_args[2]}\n"</paragraph>
+    <paragraph role="pycode" id="pyc_id71643137333404">    msg += f"Item 
status: {s_args[3]}"</paragraph>
+    <paragraph role="pycode" localize="false" id="pyc_id111643137333564">    
bas.MsgBox(msg)</paragraph>
+  </pycode>
+
+  <bookmark xml-lang="en-US" branch="index" localize="false" 
id="bm_id111614901520029">
+    <bookmark_value>PopupService service;ShortcutCharacter</bookmark_value>
+    <bookmark_value>PopupService service;SubmenuCharacter</bookmark_value>
+  </bookmark>
+  <h2 id="hd_id711600788076834">Properties</h2>
+  <table id="tab_id701600788076583">
+    <tablerow>
+      <tablecell>
+        <paragraph id="par_id461600788076917" role="tablehead">Name</paragraph>
+      </tablecell>
+      <tablecell>
+        <paragraph id="par_id221600788076591" 
role="tablehead">Readonly</paragraph>
+      </tablecell>
+      <tablecell>
+        <paragraph id="par_id761600788076328" role="tablehead">Type</paragraph>
+      </tablecell>
+      <tablecell>
+        <paragraph id="par_id67160078807636" 
role="tablehead">Description</paragraph>
+      </tablecell>
+    </tablerow>
+    <tablerow>
+      <tablecell>
+        <paragraph id="par_id941600788076595" role="tablecontent" 
localize="false">ShortcutCharacter</paragraph>
+      </tablecell>
+      <tablecell>
+        <paragraph id="par_id49160078807654" role="tablecontent">No</paragraph>
+      </tablecell>
+      <tablecell>
+        <paragraph id="par_id961600788076376" role="tablecontent" 
localize="false">String</paragraph>
+      </tablecell>
+      <tablecell>
+        <paragraph id="par_id81600788076419" role="tablecontent">Character 
used to define the access key of a menu item. The default character is 
"~".</paragraph>
+      </tablecell>
+    </tablerow>
+    <tablerow>
+      <tablecell>
+        <paragraph id="par_id491600788076621" role="tablecontent" 
localize="false">SubmenuCharacter</paragraph>
+      </tablecell>
+      <tablecell>
+        <paragraph id="par_id311600788076756" 
role="tablecontent">No</paragraph>
+      </tablecell>
+      <tablecell>
+        <paragraph id="par_id831600788076785" role="tablecontent" 
localize="false">String</paragraph>
+      </tablecell>
+      <tablecell>
+        <paragraph id="par_id441600788076826" role="tablecontent">Character or 
string that defines how menu items are nested. The default character is 
">".</paragraph>
+      </tablecell>
+    </tablerow>
+  </table>
+
+  <h2 id="hd_id181636719707892">Menu and Submenus</h2>
+  <paragraph role="paragraph" id="par_id741636719725402">To create a menu with 
submenus, use the character defined in the <literal>SubmenuCharacter</literal> 
property while creating the menu entry to define where it will be placed. For 
instance, consider the following menu/submenu hierarchy.</paragraph>
+  <bascode>
+    <paragraph role="bascode" localize="false" id="bas_id991636719842353">' 
Item A</paragraph>
+    <paragraph role="bascode" localize="false" id="bas_id231636719842719">' 
Item B > Item B.1</paragraph>
+    <paragraph role="bascode" localize="false" id="bas_id421636719842904">'    
      Item B.2</paragraph>
+    <paragraph role="bascode" localize="false" id="bas_id916367201523640">' 
------ (line separator)</paragraph>
+    <paragraph role="bascode" localize="false" id="bas_id541636719843240">' 
Item C > Item C.1 > Item C.1.1</paragraph>
+    <paragraph role="bascode" localize="false" id="bas_id701636719843447">'    
                 Item C.1.2</paragraph>
+    <paragraph role="bascode" localize="false" id="bas_id601636719843672">' 
Item C > Item C.2 > Item C.2.1</paragraph>
+    <paragraph role="bascode" localize="false" id="bas_id921636719843864">'    
                 Item C.2.2</paragraph>
+    <paragraph role="bascode" localize="false" id="bas_id921636719843567">'    
                 ------ (line separator)</paragraph>
+    <paragraph role="bascode" localize="false" id="bas_id921636719843154">'    
                 Item C.2.3</paragraph>
+    <paragraph role="bascode" localize="false" id="bas_id921636719843965">'    
                 Item C.2.4</paragraph>
+  </bascode>
+  <paragraph role="paragraph" id="par_id211636720111489">The code below uses 
the default submenu character ">" to create the menu/submenu hierarchy defined 
above:</paragraph>
+  <bascode>
+    <paragraph role="bascode" localize="false" 
id="par_id961636720555061">oMenu.AddItem("Item A")</paragraph>
+    <paragraph role="bascode" localize="false" 
id="par_id371636720556397">oMenu.AddItem("Item B>Item B.1")</paragraph>
+    <paragraph role="bascode" localize="false" 
id="par_id941636720556623">oMenu.AddItem("Item B>Item B.2")</paragraph>
+    <paragraph role="bascode" localize="false" 
id="bas_id261636720973178">oMenu.AddItem("---")</paragraph>
+    <paragraph role="bascode" localize="false" 
id="par_id431636720556822">oMenu.AddItem("Item C>Item C.1>Item 
C.1.1")</paragraph>
+    <paragraph role="bascode" localize="false" 
id="par_id651636720557021">oMenu.AddItem("Item C>Item C.1>Item 
C.1.2")</paragraph>
+    <paragraph role="bascode" localize="false" 
id="par_id861636720557222">oMenu.AddItem("Item C>Item C.2>Item 
C.2.1")</paragraph>
+    <paragraph role="bascode" localize="false" 
id="par_id21636720557437">oMenu.AddItem("Item C>Item C.2>Item 
C.2.2")</paragraph>
+    <paragraph role="bascode" localize="false" 
id="par_id21636720557103">oMenu.AddItem("Item C>Item C.2>---")</paragraph>
+    <paragraph role="bascode" localize="false" 
id="par_id21636720557256">oMenu.AddItem("Item C>Item C.2>Item 
C.2.3")</paragraph>
+    <paragraph role="bascode" localize="false" 
id="par_id21636720557941">oMenu.AddItem("Item C>Item C.2>Item 
C.2.4")</paragraph>
+  </bascode>
+  <note id="par_id121636721243578">The string "---" is used to define line 
separators in menus or submenus.</note>
+  <embed href="text/sbasic/shared/03/sf_popupmenu.xhp#using_icons"/>
+
+  <h2 id="hd_id501582887473754" xml-lang="en-US">Methods</h2>
+  <table id="tab_id501611613601554">
+    <tablerow>
+      <tablecell colspan="3"><paragraph id="par_id891611613601554" 
role="tablehead" xml-lang="en-US">List of Methods in the Menu 
Service</paragraph></tablecell>
+    </tablerow>
+    <tablerow>
+      <tablecell>
+        <paragraph id="par_id891611613601556" role="tablecontent" 
localize="false">
+          <link href="text/sbasic/shared/03/sf_menu.xhp#AddCheckBox" 
name="AddCheckBox method">AddCheckBox</link><br/>
+        </paragraph>
+      </tablecell>
+      <tablecell>
+        <paragraph id="par_id541611613601554" role="tablecontent" 
localize="false">
+          <link href="text/sbasic/shared/03/sf_menu.xhp#AddItem" name="AddItem 
method">AddItem</link><br/>
+        </paragraph>
+      </tablecell>
+      <tablecell>
+        <paragraph id="par_id541611613625804" role="tablecontent" 
localize="false">
+          <link href="text/sbasic/shared/03/sf_menu.xhp#AddRadioButton" 
name="AddRadioButton method">AddRadioButton</link><br/>
+        </paragraph>
+      </tablecell>
+    </tablerow>
+  </table>
+
+  <section id="AddCheckBox">
+    <comment> AddCheckBox 
-----------------------------------------------------------------------------------------
 </comment>
+    <bookmark xml-lang="en-US" localize="false" branch="index" 
id="bm_id92158919969883">
+      <bookmark_value>Menu service;AddCheckBox</bookmark_value>
+    </bookmark>
+    <h2 id="hd_id201589199698251" localize="false">AddCheckBox</h2>
+    <paragraph role="paragraph" id="par_id93158919969864">Inserts a check box 
in the menu. Returns an integer value that identifies the inserted 
item.</paragraph>
+    <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
+    <paragraph role="paragraph" localize="false" id="par_id821621534014732">
+      <input>svc.AddCheckBox(menuitem: str, opt name: str, opt status: bool, 
opt icon: str, opt tooltip: str, opt command: str, opt script: str): int</input>
+    </paragraph>
+    <embed href="text/sbasic/shared/00000003.xhp#functparameters"/>
+    <paragraph role="paragraph" 
id="par_id821591631203996"><emph>menuitem:</emph> Defines the text to be 
displayed in the menu. This argument also defines the hierarchy of the item 
inside the menu by using the submenu character.</paragraph>
+    <paragraph role="paragraph" id="par_id821591631203116"><emph>name:</emph> 
String value used to identify the menu item. By default, the last component of 
the menu hierarchy is used.</paragraph>
+    <paragraph role="paragraph" 
id="par_id821591631203133"><emph>status:</emph> Defines whether the item is 
selected when the menu is created (Default = 
<literal>False</literal>).</paragraph>
+    <paragraph role="paragraph" id="par_id11636721653313"><emph>icon:</emph> 
Path and name of the icon to be displayed without the leading path separator. 
The actual icon shown depends on the icon set being used.</paragraph>
+    <paragraph role="paragraph" 
id="par_id11636721653208"><emph>tooltip:</emph> Text to be displayed as 
tooltip.</paragraph>
+    <paragraph role="paragraph" 
id="par_id11636721653328"><emph>command:</emph> The name of a UNO command 
without the <literal>.uno:</literal> prefix. If the command name does not 
exist, nothing happens.</paragraph>
+    <paragraph role="paragraph" id="par_id11636721653107"><emph>script:</emph> 
The URI for a Basic or Python script that will be executed when the item is 
clicked.</paragraph>
+    <section id="menu_note">
+      <note id="par_id31643198954204">The arguments <literal>command</literal> 
and <literal>script</literal> are mutually exclusive, hence only one of them 
can be set for each menu item.</note>
+      <tip id="par_id31643148484084">Read <link 
href="https://wiki.openoffice.org/wiki/Documentation/DevGuide/Scripting/Scripting_Framework_URI_Specification";
 name="URI_Notation">Scripting Framework URI Specification</link> to learn more 
about the URI syntax used in the <literal>script</literal> argument.</tip>
+    </section>
+    <embed href="text/sbasic/shared/00000003.xhp#functexample"/>
+    <embed href="text/sbasic/shared/00000003.xhp#In_Basic"/>
+    <bascode>
+      <paragraph role="bascode" id="bas_id191643306748853">' Menu entry 
associated with the .uno:Paste command</paragraph>
+      <paragraph role="bascode" localize="false" 
id="bas_id41158919969204">oMenu.AddCheckBox("Item A", Status := True, ToolTip 
:= "Paste values", Command := "Paste")</paragraph>
+      <paragraph role="bascode" id="bas_id271643147793320">' Runs the Basic 
script Standard.Module1.MyListener stored in the document</paragraph>
+      <paragraph role="bascode" localize="false" 
id="bas_id41158919969114">oMenu.AddCheckBox("Item B", Status := False, Script 
:= 
"vnd.sun.star.script:Standard.Module1.MyListener?language=Basic&amp;location=document")</paragraph>
+      <paragraph role="bascode" id="bas_id801643306742620">' Runs the Python 
script MysListener located in file myScripts.py in the user scripts 
folder</paragraph>
+      <paragraph role="bascode" localize="false" 
id="bas_id41158919969324">oMenu.AddCheckBox("Item C", Status := True, Script := 
"vnd.sun.star.script:myScripts.py$MyListener?language=Python&amp;location=user")</paragraph>
+    </bascode>
+    <embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
+    <pycode>
+      <paragraph role="pycode" localize="false" 
id="pyc_id321621534175122">oMenu.AddCheckBox("Item A", status=True, 
tooltip="Paste values", command="Paste")</paragraph>
+      <paragraph role="pycode" localize="false" 
id="pyc_id321621534175344">oMenu.AddCheckBox("Item B", status=False, 
script="vnd.sun.star.script:Standard.Module1.MyListener?language=Basic&amp;location=document")</paragraph>
+      <paragraph role="pycode" localize="false" 
id="pyc_id591643307035249">oMenu.AddCheckBox("Item C", Status=True, 
Script="vnd.sun.star.script:myScripts.py$MyListener?language=Python&amp;location=user")</paragraph>
+    </pycode>
+  </section>
+
+  <section id="AddItem">
+    <comment> AddItem 
-----------------------------------------------------------------------------------------
 </comment>
+    <bookmark xml-lang="en-US" localize="false" branch="index" 
id="bm_id92158919960353">
+      <bookmark_value>Menu service;AddItem</bookmark_value>
+    </bookmark>
+    <h2 id="hd_id201589199698158" localize="false">AddItem</h2>
+    <paragraph role="paragraph" id="par_id93158919963364">Inserts a label 
entry in the menu. Returns an integer value that identifies the inserted 
item.</paragraph>
+    <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
+    <paragraph role="paragraph" localize="false" id="par_id821621534012185">
+      <input>svc.AddItem(menuitem: str, opt name: str, opt icon: str, opt 
tooltip: str, opt command: str, opt script: str): int</input>
+    </paragraph>
+    <embed href="text/sbasic/shared/00000003.xhp#functparameters"/>
+    <paragraph role="paragraph" 
id="par_id821591631203021"><emph>menuitem:</emph> Defines the text to be 
displayed in the menu. This argument also defines the hierarchy of the item 
inside the menu by using the submenu character.</paragraph>
+    <paragraph role="paragraph" id="par_id821591631203026"><emph>name:</emph> 
String value to be returned when the item is clicked. By default, the last 
component of the menu hierarchy is used.</paragraph>
+    <paragraph role="paragraph" id="par_id11636721652886"><emph>icon:</emph> 
Path and name of the icon to be displayed without the leading path separator. 
The actual icon shown depends on the icon set being used.</paragraph>
+    <paragraph role="paragraph" 
id="par_id11636721653118"><emph>tooltip:</emph> Text to be displayed as 
tooltip.</paragraph>
+    <paragraph role="paragraph" 
id="par_id11636721653314"><emph>command:</emph> The name of a UNO command 
without the <literal>.uno:</literal> prefix. If the command name does not 
exist, nothing happens.</paragraph>
+    <paragraph role="paragraph" id="par_id11636721652057"><emph>script:</emph> 
The URI for a Basic or Python script that will be executed when the item is 
clicked.</paragraph>
+    <embed href="text/sbasic/shared/03/sf_menu.xhp#menu_note"/>
+    <embed href="text/sbasic/shared/00000003.xhp#functexample"/>
+    <embed href="text/sbasic/shared/00000003.xhp#In_Basic"/>
+    <bascode>
+      <paragraph role="bascode" id="bas_id41158919969106">oMenu.AddItem("Item 
A", Tooltip := "A descriptive message")</paragraph>
+    </bascode>
+    <embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
+    <pycode>
+      <paragraph role="pycode" id="pyc_id321621534170554">oMenu.AddItem("Item 
A", tooltip = "A descriptive message")</paragraph>
+    </pycode>
+  </section>
+
+  <section id="AddRadioButton">
+    <comment> AddRadioButton 
---------------------------------------------------------------------------------------
 </comment>
+    <bookmark xml-lang="en-US" localize="false" branch="index" 
id="bm_id92158919969447">
+      <bookmark_value>Menu service;AddRadioButton</bookmark_value>
+    </bookmark>
+    <h2 id="hd_id201589199693022" localize="false">AddRadioButton</h2>
+    <paragraph role="paragraph" id="par_id93158919969399">Inserts a radio 
button entry in the menu. Returns an integer value that identifies the inserted 
item.</paragraph>
+    <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
+    <paragraph role="paragraph" localize="false" id="par_id821621534013775">
+      <input>svc.AddRadioButton(menuitem: str, opt name: str, opt status: str, 
opt icon: str, opt tooltip: str, opt command: str, opt script: str): int</input>
+    </paragraph>
+    <embed href="text/sbasic/shared/00000003.xhp#functparameters"/>
+    <paragraph role="paragraph" 
id="par_id821591631203501"><emph>menuitem:</emph> Defines the text to be 
displayed in the menu. This argument also defines the hierarchy of the item 
inside the menu by using the submenu character.</paragraph>
+    <paragraph role="paragraph" id="par_id821591631228716"><emph>name:</emph> 
String value to be returned when the item is clicked. By default, the last 
component of the menu hierarchy is used.</paragraph>
+    <paragraph role="paragraph" 
id="par_id821591631203643"><emph>status:</emph> Defines whether the item is 
selected when the menu is created (Default = 
<literal>False</literal>).</paragraph>
+    <paragraph role="paragraph" id="par_id11636721653228"><emph>icon:</emph> 
Path and name of the icon to be displayed without the leading path separator. 
The actual icon shown depends on the icon set being used.</paragraph>
+    <paragraph role="paragraph" 
id="par_id11636721653114"><emph>tooltip:</emph> Text to be displayed as 
tooltip.</paragraph>
+    <paragraph role="paragraph" 
id="par_id11636721653447"><emph>command:</emph> The name of a UNO command 
without the <literal>.uno:</literal> prefix. If the command name does not 
exist, nothing happens.</paragraph>
+    <paragraph role="paragraph" id="par_id11636721652598"><emph>script:</emph> 
The URI for a Basic or Python script that will be executed when the item is 
clicked.</paragraph>
+    <embed href="text/sbasic/shared/03/sf_menu.xhp#menu_note"/>
+    <embed href="text/sbasic/shared/00000003.xhp#functexample"/>
+    <embed href="text/sbasic/shared/00000003.xhp#In_Basic"/>
+    <bascode>
+      <paragraph role="bascode" localize="false" 
id="bas_id41158919969658">oMenu.AddRadioButton("Item A", Name := "A", Status := 
True)</paragraph>
+    </bascode>
+    <embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
+    <pycode>
+      <paragraph role="pycode" localize="false" 
id="pyc_id321621534175471">oMenu.AddRadioButton("Item A", name="A", 
status=True)</paragraph>
+    </pycode>
+  </section>
+
+  <embed href="text/sbasic/shared/03/lib_ScriptForge.xhp#SF_InternalUse"/>
+  <section id="relatedtopics">
+    <embed href="text/sbasic/shared/03/sf_popupmenu.xhp#PopupMenuService"/>
+    <embed href="text/sbasic/shared/03/sf_document.xhp#DocumentService"/>
+  </section>
+</body>
+</helpdocument>
diff --git a/source/text/sbasic/shared/03/sf_popupmenu.xhp 
b/source/text/sbasic/shared/03/sf_popupmenu.xhp
index c99df69ee..8a2edf74a 100644
--- a/source/text/sbasic/shared/03/sf_popupmenu.xhp
+++ b/source/text/sbasic/shared/03/sf_popupmenu.xhp
@@ -8,9 +8,10 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  *
 -->
+
 <meta>
   <topic id="SF_PopupMenu" indexer="include" status="PUBLISH">
-    <title id="tit" xml-lang="en-US">ScriptForge.PopupMenu service</title>
+    <title id="tit" xml-lang="en-US">SFWidgets.PopupMenu service</title>
     <filename>/text/sbasic/shared/03/sf_popupmenu.xhp</filename>
   </topic>
 </meta>
@@ -21,7 +22,7 @@
     </bookmark>
   </section>
   <section id="abstract">
-    <h1 id="bm_id681600788076499"><variable id="PopupMenuService"><link 
href="text/sbasic/shared/03/sf_popupmenu.xhp" name="PopupMenu 
service"><literal>ScriptForge</literal>.<literal>PopupMenu</literal> 
service</link></variable></h1>
+    <h1 id="bm_id681600788076499"><variable id="PopupMenuService"><link 
href="text/sbasic/shared/03/sf_popupmenu.xhp" name="PopupMenu 
service"><literal>SFWidgets</literal>.<literal>PopupMenu</literal> 
service</link></variable></h1>
     <paragraph role="paragraph" id="par_id181600788076612">The 
<literal>PopupMenu</literal> service can be used to create popup menus that can 
be associated with events or executed by scripts. This service provides the 
following capabilities:</paragraph>
     <list type="unordered">
       <listitem>
@@ -39,7 +40,7 @@
   <bascode>
     <paragraph role="bascode" localize="false" id="bas_id701636718117715">Sub 
ShowPopup</paragraph>
     <paragraph role="bascode" localize="false" id="bas_id851600788076202">    
GlobalScope.BasicLibraries.loadLibrary("ScriptForge")</paragraph>
-    <paragraph role="bascode" localize="false" id="bas_id1001600788076254">    
Dim myPopup As Object</paragraph>
+    <paragraph role="bascode" localize="false" id="bas_id100160078076254">    
Dim myPopup As Object</paragraph>
     <paragraph role="bascode" localize="false" id="bas_id721600788076288">    
Set myPopup = CreateScriptService("SFWidgets.PopupMenu", , 300, 300)</paragraph>
     <paragraph role="bascode" localize="false" id="bas_id791600788431935">    
myPopup.AddItem("Item ~A")</paragraph>
     <paragraph role="bascode" localize="false" id="bas_id791600788431755">    
myPopup.AddItem("Item ~B")</paragraph>
@@ -118,30 +119,30 @@
     </tablerow>
     <tablerow>
       <tablecell>
-        <paragraph id="par_id491600788076621" role="tablecontent" 
localize="false">SubmenuCharacter</paragraph>
+        <paragraph id="par_id941600788076595" role="tablecontent" 
localize="false">ShortcutCharacter</paragraph>
       </tablecell>
       <tablecell>
-        <paragraph id="par_id311600788076756" 
role="tablecontent">No</paragraph>
+        <paragraph id="par_id49160078807654" role="tablecontent">No</paragraph>
       </tablecell>
       <tablecell>
-        <paragraph id="par_id831600788076785" role="tablecontent" 
localize="false">String</paragraph>
+        <paragraph id="par_id961600788076376" role="tablecontent" 
localize="false">String</paragraph>
       </tablecell>
       <tablecell>
-        <paragraph id="par_id441600788076826" role="tablecontent">Character or 
string that defines how menu items are nested. The default character is 
">".</paragraph>
+        <paragraph id="par_id81600788076419" role="tablecontent">Character 
used to define the access key of a menu item. The default character is 
"~".</paragraph>
       </tablecell>
     </tablerow>
     <tablerow>
       <tablecell>
-        <paragraph id="par_id941600788076595" role="tablecontent" 
localize="false">ShortcutCharacter</paragraph>
+        <paragraph id="par_id491600788076621" role="tablecontent" 
localize="false">SubmenuCharacter</paragraph>
       </tablecell>
       <tablecell>
-        <paragraph id="par_id49160078807654" role="tablecontent">No</paragraph>
+        <paragraph id="par_id311600788076756" 
role="tablecontent">No</paragraph>
       </tablecell>
       <tablecell>
-        <paragraph id="par_id961600788076376" role="tablecontent" 
localize="false">String</paragraph>
+        <paragraph id="par_id831600788076785" role="tablecontent" 
localize="false">String</paragraph>
       </tablecell>
       <tablecell>
-        <paragraph id="par_id81600788076419" role="tablecontent">Character 
used to define the access key of a menu item. The default character is 
"~".</paragraph>
+        <paragraph id="par_id441600788076826" role="tablecontent">Character or 
string that defines how menu items are nested. The default character is 
">".</paragraph>
       </tablecell>
     </tablerow>
   </table>
@@ -157,30 +158,43 @@
     <paragraph role="bascode" localize="false" id="bas_id701636719843447">'    
                 Item C.1.2</paragraph>
     <paragraph role="bascode" localize="false" id="bas_id601636719843672">' 
Item C > Item C.2 > Item C.2.1</paragraph>
     <paragraph role="bascode" localize="false" id="bas_id921636719843864">'    
                 Item C.2.2</paragraph>
+    <paragraph role="bascode" localize="false" id="bas_id921636719843567">'    
                 ------ (line separator)</paragraph>
+    <paragraph role="bascode" localize="false" id="bas_id921636719843154">'    
                 Item C.2.3</paragraph>
+    <paragraph role="bascode" localize="false" id="bas_id921636719843965">'    
                 Item C.2.4</paragraph>
   </bascode>
   <paragraph role="paragraph" id="par_id211636720111489">The code below uses 
the default submenu character ">" to create the menu/submenu hierarchy defined 
above:</paragraph>
   <bascode>
-    <paragraph role="bascode" localize="false" 
id="par_id961636720555061">myPopup.AddItem("Item A")</paragraph>
-    <paragraph role="bascode" localize="false" 
id="par_id371636720556397">myPopup.AddItem("Item B>Item B.1")</paragraph>
-    <paragraph role="bascode" localize="false" 
id="par_id941636720556623">myPopup.AddItem("Item B>Item B.2")</paragraph>
+    <paragraph role="bascode" localize="false" 
id="bas_id961636720555061">myPopup.AddItem("Item A")</paragraph>
+    <paragraph role="bascode" localize="false" 
id="bas_id371636720556397">myPopup.AddItem("Item B>Item B.1")</paragraph>
+    <paragraph role="bascode" localize="false" 
id="bas_id941636720556623">myPopup.AddItem("Item B>Item B.2")</paragraph>
     <paragraph role="bascode" localize="false" 
id="bas_id261636720973178">myPopup.AddItem("---")</paragraph>
-    <paragraph role="bascode" localize="false" 
id="par_id431636720556822">myPopup.AddItem("Item C>Item C.1>Item 
C.1.1")</paragraph>
-    <paragraph role="bascode" localize="false" 
id="par_id651636720557021">myPopup.AddItem("Item C>Item C.1>Item 
C.1.2")</paragraph>
-    <paragraph role="bascode" localize="false" 
id="par_id861636720557222">myPopup.AddItem("Item C>Item C.2>Item 
C.2.1")</paragraph>
-    <paragraph role="bascode" localize="false" 
id="par_id21636720557437">myPopup.AddItem("Item C>Item C.2>Item 
C.2.2")</paragraph>
+    <paragraph role="bascode" localize="false" 
id="bas_id431636720556822">myPopup.AddItem("Item C>Item C.1>Item 
C.1.1")</paragraph>
+    <paragraph role="bascode" localize="false" 
id="bas_id651636720557021">myPopup.AddItem("Item C>Item C.1>Item 
C.1.2")</paragraph>
+    <paragraph role="bascode" localize="false" 
id="bas_id861636720557222">myPopup.AddItem("Item C>Item C.2>Item 
C.2.1")</paragraph>
+    <paragraph role="bascode" localize="false" 
id="bas_id21636720557437">myPopup.AddItem("Item C>Item C.2>Item 
C.2.2")</paragraph>
+    <paragraph role="bascode" localize="false" 
id="bas_id21636720557103">myPopup.AddItem("Item C>Item C.2>---")</paragraph>
+    <paragraph role="bascode" localize="false" 
id="bas_id21636720557256">myPopup.AddItem("Item C>Item C.2>Item 
C.2.3")</paragraph>
+    <paragraph role="bascode" localize="false" 
id="bas_id21636720557941">myPopup.AddItem("Item C>Item C.2>Item 
C.2.4")</paragraph>
   </bascode>
   <note id="par_id121636721243578">The string "---" is used to define line 
separators in menus or submenus..</note>
-  <h2 id="hd_id211636723438558">Using icons</h2>
-  <paragraph role="paragraph" id="par_id981636723485402">Items in the popup 
menu can have icons, which are specified as arguments in the 
<literal>AddCheckBox</literal>, <literal>AddItem</literal> and 
<literal>AddRadioButton</literal> methods.</paragraph>
-  <paragraph role="paragraph" id="par_id881636724112434">All icons available 
in %PRODUCTNAME can be used by specifying their path relative to the folder 
where icon files are located in the installation folder. Icons are located in 
the following folder:</paragraph>
-  <paragraph role="paragraph" localize="false" 
id="par_id991636724479899"><input>INSTALLDIR/share/config</input></paragraph>
-  <tip id="par_id941636724808906">Use the <literal>InstallFolder</literal> 
property of the <literal>FileSystem</literal> service to determine where 
%PRODUCTNAME is installed in your system.</tip>
-  <paragraph role="paragraph" id="par_id201636724575911">This folder contains 
a series of ZIP files containing the image files of each available icon set. 
The images inside these ZIP files are organized into folders. To use an icon, 
specify the icon file with the path to its location inside the ZIP 
file.</paragraph>
-  <paragraph role="paragraph" id="par_id641636724972071">The example below 
uses the icon "sc_newdoc.svg" that is located inside the "cmd" folder. The 
forward slash "/" character is used as the path separator regardless of the 
operating system.</paragraph>
-  <bascode>
-    <paragraph role="bascode" localize="false" 
id="bas_id121636725026678">myPopup.AddItem("Item A", Icon := 
"cmd/sc_newdoc.svg")</paragraph>
-  </bascode>
-  <note id="par_id691636725233961">All icon sets have the same internal 
structure. The actual icon displayed depends on the icon set currently in 
use.</note>
+  <section id="using_icons">
+    <h2 id="hd_id211636723438558">Using icons</h2>
+    <paragraph role="paragraph" id="par_id981636723485402">Items in the menu 
can have icons, which are specified as arguments in the 
<literal>AddCheckBox</literal>, <literal>AddItem</literal> and 
<literal>AddRadioButton</literal> methods.</paragraph>
+    <paragraph role="paragraph" id="par_id881636724112434">All icons available 
in %PRODUCTNAME can be used by specifying their path relative to the folder 
where icon files are located in the installation folder. Icons are located in 
the following folder:</paragraph>
+    <paragraph role="paragraph" localize="false" 
id="par_id991636724479899"><input>INSTALLDIR/share/config</input></paragraph>
+    <tip id="par_id941636724808906">Use the <literal>InstallFolder</literal> 
property of the <literal>FileSystem</literal> service to determine where 
%PRODUCTNAME is installed in your system.</tip>
+    <paragraph role="paragraph" id="par_id201636724575911">This folder 
contains a series of ZIP files containing the image files of each available 
icon set. The images inside these ZIP files are organized into folders. To use 
an icon, specify the icon file with the path to its location inside the ZIP 
file.</paragraph>
+    <paragraph role="paragraph" id="par_id641636724972071">The example below 
uses the icon "sc_newdoc.svg" that is located inside the "cmd" folder. The 
forward slash "/" character is used as the path separator regardless of the 
operating system.</paragraph>
+    <embed href="text/sbasic/shared/00000003.xhp#In_Basic"/>
+    <bascode>
+      <paragraph role="bascode" localize="false" 
id="bas_id121636725026678">myMenu.AddItem("Item A", Icon := 
"cmd/sc_newdoc.svg")</paragraph>
+    </bascode>
+    <embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
+    <pycode>
+      <paragraph role="pycode" localize="false" 
id="pyc_id361643307394680">myMenu.AddItem("Item A", 
icon="cmd/sc_newdoc.svg")</paragraph>
+    </pycode>
+    <note id="par_id691636725233961">All icon sets have the same internal 
structure. The actual icon displayed depends on the icon set currently in 
use.</note>
+  </section>
 
   <h2 id="hd_id501582887473754" xml-lang="en-US">Methods</h2>
   <table id="tab_id501611613601554">
@@ -216,7 +230,7 @@
     <paragraph role="paragraph" id="par_id93158919969864">Inserts a check box 
in the popup menu. Returns an integer value that identifies the inserted 
item.</paragraph>
     <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
     <paragraph role="paragraph" localize="false" id="par_id821621534014732">
-      <input>svc.AddCheckBox(menuitem: str, opt name: str, opt status: bool, 
opt icon: str, opt tooltip: str): int</input>
+      <input>svc.AddCheckBox(menuitem: str, opt name: str, opt status: bool = 
False, opt icon: str, opt tooltip: str): int</input>
     </paragraph>
     <embed href="text/sbasic/shared/00000003.xhp#functparameters"/>
     <paragraph role="paragraph" 
id="par_id821591631203996"><emph>menuitem:</emph> Defines the text to be 
displayed in the menu. This argument also defines the hierarchy of the item 
inside the menu by using the submenu character.</paragraph>
@@ -231,7 +245,7 @@
     </bascode>
     <embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
     <pycode>
-      <paragraph role="pycode" localize="false" 
id="pyc_id321621534175122">myPopup.AddCheckBox("Option A", 
status=True)</paragraph>
+      <paragraph role="pycode" localize="false" 
id="pyc_id321621534175122">my_popup.AddCheckBox("Option A", 
status=True)</paragraph>
     </pycode>
   </section>
 
@@ -258,7 +272,7 @@
     </bascode>
     <embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
     <pycode>
-      <paragraph role="pycode" 
id="pyc_id321621534170554">myPopup.AddItem("Item A", tooltip = "A descriptive 
message")</paragraph>
+      <paragraph role="pycode" 
id="pyc_id321621534170554">my_popup.AddItem("Item A", tooltip = "A descriptive 
message")</paragraph>
     </pycode>
   </section>
 
@@ -271,7 +285,7 @@
     <paragraph role="paragraph" id="par_id93158919969399">Inserts a radio 
button entry in the popup menu. Returns an integer value that identifies the 
inserted item.</paragraph>
     <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
     <paragraph role="paragraph" localize="false" id="par_id821621534013775">
-      <input>svc.AddRadioButton(menuitem: str, opt name: str, opt status: str, 
opt icon: str, opt tooltip: str): int</input>
+      <input>svc.AddRadioButton(menuitem: str, opt name: str, opt status: bool 
= False, opt icon: str, opt tooltip: str): int</input>
     </paragraph>
     <embed href="text/sbasic/shared/00000003.xhp#functparameters"/>
     <paragraph role="paragraph" 
id="par_id821591631203501"><emph>menuitem:</emph> Defines the text to be 
displayed in the menu. This argument also defines the hierarchy of the item 
inside the menu by using the submenu character.</paragraph>
@@ -286,7 +300,7 @@
     </bascode>
     <embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
     <pycode>
-      <paragraph role="pycode" localize="false" 
id="pyc_id321621534175471">myPopup.AddRadioButton("Option A", name="A", 
status=True)</paragraph>
+      <paragraph role="pycode" localize="false" 
id="pyc_id321621534175471">my_popup.AddRadioButton("Option A", name="A", 
status=True)</paragraph>
     </pycode>
   </section>
 
@@ -300,7 +314,7 @@
     <paragraph role="paragraph" id="par_id101636726249788">If the user clicks 
outside the popup menu or presses the <keycode>Esc</keycode> key, then no item 
is selected. In such cases, the returned value depends on the 
<literal>returnid</literal> parameter. If <literal>returnid = True</literal> 
and no item is selected, then the value 0 (zero) is returned. Otherwise an 
empty string "" is returned.</paragraph>
     <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
     <paragraph role="paragraph" localize="false" id="par_id821621534014414">
-      <input>svc.Execute(opt returnid: bool): any</input>
+      <input>svc.Execute(opt returnid: bool = True): any</input>
     </paragraph>
     <embed href="text/sbasic/shared/00000003.xhp#functparameters"/>
     <paragraph role="paragraph" 
id="par_id821591631202088"><emph>returnid:</emph> If <literal>True</literal> 
the selected item ID is returned. If <literal>False</literal> the method 
returns the item's name (Default = <literal>True</literal>).</paragraph>
@@ -315,9 +329,9 @@
     </bascode>
     <embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
     <pycode>
-      <paragraph role="pycode" localize="false" 
id="pyc_id321621534173001">myPopup.AddItem("Item A", name="A")</paragraph>
-      <paragraph role="pycode" localize="false" 
id="pyc_id271636726772842">myPopup.AddItem("Item B", name="B")</paragraph>
-      <paragraph role="pycode" localize="false" 
id="pyc_id621636726773015">response = myPopup.Execute(False)</paragraph>
+      <paragraph role="pycode" localize="false" 
id="pyc_id321621534173001">my_popup.AddItem("Item A", name="A")</paragraph>
+      <paragraph role="pycode" localize="false" 
id="pyc_id271636726772842">my_popup.AddItem("Item B", name="B")</paragraph>
+      <paragraph role="pycode" localize="false" 
id="pyc_id621636726773015">response = my_popup.Execute(False)</paragraph>
     </pycode>
   </section>
 
@@ -325,6 +339,7 @@
   <section id="relatedtopics">
     <embed href="text/sbasic/shared/03/sf_dialog.xhp#dlg_h1"/>
     <embed href="text/sbasic/shared/03/sf_dialogcontrol.xhp#ctrls_h1"/>
+    <embed href="text/sbasic/shared/03/sf_menu.xhp#MenuService"/>
   </section>
 </body>
 </helpdocument>
diff --git a/source/text/sbasic/shared/03/sf_writer.xhp 
b/source/text/sbasic/shared/03/sf_writer.xhp
index 0f7804132..542d2fe8f 100644
--- a/source/text/sbasic/shared/03/sf_writer.xhp
+++ b/source/text/sbasic/shared/03/sf_writer.xhp
@@ -27,10 +27,7 @@
     <h1 id="hd_id731582733781114" xml-lang="en-US"><variable 
id="WriterService"><link href="text/sbasic/shared/03/sf_writer.xhp" 
name="Writer service"><literal>SFDocuments</literal>.<literal>Writer</literal> 
service</link></variable></h1>
     <paragraph role="paragraph" id="par_id381589189355849" 
xml-lang="en-US">The <literal>SFDocuments</literal> shared library provides a 
number of methods and properties to facilitate the management and handling of 
%PRODUCTNAME documents.</paragraph>
     <paragraph role="paragraph" id="par_id351591014177269" 
xml-lang="en-US">Some methods are generic for all types of documents and are 
inherited from the <literal>SF_Document</literal> module, whereas other methods 
that are specific for Writer documents are defined in the 
<literal>SF_Writer</literal> module.</paragraph>
-    <paragraph role="paragraph" id="par_id591589189364267" 
xml-lang="en-US">The <literal>SF_Writer</literal> module is focused 
on:</paragraph>
-    <list type="unordered">
-      <comment>TBD</comment>
-    </list>
+    <comment>To be done: list with the main features of the Writer 
service.</comment>
 </section>
 
   <h2 id="hd_id581582885621841">Service invocation</h2>
@@ -186,4 +183,4 @@
     <embed href="text/sbasic/shared/03/sf_ui.xhp#UIService"/>
   </section>
 </body>
-</helpdocument>
\ No newline at end of file
+</helpdocument>

Reply via email to