MapInfo Pro Developers User Group

Welcome to the MapInfo Pro Developers community!  We are a group dedicated to the discussion and understanding of MapBasic and .Net MapInfoPro AddIn development. Bring your questions and ideas here. This group includes several members of the Pro development team from around the world.

Please feel free to start a discussion in the discussion tab or join in a conversation.

Product Information  Ideas Portal  MapInfo Community Downloads

Discussions

Members

Resources

Events

 View Only
  • 1.  How to refresh the ribbon

    Posted 11-13-2017 22:32

    I have a script that will enable and disable custom tool buttons in a new tab and buttons I built in the ribbon interface.

    Using one tool will enable the next tool button. But the tool button remains disabled until I click on it, at which point it becomes enabled. The tool button also becomes enabled if I do something else that refreshes the interface.

    Can I, in the script, deliberately refresh the ribbon?



  • 2.  RE: How to refresh the ribbon

    Employee
    Posted 11-13-2017 19:20

    Hi Nick.

    The interface should update the enabled/disabled state of the custom tool buttons without anything like forcing a refresh of the entire ribbon, so we should probably try to understand that better.

    Could you describe the button definition and implementation a bit more?

    How are you invoking the enable/disable state toggle? I assume something similar to:

    Call SetRbnItemEnabled(button1, True) ?

    -john



  • 3.  RE: How to refresh the ribbon

    Posted 11-13-2017 23:17

    Hi John,

     

    Call SetRbnToolBtnCtrlEnabled(button1e,TRUE)

    I have two tool buttons in a row. The first tool button lets the user select a point (on a polyline). This then enables the second tool button which lets the user select a second point (on the same polyline).

     



  • 4.  RE: How to refresh the ribbon

    Posted 11-14-2017 01:41

    I solved it.

    I had not set a Draw Mode.

    I used this line below to fix my code

    Call SetRbnToolBtnCtrlDrawMode(button1d,DM_CUSTOM_POINT)

    This told MapInfo that a single click finished the operation, and then the ribbon updated appropriately