MapInfo Pro Developers User Group

Expand all | Collapse all

MapInfo 17 Help ContextID

  • 1.  MapInfo 17 Help ContextID

    Posted 01-14-2019 06:24

    Hi there fellow MI users,

    Does anyone know how to get access to MapInfo`s internal help contextIDs?

    Im trying to open MapInfo Pro Help application with contextID as input, so that the help application opens on the correct page by the button that was pressed.

    The C# code i have try`d is like this:

    	void MapInfoEvent_HelpExecuted(object sender, IMapInfoControl e)
    		{
             if (e != null)
             {
                string name = e.Name;
                if (e.Name.Substring(0,2) == "M_")
                {
                   this._application.OpenHelp((int)e.ContextHelpIdentifier);
                }
                else
                {
                   oHelper.RunCustomizedHelp(sender, e);
                }
             }
          }


    The problem is that e.ContextHelpIdentifier always is null. I need to get the contectID somehow..


    All help and suggestions are very welcomed :)



    ------------------------------
    Kenneth Hauklien
    Micado AS
    Oslo -> Norway
    ------------------------------


  • 2.  RE: MapInfo 17 Help ContextID

    Pitney Bowes
    Posted 01-15-2019 03:19
    Hi,

    To correctly get the ContextHelpIdentifier in the event, you need to assign the help id to the control/button during its creation.

    Just set the ContextHelpIdentifier property on IMapInfoControl interface during button creation and when F1 is pressed over that button you will get the assigned ID back in the event handler.

    Now, if you want to open an existing help page on pressing F1 over the button added by your addin, then you can assign the mapinfo run menu command id in ContextHelpIdentifier property.

    example: To open "open table" help page on your button.

    toolButton1.ContextHelpIdentifier = 102;
    In HelpExecuted event handler, call _application.OpenHelp((int)e.ContextHelpIdentifier);


    Note: Please make sure to check that the control was added by your addin, as the event is fired to all loaded addins subscribing to HelpExecuted event.

    Thanks
    Anshul

    ------------------------------
    Anshul Goel
    Knowledge Community Shared Account
    ------------------------------



  • 3.  RE: MapInfo 17 Help ContextID

    Posted 01-15-2019 03:23

    Thank you so much!

    Now for the followup question.

    Where can i get an overview/table/ressource over MapInfo original buttons and their respective ContextHelpIDs?

    Example:
    Open Table = xxx
    Select Invert = xxx



    ------------------------------
    Kenneth Hauklien
    Micado AS
    Shelton CT
    ------------------------------



  • 4.  RE: MapInfo 17 Help ContextID

    Pitney Bowes
    Posted 01-15-2019 03:48
    Edited by Anshul Goel 01-15-2019 03:48
    check Menu.Def file installed with mapbasic installation, for command ids.

    ------------------------------
    Anshul Goel
    Knowledge Community Shared Account
    ------------------------------



  • 5.  RE: MapInfo 17 Help ContextID

    Posted 01-15-2019 04:05
    Thank you so much! :D
    Excellent help.

    Works like a charm

    ------------------------------
    Kenneth Hauklien
    Micado AS
    Shelton CT
    ------------------------------



  • 6.  RE: MapInfo 17 Help ContextID

    Posted 01-15-2019 04:34
      |   view attached
    Do you by any chance know the ContextID for the first page in MapInfo Help Application?  <Welcome to MapInfo Pro>

    I wish to default into this page if no ContextID is found in the event.

    ------------------------------
    Kenneth Hauklien
    Micado AS
    Shelton CT
    ------------------------------



  • 7.  RE: MapInfo 17 Help ContextID

    Pitney Bowes
    Posted 01-17-2019 03:16
    Try executing _application.RunMapBasicCommand("run menu command 1202"); when no context id.

    ------------------------------
    Anshul Goel
    Knowledge Community Shared Account
    ------------------------------