Cor Nouws wrote:
Hi *,
I thought it was possible to hide (show) a toolbar with OOobasic as
follows:
oFrame = ThisComponent.CurrentController.Frame
oLayoutManager = oFrame.LayoutManager
Hi Cor,
sUrl="private:resource/toolbar/custom_toolbar_2828.xml"
A toolbar URL should not have an extension.
"private:resource/toolbar/custom_toolbar_2828" would be the correct URL.
oToolbar = oLayoutManager.getElement( sUrl )
xray oToolbar ' > Null object
oLayoutManager.hideElement(sUrl)
So this does not seem to work (OOo 2.4.0)
If you want to show a toolbar you have to use the following methods of a
layout manager.
oLayoutManager.createElement(sUrl);
oLayoutManager.showElement(sUrl);
You cannot be sure that the toolbar already exists therefore you have to
call "createElement" first.
Hiding a toolbar just needs hideElement(sUrl) but best would be to use
destroyElement(sUrl) afterwards. DestroyElement(sUrl) destroys the real
low-level VCL UI element which otherwise would use system resources.
Besides that, finaly I need to hide/show a toolbar that is installed
with an extension, so probably will not be found with the sUrl at all.
You have to know the unique ID of the toolbar to reference it. The best
way to would be to add the controlling code to the extension which
installs the toolbar. Otherwise you have to add this information to your
code.
Regards,
Carsten
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]