Page 1 of 1

[Solved]Toolbar switching in Base

Posted: Wed Oct 02, 2019 8:21 am
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

Re: Toolbar swithing in Base

Posted: Wed Oct 02, 2019 9:54 am
by robleyd
It is an AOO extension - https://extensions.openoffice.org/en/project/basetools. Quite old, 2010, and may not work with recent versions

Re: Toolbar switching in Base

Posted: Wed Oct 02, 2019 3:46 pm
by Villeroy
If you would use MRI, the relevant document property would jump right into your eyes. It is the 3rd property on top.

Re: Toolbar switching in Base

Posted: Wed Oct 02, 2019 6:34 pm
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?

Re: Toolbar switching in Base

Posted: Wed Oct 02, 2019 9:31 pm
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.