[Solved]Toolbar switching in Base

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
gkick
Posts: 324
Joined: Wed Aug 07, 2019 5:24 pm
Location: Chile

[Solved]Toolbar switching in Base

Post by gkick »

Hi there,

There are a few macro examples on how to turn toolbars on and off with most of them also turning off the menubar. I would love to show the form design and form controls toolbar in design view but hide them once in data entry mode.
One example I came across is the prepformrunmode macro which requires the Base Tools Extension to work. Where can I find this extension as not listed under extension manager download.
Thanks
Last edited by gkick on Sun Oct 20, 2019 5:13 am, edited 2 times in total.
Libre Office 6.4.6 on Windows 10 HSQL 2.51 backend
User avatar
robleyd
Moderator
Posts: 5080
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: Toolbar swithing in Base

Post by robleyd »

It is an AOO extension - https://extensions.openoffice.org/en/project/basetools. Quite old, 2010, and may not work with recent versions
Cheers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.2.2; SlackBuild for 24.2.2 by Eric Hameleers
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Toolbar switching in Base

Post by Villeroy »

If you would use MRI, the relevant document property would jump right into your eyes. It is the 3rd property on top.
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
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Toolbar switching in Base

Post by Villeroy »

Villeroy wrote:If you would use MRI, the relevant document property would jump right into your eyes. It is the 3rd property on top.
:oops: Sorry,,
3rd prop on top is "ApplyFormDesignMode" which is something different (open document in fdm or not).
But with MRI you can find a controller method setFormDesignMode which unfortunately has no counterpart getFormDesignMode so this is write-only. *
The following toggles the property with the help of a global boolean which is preserved between two calls::

Code: Select all

REM  *****  BASIC  *****
Global b as Boolean

Sub toggleFormDesignMode()
	c = ThisComponent.getCurrentController()
	c.setFormDesignMode(b)
	b = Not b
End Sub
You may read the desired state from the state of your toolbars and then set the fdm accordingly.

* but if this is write-only, how does MRI show its current state?
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
gkick
Posts: 324
Joined: Wed Aug 07, 2019 5:24 pm
Location: Chile

Re: Toolbar switching in Base

Post by gkick »

Thanks David, thank you Villeroy, just getting the hang of forms, had a look at report and decided not to use them. Now that MRI looks promising, looks to me its sort of a sophisticated object browser combined with a code generator ?
For now I am not yet familiar with models, methods,interfaces etc. Will need to study a little.
Libre Office 6.4.6 on Windows 10 HSQL 2.51 backend
Post Reply