[Solved]Toolbar switching in Base

Creating a macro - Writing a Script - Using the API

[Solved]Toolbar switching in Base

Postby gkick » Wed Oct 02, 2019 8:21 am

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.2 on Windows 10 HSQL 2.5 backend
gkick
 
Posts: 121
Joined: Wed Aug 07, 2019 5:24 pm
Location: Chile

Re: Toolbar swithing in Base

Postby robleyd » Wed Oct 02, 2019 9:54 am

It is an AOO extension - https://extensions.openoffice.org/en/project/basetools. Quite old, 2010, and may not work with recent versions
Cheers
David
Apache OpenOffice 420m2(Build:9821) - Slackware 14.2 - 64 bit
LibreOffice 6.0.7.3 - Slackware 14.2 - 64 bit
Apache OpenOffice 4.1.4 - Windows 7 Virtual machine
User avatar
robleyd
Moderator
 
Posts: 3051
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: Toolbar switching in Base

Postby Villeroy » Wed Oct 02, 2019 3:46 pm

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, no OpenOffice, LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 27313
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Toolbar switching in Base

Postby Villeroy » Wed Oct 02, 2019 6:34 pm

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   Expand viewCollapse view
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, no OpenOffice, LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 27313
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Toolbar switching in Base

Postby gkick » Wed Oct 02, 2019 9:31 pm

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.2 on Windows 10 HSQL 2.5 backend
gkick
 
Posts: 121
Joined: Wed Aug 07, 2019 5:24 pm
Location: Chile


Return to Macros and UNO API

Who is online

Users browsing this forum: No registered users and 3 guests