This message originated Externally. Use proper judgement and caution with attachments, links, or responses. |
Hi
Yeah, the RibbonLib is not full implementation of all the things you can do to the ribbon, unfortunately.
There are some methods that do come in handy though.
Try the following:
1. Make sure your tool has initiated the RibbonLib. You can also force this by calling RBNInitiate
2. Run this script to
Dim rbnCntxtMenu, rbnControlCollection, rbnElement As this
'Get the specific Context menu for the Mapper
rbnCntxtMenu = ICntxtMnusGetCntxtMnu(theContextMenus, MenuId_MapperShortcut)
'*Get the controls collection of this context menu
rbnControlCollection = GetICntxtMnuCtrls(rbnCntxtMenu)
'*Remove all but one control
nNumControls = GetMICtrlCollCount(rbnControlCollection)
Print "Number of Controls on Map Context Menu: " & nNumControls
For i = 1 To (nNumControls – 2)
Print "Hiding Control " & (i - 1)
rbnElement = GetMICtrlCollItemInt(rbnControlCollection, (i - 1))
Call RBNControlSetVisibilityThs(rbnElement, FALSE)
Next
This will loop through all the controls but the last two and hide them.
The trick for you is to determine which control to hide.
You could use RBNControlGetCmdIDThs To get to the CommandID for the control and compare this to the one you want to hide.
Also make sure you have the most recent version of the RibbonLib.
You can grab that from here: https://github.com/PeterHorsbollMoller/mbLibrary
To view this discussion on the web visit https://groups.google.com/d/msgid/mapinfo-l/db67b93f-61cd-4fe1-98fa-7c572c5f80d3n%40googlegroups.com.