Disable Entire Menus

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
rjsteele
Posts: 23
Joined: Fri Jul 27, 2012 9:20 pm

Disable Entire Menus

Post by rjsteele »

I understand how to disable individual commands, such as "Open" and "Save" on the File Menu. Put is it possible to disable, say, the entire File Menu and all the commands within it? I am using the Java API.

Thanks,

Raymond
Raymond
Solaris 10 x86 StarrOffice 9 - basis3.1
rjsteele
Posts: 23
Joined: Fri Jul 27, 2012 9:20 pm

Re: Disable Entire Menus

Post by rjsteele »

32 views and no response. Somebody has to know something. Please help!
Raymond
Solaris 10 x86 StarrOffice 9 - basis3.1
User avatar
kingfisher
Volunteer
Posts: 2123
Joined: Tue Nov 20, 2007 10:53 am

Re: Disable Entire Menus

Post by kingfisher »

You know more than I do about menus. I know how to get access to tool bars (through the Layout Manager) but not menus.

I tried a search of the api sub-domain. Sorting through that can be very time-consuming.

I found these which may be of use:

Module awt
ServiceItemDescriptor
ServiceLayoutManager

FWIW, this is my search of the sub-domain.
Apache OpenOffice 4.1.9 on Linux
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Disable Entire Menus

Post by Villeroy »

Inspect the frame's layout manager.
objLayout.HideCurrentUI = True hides away the menu bar.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
pitonyak
Volunteer
Posts: 186
Joined: Sun Oct 07, 2007 9:13 pm
Location: Columbus, Ohio, USA

Re: Disable Entire Menus

Post by pitonyak »

With all of the macros that I have written, I have never needed (nore tried) to disable a menu. Off hand, I expect that your choices will be to disable each command (which you claim to know how to do, and ironically I have no idea..... Should probably have you teach me that trick so that I can document it), or perhaps to modify the configuration XML (yuck).

Villeroy, did you attempt to hid only a submenu using this trick?
Andrew Pitonyak
http://www.pitonyak.org/oo.php
LO and AOO on Fedora
hanya
Volunteer
Posts: 885
Joined: Fri Nov 23, 2007 9:27 am
Location: Japan

Re: Disable Entire Menus

Post by hanya »

Most of submenus are simply placeholder for its child contents. /org.openoffice.Office.Addons/AddonUI/OfficeMenuBarMerging configuration with MergeCommand as Remove seems to remove specific menu entry without to remove user's settings.
Office created top menu has problem to get its popup menus, so it can not be used to remove specific menu entries from them.
Any user can modify their own menu, toolbar and shortcut key settings, so to disable the menu entries is not good way to inhibit to use these functions.
Office menu entries and its function depends on protocol handling mechanism known as dispatch framework. It can disable menu, toolbar entries and macro execution by the specific command, using dispatch interceptor. But it can not block the execution of the command by accelerator keys (I have met this problem on somewhere else).
Please, edit this thread's initial post and add "[Solved]" to the subject line if your problem has been solved.
Apache OpenOffice 4-dev on Xubuntu 14.04
sendy
Posts: 1
Joined: Tue Aug 27, 2013 2:24 pm

Re: Disable Entire Menus

Post by sendy »

Can you please post the solution for disabling individual command like copy,paste,paste special etc.? Thank you.
OpenOffice 3.0
j.kornelsn
Posts: 14
Joined: Wed Oct 06, 2010 6:26 am

Re: Disable Entire Menus

Post by j.kornelsn »

This page in the DevGuide explains how to disable commands: https://wiki.openoffice.org/wiki/Docume ... e_Commands.
LO / AOO on Ubuntu / Windows
Post Reply