MapInfo Pro

Welcome to the MapInfo Pro community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Here are some useful links where you can find more information:

Product Announcements  Product Documentation  Ideas Portal

Discussions

Members

Resources

Events

 View Only
  • 1.  How can I automatically maximise the ribbon using MapBasic or DotNet?

    Posted 09-22-2017 10:04

    We've removed the standard tabs and added our own but it always starts up minimised.



  • 2.  RE: How can I automatically maximise the ribbon using MapBasic or DotNet?

    Posted 09-25-2017 03:38
      |   view attached

    Hi Amita,

    I don't have a 'DockingState xml for the Runtime session but have enclosed it from the Full Pro session, neither of which open the Ribbon fully when running our program, it just displays the tabs and the map.

    Thanks

    David

    Attachment(s)

    zip
    MapInfoPro.zip   4 KB 1 version


  • 3.  RE: How can I automatically maximise the ribbon using MapBasic or DotNet?

    Employee
    Posted 09-25-2017 05:31
      |   view attached

    Hi David,

    If the default setting is to have the ribbon maximized, it should come up maximized every time you open MapInfo Pro.

    Open MapInfo Pro > If the Ribbon is minimized, double click on 1 of the tabs. You will now see the ribbon gallery with all the functions. In this section, right click and ensure that the option " Minimize ribbon" is unchecked. It should then automatically come up maximized.

    See if this helps you.(Screenshot attached)

    Regards,

    Shweta



  • 4.  RE: How can I automatically maximise the ribbon using MapBasic or DotNet?

    Posted 09-25-2017 06:59

    Hi Shweta,

    That is not the problem. Normal MapInfo Pro has the ribbon displayed. But our program removes all the standard tabs using repeated calls to RBNTabSetVisibilityThs() . Then our own tabs are added, but the ribbon is not maximised. Possibly if I do this the other way round it will be ok.

    But it's mainly used with Runtime so there shouldn't be any other tabs and I've tried setting the ribbon maximised and restarting but it doesn't show.

    So I want to be able to force it to show using MapBasic or dotNet.

    Cheers

    David



  • 5.  RE: How can I automatically maximise the ribbon using MapBasic or DotNet?

    Employee
    Posted 09-26-2017 04:26

    Hi David,

    I get your point. We will have to confirm if we have a built in support or need to work on it to get this working. I will let you know.

    Regards,

    Shweta

     



  • 6.  RE: How can I automatically maximise the ribbon using MapBasic or DotNet?

    Employee
    Posted 09-26-2017 04:55

    David,

    I recently heard that the Runtime version of MapInfo Pro actually has the ribbon tabs - they have just been hidden. I haven't tried loooking into this yet but maybe you can basically show the ribbons and then add your own instead of create new versions of the ribbon tabs.

    I'll try to look a bit more into this and let you know.



  • 7.  RE: How can I automatically maximise the ribbon using MapBasic or DotNet?

    Posted 11-07-2017 09:01

    Hi David, can you let us know how did you remove the standard tabs and added the custom tab into MapInfo? I have been looking for the references for quite some time. Happy to see the example code. Thanks!



  • 8.  RE: How can I automatically maximise the ribbon using MapBasic or DotNet?

    Posted 11-07-2017 09:35

    Hi Krishna,

    I use the commands from within the Ribbonlib code supplied by Peter .

    If you download his example code you will see various procedures within that, such as:

    To check if a tab exists and if not add it:

     If NOT RBNTabExists(sTab) Then

      '**Adding the TAB named TabTools with the caption of TOOLS

      '**nCtrlIdx is a reference to the element in the RibbonLib

      nCtrlIdx = RBNAddTab(sTab, sCaption, sTip)

      If nCtrlIdx <> 0 Then

       iTabs = Ubound(gsMenuTabs)+1

       redim gsMenuTabs(iTabs)

       gsMenuTabs(iTabs) = sTab   

        Exit Function

      End If

     end if

     

    For the turning on/off of a Tab:

    Call RBNTabSetVisibility(sTabName,lShow)



  • 9.  RE: How can I automatically maximise the ribbon using MapBasic or DotNet?

    Posted 11-08-2017 10:24

    Hi All,

    I am able to hide all the tabs from Ribbon and display my custom tab whenever I open the MapInfo application standalone and also from the Sample .NET form button (Onform Load and Onform Unload) which calls MBX file which will embed the MapInfo.

    Thanks to @Peter Horsbøll Møller? and @David Wilson? suggestions and their example code.

    Usually, Whenever we double click on the top ribbon area for any windows application, Application gets maximized or minimized. when I do the same in Mapinfo standalone with the Custom MBX it is working as usual ( Hiding Quick access toolbar along with the other Tabs in the ribbon).

    But, When I click on the MapInfo Application from the .NET form, I can see the quick access toolbar showing up.It is resizing the MIPro window Onform when we double click on left upper corner. It makes Mapinfo window smaller and that makes quick access toolbar visible. you can see the same in below images

    Before double-clicking on the ribbon

    Before double click

     

    After Double-clicking on the ribbon

    after double click

     

    This is the .NET form code

    private void button1_Click_1(object sender, EventArgs e)

           {

     string handle = mapinfo.Eval("SystemInfo(9)");

     // Convert the handle to an IntPtr type.

     IntPtr oldhandle = new IntPtr(Convert.ToInt32(handle));

     //Set the parent of MapInfo to a picture box on the form.

     SetParent(oldhandle, this.pictureBox1.Handle);

     //Get current window style of MapInfo window

     int style = GetWindowLong(oldhandle, GWL_STYLE);

    //Take current window style and remove WS_CAPTION(title bar) from it

    SetWindowLong(oldhandle, GWL_STYLE, (style & ~WS_CAPTION));            

    //Maximize MapInfo so that it fits into our control.

    mapinfo.Do("Set Window 1011 Max");

    String path = @Environment.CurrentDirectory;

    String command = "Run Application \""+path+"\\..\\..\\MapProcess\\HideRibbon.MBX\" mode current";

    mapinfo.Do(command);

    }

    I really want to know

    1. How do we hide the quick access toolbar from the .NET form?
    2. Should I call any method from any definition file? I used IMapInfo.def and MapBasic.def files in the entire process. is there any specific method we should call in Mapbasic code?
    3. How to disable that Maximize or minimise MapInfo window facility when we are accessing it from .NET form using Onform load and Onform Unload?

     

    In the broader perspective, I am trying to replace MapXtream and SSA with MapInfo. Will there be any API which we can embed the Mapinfo with above functionality? (Pls mind my ignorance :D)

    Expecting some suggestions from the knowledgeable people. Cheers :)