on 2006 Mar 22 3:21 AM
Hi !
I already have my addon menu working but i want to create a sub menu (group) like the one with the folder icon in SBO main menu. Ex:
Addon Menu (in main menu pop-up)
Utilities (sub menu with a folder design besides it)
Add
Remove
Report
All my sub menus are individually listed under Addon Menu ... what would be the code to group them under utilies under Addon Menu ????
Thanks..
Hello Alain,
You must create a Menu object then assign the submenu with a specific type. Type mt_popup mean will create a submenu which can carry another submenu. Type mt_string means will create a submenu which can clicked to display the form you've created.
Ex.
oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_POPUP
oCreationPackage.UniqueID = "MyMenu01"
oCreationPackage.String = "Sample Menu"
oCreationPackage.Enabled = True
oCreationPackage.Image = sPath & "UI.bmp"
oCreationPackage.Position = 15
' If the menu already exists this code will fail
On Error GoTo AddMenuItemsErr
oMenuItem.SubMenus.AddEx oCreationPackage
'// Get the menu collection of the newly added pop-up item
Set oMenuItem = SBO_Application.Menus.Item("MyMenu01")
'// Create s sub menu
oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING
oCreationPackage.UniqueID = "MySubMenu"
oCreationPackage.String = "Sample Sub Menu"
oMenuItem.SubMenus.AddEx oCreationPackage
Hope this will help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That code is waht i have presently in my addon ... It makes a popup menu with all the submenues under.
I would like all my sub menus to be part of a group called utilities .
So i would click on my addon menu in SBO then i would see my normal submenus + a group sub menu (Utilities) that when i click on it shows more submenus...
Thanks...
I use XML and LoadBatchActions for menus as I find it much easier to edit. A simple example producing a structure such as:-
My Addon
- Addon Program 1
- Addon Program 2
- Utilites
- Add
- Remove
- Report
can be achieved by:-
<?xml version="1.0" encoding="UTF-16"?>
<Application>
<Menus>
<action type="add">
<Menu Checked="0" Enabled="1" FatherUID="43520" Image="MyPicture.bmp" Position="12" String="My Addon" Type="2" UniqueID="AZU_ADD" />
<Menu Checked="0" Enabled="1" FatherUID="AZU_ADD" Image="" Position="1" String="Addon Program 1" Type="1" UniqueID="AZU_ADD1" />
<Menu Checked="0" Enabled="1" FatherUID="AZU_ADD" Image="" Position="2" String="Addon Program 2" Type="1" UniqueID="AZU_ADD2" />
<Menu Checked="0" Enabled="1" FatherUID="AZU_ADD" Image="" Position="3" String="Utilities" Type="2" UniqueID="AZU_ADD_UT" />
<Menu Checked="0" Enabled="1" FatherUID="AZU_ADD_UT" Image="" Position="1" String="Add" Type="1" UniqueID="AZU_UT1" />
<Menu Checked="0" Enabled="1" FatherUID="AZU_ADD_UT" Image="" Position="2" String="Remove" Type="1" UniqueID="AZU_UT2" />
<Menu Checked="0" Enabled="1" FatherUID="AZU_ADD_UT" Image="" Position="3" String="Report" Type="1" UniqueID="AZU_UT3" />
</action>
</Menus>
</Application>
Is this what you want to produce?
John.
User | Count |
---|---|
113 | |
9 | |
8 | |
6 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.