MapInfo Pro Developers User Group

Expand all | Collapse all

Hiding the ribbon in a floating window

Jump to Best Answer
  • 1.  Hiding the ribbon in a floating window

    Posted 07-29-2019 04:38
      |   view attached
    Hi

    I'm trying to hide the ribbon in a floating document window but I'm running into issues getting the ribbon from a floating window.

    I get this error:

    Here is the code (also attached in a zip) that I use:

    Include "IMapInfoPro.def"
    Include "IMapInfoPro.def"
    Include "Enums.def"
    Include "MapBasic.def"


    Declare Sub Main

    Sub Main
    Dim theMapInfoPro As This
    Dim theRibbon As This
    Dim rptWindow As RefPtr


    'Get MIPro interface
    theMapInfoPro = SystemInfo(SYS_INFO_IMAPINFOAPPLICATION)
    Print "theMapInfoPro: " & theMapInfoPro'
    rptWindow = FrontWindow()
    Print "rptWindow: " & rptWindow
    Print "FrontWindow(): " & FrontWindow()

    theRibbon = MIProGetFltingWindowRibbon(theMapInfoPro, rptWindow)
    Call SetRbnVisible (theRibbon, false)


    End Sub


    The error occurs at this statement:
    theRibbon = MIProGetFltingWindowRibbon(theMapInfoPro, rptWindow)

    Any suggestions on how I can get to the ribbon of a floating window and then hide it would be appreciated.

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

    Attachment(s)

    zip
    FloatingWindowRibbon.zip   419B 1 version


  • 2.  RE: Hiding the ribbon in a floating window
    Best Answer

    Posted 08-06-2019 04:06
    I gave this another try and decided to try use the DockingManager to access the window. That was the solution.

    Include "IMapInfoPro.def"
    Include "Enums.def"
    Include "MapBasic.def"


    Declare Sub Main

    Sub Main
    Dim theMapInfoPro As This
    Dim thsDockingManager As This
    Dim theRibbon As This
    Dim thsWindow As This
    Dim rptWindow As RefPtr


    'Get MIPro interface
    theMapInfoPro = SystemInfo(SYS_INFO_IMAPINFOAPPLICATION)
    'Get the Docking Manager
    thsDockingManager = GetDockingManager(theMapInfoPro)


    'Get the FrontWindow via the Docking Manager
    thsWindow = GetDockingManagerFrontDocumentWindow(thsDockingManager)
    rptWindow = thsWindow
    'Get the ribbon from the floating window and then hide it
    theRibbon = MIProGetFltingWindowRibbon(theMapInfoPro, rptWindow)
    Call SetRbnVisible (theRibbon, false)


    End Sub

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