Hey Martin
There are a few steps required for this to work.
Let me start by saying that I haven't tried it myself yet.
First, you need to enable the support for the QAT for the individual controls in your application. The different control types all have a method that allows you to set this. You can find these methods in the file IMapInfoPro.def.
For the standard IMapInfoControl, the method is called SetMICtrlIsQatItem
. You pass the control variable and the value TRUE
to the method to set it to used in the QAT:
Call SetMICtrlIsQatItem(theControl, TRUE)
In your application you also need to handle the loading and saving of the ribbon state through two methods:
RbnLoadRibbonState (ByVal IRbnInstance As This, ByVal addInName As String, ByVal addInPath As String)
n the MapInfo Pro Extensibility Reference, I found this:
An Add-in can call this to load any items a user has added to the Quick Access Toolbar. Only ribbon items with the IsQAT property set to true can be added to the QAT. Gallery controls cannot be added to the QAT. A state file is loaded from the location specified by the path with the name made up of the identifier followed by ".QatState.json".
RbnSaveRibbonState (ByVal IRbnInstance As This, ByVal addInName As String, ByVal addInPath As String)
An Add-in can call this to save any items a user has added to the Quick Access Toolbar. Only ribbon items with the IsQAT property set to true can be added to the QAT. Gallery controls cannot be added to the QAT. A state file is created in the location specified by the path with the name made up of the identifier followed by ".QatState.json".
Cheers
Peter
------------------------------
Peter Horsbøll Møller
Principal Presales Consultant | Distinguished Engineer
Precisely | Trust in Data
------------------------------
Original Message:
Sent: 04-22-2025 07:15
From: Martin Thorn
Subject: Add Custom MB tool to Quick Access toolbar?
I see that when right click on a custom mapBasic tool in the menu the option to "Add to Quick Access toolbar" is grayed. Is it possible to somehow activate that so you can add custom tools up there.?
------------------------------
Martin Thorn
GIS Ingenjör
Göteborgs Stad
GOETEBORG
------------------------------