Menu bar in a dialog box?

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
roland65
Posts: 32
Joined: Tue Oct 18, 2011 6:41 pm

Menu bar in a dialog box?

Post by roland65 »

Hi,

I couldn't find the answer to the following question: in basic, is there a way to add a menu bar widget (with submenus, text and icons) to a dialog box?

Thanks,
RB
LibreOffice 7.5.x on Ubuntu
JeJe
Volunteer
Posts: 2764
Joined: Wed Mar 09, 2016 2:40 pm

Re: Menu bar in a dialog box?

Post by JeJe »

If the answer is no... then I've attached an abandoned textpad project where I mimic a menubar using labels and popup menus. Its not finished or perfect - you can't move out of one popup menu into another as you can with menubar menus - but it looks similar to a menubar. Messy incomplete code - just an option if you can't get a proper menubar.
Attachments
Textpad.odt
(19.27 KiB) Downloaded 170 times
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
roland65
Posts: 32
Joined: Tue Oct 18, 2011 6:41 pm

Re: Menu bar in a dialog box?

Post by roland65 »

Thanks Jeje, interesting example...
I'll study your code to see if I can adapt it for my purpose.
Have a nice day,
RB
LibreOffice 7.5.x on Ubuntu
JeJe
Volunteer
Posts: 2764
Joined: Wed Mar 09, 2016 2:40 pm

Re: Menu bar in a dialog box?

Post by JeJe »

some documentation on menus is here, but whether you can get one in a dialog using setmenubar or something, I don't know:

https://www.openoffice.org/api/docs/com ... nuBar.html

https://wiki.openoffice.org/wiki/Docume ... ting_Menus

viewtopic.php?f=45&t=33142
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
JeJe
Volunteer
Posts: 2764
Joined: Wed Mar 09, 2016 2:40 pm

Re: Menu bar in a dialog box?

Post by JeJe »

Here's a tidied version of my menubar mimmick, with all the unnecessary code removed.

Doing that I noticed there was a half-baked attempt in the first upload to create a menubar using setMenuBar. Creating a proper menubar would be better if it can be done.
Attachments
Textpad.odt
(16.81 KiB) Downloaded 211 times
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
roland65
Posts: 32
Joined: Tue Oct 18, 2011 6:41 pm

Re: Menu bar in a dialog box?

Post by roland65 »

Thanks for all this stuff. I'll study all of these carefully...
LibreOffice 7.5.x on Ubuntu
Post Reply