Menu bar in a dialog box?

Creating a macro - Writing a Script - Using the API

Menu bar in a dialog box?

Postby roland65 » Mon Feb 19, 2018 3:54 pm

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 5.x on Ubuntu
roland65
 
Posts: 20
Joined: Tue Oct 18, 2011 6:41 pm

Re: Menu bar in a dialog box?

Postby JeJe » Mon Feb 19, 2018 4:16 pm

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 40 times
Openoffice 4.1.2
Windows 8
JeJe
Volunteer
 
Posts: 457
Joined: Wed Mar 09, 2016 2:40 pm

Re: Menu bar in a dialog box?

Postby roland65 » Tue Feb 20, 2018 9:42 am

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 5.x on Ubuntu
roland65
 
Posts: 20
Joined: Tue Oct 18, 2011 6:41 pm

Re: Menu bar in a dialog box?

Postby JeJe » Tue Feb 20, 2018 10:20 am

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

https://forum.openoffice.org/en/forum/v ... 45&t=33142
Openoffice 4.1.2
Windows 8
JeJe
Volunteer
 
Posts: 457
Joined: Wed Mar 09, 2016 2:40 pm

Re: Menu bar in a dialog box?

Postby JeJe » Tue Feb 20, 2018 11:39 am

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 48 times
Openoffice 4.1.2
Windows 8
JeJe
Volunteer
 
Posts: 457
Joined: Wed Mar 09, 2016 2:40 pm

Re: Menu bar in a dialog box?

Postby roland65 » Tue Feb 20, 2018 2:47 pm

Thanks for all this stuff. I'll study all of these carefully...
LibreOffice 5.x on Ubuntu
roland65
 
Posts: 20
Joined: Tue Oct 18, 2011 6:41 pm


Return to Macros and UNO API

Who is online

Users browsing this forum: No registered users and 4 guests