ScriptForge - new SFWidgets library, new PopupMenu service

Desktop / LibreOffice - Jean-Pierre Ledure [ledure.be] - 15 October 2021 14:39 UTC

The SFWidgets library is intended to host the Toolbar, ToolbarControl (both future) and PopupMenu services.

A popup menu is usually triggered by a mouse action (typically a right-click) on a dialog, a form, or one of their controls. In these cases the menu will be displayed below the clicked area.

When triggered by other events, including in the normal flow of a user script, the script should provide the coordinates of the topleft edge of the menu versus the actual component.

The menu is described from top to bottom with next methods: AddItem() AddCheckBox() AddRadioButton() Example: .AddCheckBox("View>Toolbars>Dialog") .AddCheckBox("View>Toolbars>Find", Status := True) .AddCheckBox("View>Status Bar", Status := True) .AddItem("View>Full Screen", Name := "FULLSCREEN") The SubmenuCharacter (Default = ">") is modifiable.

Each menu item receives a numeric and a string identifier. The execute() method returns the item selected by the user.

The service is available both from Basic and Python user scripts.

The commit includes the review of build files to include the new library and the new modules.

Change-Id: I2940be25313cc8fff7b337766edd348b04a20584 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123654

78db0dcfb6f5 ScriptForge - new SFWidgets library, new PopupMenu service
Repository.mk | 1 +
desktop/CppunitTest_desktop_lib.mk | 1 +
scp2/source/ooo/directory_ooo.scp | 5 +
wizards/Module_wizards.mk | 1 +
wizards/Package_sfwidgets.mk | 30 +
wizards/source/configshare/dialog.xlc | 1 +
wizards/source/configshare/script.xlc | 1 +
wizards/source/scriptforge/SF_Services.xba | 1 +
wizards/source/scriptforge/python/scriptforge.py | 48 ++
wizards/source/sfwidgets/SF_PopupMenu.xba | 755 +++++++++++++++++++++++
wizards/source/sfwidgets/SF_Register.xba | 127 ++++
wizards/source/sfwidgets/__License.xba | 26 +
wizards/source/sfwidgets/dialog.xlb | 3 +
wizards/source/sfwidgets/script.xlb | 7 +
14 files changed, 1007 insertions(+)

Upstream: cgit.freedesktop.org


  • Share