MapInfo Pro Developers User Group

Expand all | Collapse all

Is it possible for a wor to open with the legacy tab open?

  • 1.  Is it possible for a wor to open with the legacy tab open?

    Posted 03-28-2019 00:38
    We have a custom mapinfo interface that was built using 32bit. We have found that with some tweaks most things work in 64bit but many items go into the legacy tab (as expected). I was just wondering if it's possible to get the legacy tab to be open when the custom interface opens rather than users having to click on "legacy". Most of the functionality they need is in this.

    Regards,

    ------------------------------
    George Corea
    Mangoesmapping
    ------------------------------


  • 2.  RE: Is it possible for a wor to open with the legacy tab open?

    Posted 03-29-2019 05:22
    There is a method in IMapInfo.def that allows you to make a specific tab the current tab:
    Declare Method SetRbnTabIsSelected Class "MapInfo.Types.IRibbonTab" Lib "MapInfo.Types, Version=12.5.0.0, Culture=neutral, PublicKeyToken=1c8d81d2ee78b75d" alias set_IsSelected (ByVal IRbnTabInstance As This, ByVal isSelected As Logical)

    It does require for you to get the ribbon object and find the specific tab. Something along this way:

    Dim mapinfoApplication as This
    mapinfoApplication = SystemInfo(SYS_INFO_IMAPINFOAPPLICATION)
    Dim Ribbon as This
    Ribbon = GetRibbon(mapinfoApplication)
    Dim RibbonTabColl as This
    RibbonTabColl = GetTabsColl(Ribbon)
    Dim RibbonTab as This
    RibbonTab = GetRbnTabCollItemStr(RibbonTabColl, "TabLegacy")
    Call SetRbnTabIsSelected(RibbonTab, TRUE)

    You can find a lot more details on how to work with the ribbon interface is this great document by @Bill Wemple.​

    I haven't tested the code above so it might need a bit tweaking. Do let me know if you can't make it work.

    ------------------------------
    Peter Horsbøll Møller
    Pitney Bowes
    ------------------------------