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
    ------------------------------



  • 3.  RE: Hiding the ribbon in a floating window

    Posted 30 days ago
    Greetings Peter,

    I have also been trying to remove the ribbon from the floating window as the smaller window interferes with printing.

    My question is:

    Did you create a new file for your script? Or did you add it to an existing mapbasic file that came with the software?

    ------------------------------
    Tiffany Selvidge
    Knowledge Community Shared Account
    ------------------------------



  • 4.  RE: Hiding the ribbon in a floating window

    Posted 29 days ago
    Hi Tiffany

    The example above is a stand-alone that need to get compiled.

    You can, of course, turn the Ribbons in the floating window completely, if you prefer. You can do this via the Backstage, the PRO tab, and then Application.

    Let me know if you could need the functionality in a tool. I could add it to the WindowHelper tool.

    ------------------------------
    Peter Horsbøll Møller
    Distinguished Engineer
    Pitney Bowes Software & Data
    ------------------------------



  • 5.  RE: Hiding the ribbon in a floating window

    Posted 27 days ago
    Thank you Peter. This setting did the trick. I had looked at the other options in the Options but missed the Application options. No additional tool needed.

    ------------------------------
    Tiffany Selvidge
    Knowledge Community Shared Account
    ------------------------------