|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
Manipulating menus at runtimeHi all
I wrote an extension and now wants to enable/disable menu entries dynamically at runtime both for my extension and legacy menu entries Is there a way and could someone point me in the right direction Any codesnippet in any language or some keywords and basic steps are welcommed Thanks in advance Laurent -- Laurent Godard <lgodard@...> - Ingénierie OpenOffice.org - http://www.indesko.com Nuxeo Enterprise Content Management >> http://www.nuxeo.com - http://www.nuxeo.org Livre "Programmation OpenOffice.org", Eyrolles 2004-2006 --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@... For additional commands, e-mail: dev-help@... |
|
|
Re: Manipulating menus at runtimeHi again
I answer myself as i found ;) digging into the SDK, i found ooo_sdk/examples/DevelopersGuide/OfficeDev/DisableCommands and the java code is totally understandable I had to adapt to my extension, but globaly, here is the code at the end of this mail. No need to restart so thanks to carsten driesner for its code in the SDK one thing i have to now find is the name of the Legacy menu entries. Is it the .uno: names ? Thanks again Laurent '------------------------- sub test conf = getConfigSetting("/org.openoffice.Office.Commands/Execute/Disabled" ,true) elem = conf.createInstanceWithArguments(array()) elem.setPropertyValue("Command","vnd.sun.star.script:Myextension.Module.action?language=Basic&location=application") conf.insertByName("action",elem) conf.commitChanges() end sub '-------------------------- function getConfigSetting(target as string, forUpdate as boolean) dim aParams(0) As new com.sun.star.beans.PropertyValue if forUpdate then service = "com.sun.star.configuration.ConfigurationUpdateAccess" else service = "com.sun.star.configuration.ConfigurationAccess" endif aConfigProvider = createUnoService( "com.sun.star.configuration.ConfigurationProvider" ) aParams(0).Name = "nodepath" aParams(0).Value = target aSettings = aConfigProvider.createInstanceWithArguments(service, aParams() ) getConfigSetting = aSettings end function -- Laurent Godard <lgodard@...> - Ingénierie OpenOffice.org - http://www.indesko.com Nuxeo Enterprise Content Management >> http://www.nuxeo.com - http://www.nuxeo.org Livre "Programmation OpenOffice.org", Eyrolles 2004-2006 --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@... For additional commands, e-mail: dev-help@... |
|
|
|
| Free Forum Powered by Nabble | Forum Help |