MapInfo Pro Developers User Group

New in v17.01

  • 1.  New in v17.01

    Pitney Bowes
    Posted 09-19-2018 17:30

    New in v17.01 - Let end users call your mapbasic functions from sql, labelling, smart text and more...

    New methods RegisterPublicFunction and UnregisterPublicFunction on IMapBasicApplication

    Add the ability for a Pro addin to expose mapbasic functions for use by the end-user

    The functions show up in the “Assist” and “Expression” Dialogs

    They can be used anywhere where mapbasic expressions are used

    Select statements

    Update statements

    Label Expressions

    Theme expressions

    Smart Text

     etc

     

    /// Registers a mapbasic function so that it is shown in the UI and can be called from interpreted code

    /// </summary>

    /// <param name="functionName">name of function inside mbx</param>

    /// <param name="publicName">public name for function, can be different than functionName</param>

    /// <param name="description"></param>

    /// <returns>ID number of function. Use this id to unregister the function.</returns>

    /// <remarks>When the addin is unloaded any registered public functions from the addin are automatically unregistered.</remarks>

    int RegisterPublicFunction(string functionName, string publicName, string description);

    MapBasic:

    IMBXRegisterPublicFunction (ByVal IMBXInstance As This, ByVal functionName As String, ByVal publicName as String, ByVal description as String) As Integer

     

    /// <summary>

    /// Unregisters a mapbasic function from the UI

    /// </summary>

    /// <param name="fcnid">Id of function to unregister. If value is -1, all functions registered for this mbx are unregistered.</param>

    void UnregisterPublicFunction(int fcnid);

    MapBasic:

    IMBXUnregisterPublicFunction (ByVal IMBXInstance As This, ByVal fcnid As Integer)