summaryrefslogtreecommitdiff
path: root/wizards/source/sfdocuments/SF_Writer.xba
diff options
context:
space:
mode:
authorJean-Pierre Ledure <jp@ledure.be>2024-08-24 15:58:34 +0200
committerJean-Pierre Ledure <jp@ledure.be>2024-08-24 18:29:12 +0200
commit8a4ee0fb39dfabb590fb2b12c87f545da664e449 (patch)
tree145124c508d3e27cb5cfa49bc253ae33dc2b42d4 /wizards/source/sfdocuments/SF_Writer.xba
parenta241f2d96d6ea0c1f17eb3836537ba00b51de72f (diff)
ScriptForge (SFWidgets) new ContextMenu service
Complete a predefined context menu with new items placed at its bottom. A context menu is obtained by a right-click on several areas of a document. Each area has its own context menu. Each component model has its own set of context menus. A context menu is usually predefined at LibreOffice installation. Customization is done statically with the Tools + Customize dialog. The actual new service provides a mean to make temporary additions at the bottom of a context menu. Those changes are lost when the document is closed. The name of a context menu is the last component of the resource URL: "private:resource/popupmenu/the-name-here" Context menu items are either usual items or line separators. Checkboxes or radio buttons are not supported. Items run a command or a script when clicked. The service implements 2 methods: AddItem() adds an entry in the menu hierarchy Activate() shows or hides the added entries A context menu can be defined from both Basic and Python user scripts. An update of the documentation is required. Change-Id: Id77f1f2565d75e36c09b13972330d0f83b3f1db4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172355 Reviewed-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins
Diffstat (limited to 'wizards/source/sfdocuments/SF_Writer.xba')
-rw-r--r--wizards/source/sfdocuments/SF_Writer.xba9
1 files changed, 8 insertions, 1 deletions
diff --git a/wizards/source/sfdocuments/SF_Writer.xba b/wizards/source/sfdocuments/SF_Writer.xba
index d71df30135cc..a7fce5fe9840 100644
--- a/wizards/source/sfdocuments/SF_Writer.xba
+++ b/wizards/source/sfdocuments/SF_Writer.xba
@@ -655,6 +655,13 @@ Public Function CloseDocument(Optional ByVal SaveAsk As Variant) As Boolean
End Function &apos; SFDocuments.SF_Writer.CloseDocument
REM -----------------------------------------------------------------------------
+Public Function ContextMenus(Optional ByVal ContextMenuName As Variant _
+ , Optional ByVal SubmenuChar As Variant _
+ ) As Variant
+ ContextMenus = [_Super].ContextMenus(ContextMenuName, SubmenuChar)
+End Function &apos; SFDocuments.SF_Writer.ContextMenus
+
+REM -----------------------------------------------------------------------------
Public Function CreateMenu(Optional ByVal MenuHeader As Variant _
, Optional ByVal Before As Variant _
, Optional ByVal SubmenuChar As Variant _
@@ -1166,4 +1173,4 @@ Private Function _Repr() As String
End Function &apos; SFDocuments.SF_Writer._Repr
REM ============================================ END OF SFDOCUMENTS.SF_WRITER
-</script:module>
+</script:module> \ No newline at end of file