Andrew Douglas Pitonyak wrote:
Carsten Driesner wrote:
Andrew Douglas Pitonyak wrote:
What are the basic steps to create a simple toolbar in basic?
Hi Andrew,
You don't need to create an add-on, but it would make life much easier
if you just want to use built-in commands. No coding, just define the
content of your toolbar in a xml file.
Never done this before... I should learn how.
For all Writer documents, however, I am guessing that I need to use
the ConfigurationProvider service, but this is only a guess.
No, that's not the way to go. You have to retrieve the module ui
configuration manager and there you can change module dependent
toolbars. (See Basic example below)
Thanks, the example was EXACTLY what I needed
Hi Andrew,
Great to hear that my code example can help you.
In your example, you have the following code, which works:
If ( oModuleCfgMgr.hasSettings( sTBURL )) Then
oModuleCfgMgr.replaceSettings( sTBURL, oTBSettings )
Else
oModuleCfgMgr.insertSettings( sTBURL, oTBSettings )
End If
This code, however, has a problem:
If ( oModuleCfgMgr.hasSettings( sTBURL )) Then
'oModuleCfgMgr.replaceSettings( sTBURL, oTBSettings )
oModuleCfgMgr.RemoveSettings( sTBURL, oTBSettings )
oModuleCfgMgr.insertSettings( sTBURL, oTBSettings )
Else
oModuleCfgMgr.insertSettings( sTBURL, oTBSettings )
End If
While testing, I wanted to make a toolbar go away, so I "REMOVED" the
settings. I was no longer able to create a new toolbar with the URL of
the "removed" toolbar. There are no errors, it simply does nothing.
May be you have found a bug. I will check it. Just for your information,
removing the configuration settings is not enough to really get rid of a
toolbar. OpenOffice.org 2.0.x supports live-configuration and therefore
would even show a toolbar without configuration data (the toolbar must
be requested by the application code). You can see this if you use the
toolbar configuration dialog via "Tools - Configure - Toolbar" and
create a custom toolbar. You have to remove the window state of the
toolbar via OpenOffice.org configuration access.
Regards,
Carsten
--
Carsten Driesner (cd) - Project Lead OpenOffice.org Framework
Framework wiki: http://wiki.services.openoffice.org/wiki/Framework
OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]