Disable Menubar when an external 'split base' form is opened

Discuss the word processor
Post Reply
dreamquartz
Posts: 881
Joined: Mon May 30, 2011 4:02 am

Disable Menubar when an external 'split base' form is opened

Post by dreamquartz »

Hi All,

I would like to provide our Customer more control over what their Users can and are allowed to do, and one of the issues that came up was to disable the 'Menubar' when a form is opened.
The User forms are outside of the DataBase, using the FreeHSQLDB macro from Master Villeroy, but the 'Menubar' shows up as default.
I would like to prevent that from happening, and only show the 'Form Navigation' toolbar.
We considered 2 options:
1. User specific; therefore based on a User login; it appears hover not working at this point in time
2. The moment the DataBase is opened; if needed via a Macro.

Our preference is option 2. in any shape, or form.
I could not find anything useful on the interweb, including both OO and LO , relating to the 'Menubar'.

Any thought and/or ideas?

Dream
LO 7.x, HSQLDB 2.7.x & Ubuntu 22.04 LTS.
JeJe
Volunteer
Posts: 2764
Joined: Wed Mar 09, 2016 2:40 pm

Re: Disable Menubar when an external 'split base' form is opened.

Post by JeJe »

Code: Select all

Sub Hide_Menubar
  oLM = ThisComponent.getCurrentController().getFrame().LayoutManager
  oElements = oLM.getElements()
  For i = 0 To UBound(oElements) 
    oItem = oElements(i)
    If oItem.ResourceURL = "private:resource/menubar/menubar" Then
		oLM.hideElement(oitem.ResourceURL)
        Exit For
      End If
  
  Next

End Sub
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Post Reply