MapInfo Pro

 View Only
  • 1.  Creating Designer Legend in Mapbasic

    Posted 11-26-2018 01:10
    G'day,

    I am having trouble with creating a Designer Legend via a Mapbasic Script.

    When I call the same code from the Mapbasic window the legend window appears Docked and all is good. However when I try the exact same code within a script the legend window ALWAYS maximises and becomes the front window?

    Then I have to restore the legend window, change it to Docked mode and then drag it to a docking position for it to Dock.

    This is getting very frustrating... Any Ideas ??

    Murray

    ------------------------------
    Murray Jamieson
    Waratah-Wynyard Council
    Wynyard
    ------------------------------


  • 2.  RE: Creating Designer Legend in Mapbasic

    Employee
    Posted 11-26-2018 03:34
    Hi Murray

    There are a few statements that will generate a Legend Designer window, such as the Create Designer Legend statement.

    This statement also lets you specify some window settings which relates to the appearance of the window. One of these settings lets you control the state: Floating, Docked, Tabbed etc.

    Try using a statement like this:
    Create Designer Legend 
       From Window nMID
       Docked
       ...

    where nMID refers to your Map window the Docked keyword will set the state to Docked.

    You can also use the Set Window statement afterwards to change the state:
    Set Window nLgndID Docked

    where nLgndID refers to the Window ID of the Legend Designer window. You can also use the FrontWindow() function to refer to the active window or WindowID(0) to refer to the most recent opened window..

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