Hello all,
I want to remove a button (control) from the Home tab in the ribbon of MapInfo v17 (64-bit)
I can get the ribbon tab collection by;
Call RegisterUriParser(New_GenericUriParser(1),"pack",-1)
mapinfoApplication = SystemInfo(SYS_INFO_IMAPINFOAPPLICATION)
Ribbon = GetRibbon(mapinfoApplication)
RibbonTabColl = GetTabsColl(Ribbon)
But, then how do I get the “Home” tab?
RbnTabCollGetEnumerator?
RbnTabCollIndexOf?
RbnTabCollContains?
I’ve successfully built a new tab with groups and buttons, but this is my first attempt at modifying an existing tab
Thanks,
Nick Lawrence
Senior Spatial Science Officer | Geospatial Technologies
Engineering & Technology | Transport and Main Roads
Floor 19 | 313 Adelaide Street | Brisbane City Qld 4000
GPO Box 1412 | Brisbane City Qld 4001
P:
(07) 30667977
E: nicholas....@tmr.qld.gov.au
W: www.tmr.qld.gov.au
I was looking at these instructions
How to customize the MapInfo Pro Ribbon Interface
And found this command, which I guess returns the Table tab?
RibbonTab = GetRbnTabCollItemInt (RibbonTabColl, 1)
Does this mean that the Table tab is identified by “1”?
Is this is true, is there a list of all the standard tabs?
--
--
You received this message because you are subscribed to the
Google Groups "MapInfo-L" group.To post a message to this group, send
email to mapi...@googlegroups.com
To unsubscribe from this group, go to:
http://groups.google.com/group/mapinfo-l/subscribe?hl=en
For more options, information and links to MapInfo resources (searching
archives, feature requests, to visit our Wiki, visit the Welcome page at
http://groups.google.com/group/mapinfo-l?hl=en
---
You received this message because you are subscribed to the Google Groups "MapInfo-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
mapinfo-l+...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/mapinfo-l/88ae7840c7544cabb3b9abb4a11dad0a%40tmr.qld.gov.au.
Hi Andrew,
How did you determine the name of the tab, group and control?
TabHome
HomeFile
OpenTableButton
Is there a master list somewhere of all the tabs, groups and controls in the ribbon?
The buttons I want to remove are the six basemap buttons under Base Maps in the drop-down from the Open control in the File group of the Home tab.
This is for MapInfo v17
Thanks,
Nick
--
--
You received this message because you are subscribed to the
Google Groups "MapInfo-L" group.To post a message to this group, send
email to mapi...@googlegroups.com
To unsubscribe from this group, go to:
http://groups.google.com/group/mapinfo-l/subscribe?hl=en
For more options, information and links to MapInfo resources (searching
archives, feature requests, to visit our Wiki, visit the Welcome page at
http://groups.google.com/group/mapinfo-l?hl=en
---
You received this message because you are subscribed to the Google Groups "MapInfo-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
mapinfo-l+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapinfo-l/4000f128-2ab4-4c66-803b-23cf8e1f8c5ao%40googlegroups.com.
Hi Nick
There’s few ways to get a complete list of the tabs, groups, and controls.
I have a def file that holds defines for the tabs and groups.
When you get into the nitty gritty part of all the controls, you’ll have to loop through them and capture their names.
You can do this with the RibbonExample application that I have posted on GitHub, and you can also do it with the ProSampleAddIn that comes with MapBasic.
I have attached the latest list of elements that I have created. Note that some of the controls can be from add-ins.
From: 'Nicholas G Lawrence' via MapInfo-L <mapi...@googlegroups.com>
Sent: 26. august 2020 04:29
To: mapi...@googlegroups.com
Subject: RE: [MI-L] Re: Mapbasic : remove a control from the Home tab in the ribbon
|
This message originated Externally. Use proper judgement and caution with attachments, links, or responses. |
To view this discussion on the web visit https://groups.google.com/d/msgid/mapinfo-l/6c9d25c221004e37887e719a2f91ac00%40tmr.qld.gov.au.
I wrote this code which makes the “Base Maps” group in the Open button not visible. Which is what I want
The code relies upon the various controls being at known positions defined as Integer. It does work in v17 but might not work in other versions if the ribbon interface changes.
Include "icons.def"
Include "mapbasic.def"
Include "menu.def"
Include "IMapInfoPro.def"
Include "Enums.def"
Declare Sub Main
Sub Main
Dim mapinfoApplication As This
Dim Ribbon As This
Dim RibbonTabColl As This
Dim tabHome As This
Dim tabHomeGroups As This
Dim grpFile As This
Dim grpFileColl As This
Dim btnOpen As This
Dim btnOpenColl As This
Dim btnOpenBaseMaps As This
'get the ribbon
Call RegisterUriParser(New_GenericUriParser(1),"pack",-1)
mapinfoApplication=SystemInfo(SYS_INFO_IMAPINFOAPPLICATION)
Ribbon=GetRibbon(mapinfoApplication)
RibbonTabColl=GetTabsColl(Ribbon)
'get the first (0) tab
tabHome=GetRbnTabCollItemInt(RibbonTabColl,0)
'get the groups on the Home tab
tabHomeGroups=GetRbnTabGrps(tabHome)
'get the first (0) group
grpFile=GetRbnCtrlGrpCollItemInt(tabHomeGroups,0)
'get the collection of controls in the first group
grpFileColl=GetRbnCtrlGrpCtrls(grpFile)
'get the Open button
btnOpen=GetMICtrlCollItemInt(grpFileColl,0)
'get the collection of split controls
btnOpenColl=GetRbnSplitCtrlCtrls(btnOpen)
'get the second (1) group
btnOpenBaseMaps=GetMICtrlCollItemInt(btnOpenColl,1)
'Set the Base Maps group not visible
Call SetCtrlVisible(btnOpenBaseMaps,FALSE)
End Sub
To view this discussion on the web visit https://groups.google.com/d/msgid/mapinfo-l/MN2PR16MB31174BFBEB6B35CCDDCACB5496540%40MN2PR16MB3117.namprd16.prod.outlook.com.
Thanks for sharing, Nick.
You can use these methods and the name of the tabs/controls: GetRbnTabCollItemStr and GetMICtrlCollItemStr
'get the first (0) tab
tabHome = GetRbnTabCollItemStr(RibbonTabColl,"HomeFile")
and
'get the Open button
btnOpen = GetMICtrlCollItemStr(grpFileColl,"HomeFileOpenGallerySplitButton")
and
'get the second (1) group
btnOpenBaseMaps = GetMICtrlCollItemStr(btnOpenColl,"BaseMaps")
MapInfo Pro v2019 does have the Base Map group in the same location as v17 so your code should also work here.
I assume you have also removed the Base Map group from the Open splitbutton on the TABLE and MAP tab?
To view this discussion on the web visit https://groups.google.com/d/msgid/mapinfo-l/6e33261eb78e4d2fa4b20484eabe9bf5%40tmr.qld.gov.au.
I forgot about the TABLE and MAP tabs!
Thanks for the hint about using strings instead of integers
To view this discussion on the web visit https://groups.google.com/d/msgid/mapinfo-l/MN2PR16MB31175D0681FBFB792001E06F96550%40MN2PR16MB3117.namprd16.prod.outlook.com.
Hi Nick
I have too many small tools that I haven’t published yet on Github.
Cleaning up my tools I came across this one: mbBasemaps.
It basically does what your tool also does.
It removes one or more of the Bing and GeoMap controls from the Basemap group.
My version uses a configuration file to specify which controls to remove.
Sorry that I hadn’t shared this one before
To view this discussion on the web visit https://groups.google.com/d/msgid/mapinfo-l/6af2c015b39447eb9b81d789b8eb7d80%40tmr.qld.gov.au.