gigabert General User

Joined: 13 Sep 2009 Posts: 13
|
Posted: Fri Oct 09, 2009 4:54 am Post subject: Create Menu |
|
|
Hello,
i have some code in a macro that creates a menu in a form (OOo Base 3.1.1). The code works. The most of this code is clear but can please somebody explain for me in easy words (i'm beginner), what the ItemDescriptorContainer is and how it works. Also for the ModuleUIConfigurationManagerSupplier, because i get an object from that an give it to the ItemDescriptorContainer.
| Code: | Function CreateMenu( Command as String, Label as String ) as Variant
Dim aMenu(3) as new com.sun.star.beans.PropertyValue
Dim oModuleCfgMgrSupplier As Object, oModuleCfgMgr As Object, oContainer As Object
oModuleCfgMgrSupplier = createUnoService("com.sun.star.ui.ModuleUIConfigurationManagerSupplier")
oModuleCfgMgr = oModuleCfgMgrSupplier.getUIConfigurationManager( "com.sun.star.sheet.SpreadsheetDocument" )
oContainer = oModuleCfgMgr.createSettings()
aMenu(0).Name = "CommandURL"
aMenu(0).Value = Command
aMenu(1).Name = "Label"
aMenu(1).Value = Label
aMenu(2).Name = "Type"
aMenu(2).Value = 0
aMenu(3).Name = "ItemDescriptorContainer"
aMenu(3).Value = oContainer
CreateMenu = aMenu()
End Function |
Thanks a lot
Bert |
|