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.  'Remove Designer Frame Window..' not removing frame and refreshing layout

    Posted 12-14-2017 16:34

    I'm trying to remove text items on a layout frame using the procedures below, Sometimes the text items are removed other times they still remain, even when the frame id has been found.

    I've also used the 'Set Layout window layout_ID Frame Contents On' command to try and get it to refresh the layout to no avail.

    The text items are created into the layout window with the 'name' option specified.

    Previously in 32bit we just cleared the layout cosmetic layer containing the text.

    Anyone have any ideas why it's not working consistently.

    Thanks

    Sub RemoveLayoutFrame(byval sFrameName as String)

    dim iFrame as integer

     iFrame = GetLayoutFrameID(sFrameName)

     if iFrame > 0 then

      Remove Designer Frame Window Layout_ID Id iFrame  

     end if

    exit function

    End Sub

    '----------------------------------------

    Function GetLayoutFrameID(byval sFrameName as string) as integer 'returns frame number for given frame also giFrameWiniD is set for WINID

    dim iFrame as integer

     giFrameWiniD = 0

     iFrame = LayoutItemID(Layout_ID,sFrameName,-1)

     if iFrame > 0 then

      giFrameWiniD = LayoutItemInfo(layout_id, iFrame, LAYOUT_ITEM_INFO_WIN)

     end if

     GetLayoutFrameID = iFrame

    exit function

    End Function

     

     



  • 2.  RE: 'Remove Designer Frame Window..' not removing frame and refreshing layout

    Employee
    Posted 12-14-2017 16:54

    We are looking into this and will post a reply soon.?



  • 3.  RE: 'Remove Designer Frame Window..' not removing frame and refreshing layout

    Posted 12-14-2017 18:33

    Hi David,

    First off, the 'Frame Contents On' clause in the statement 'Set Layout window layout_ID Frame Contents On' is being silently ignored for the 64 bit Layout window. It only applies to the legacy 32 bit window.

    You shouldn't need to refresh the Layout after removing items, it updates automatically.

    I gave your code a quick try: I created a bunch of text frames, each with the same Name (I'm assuming that's what you're doing), and in a loop called your RemoveLayoutFrame function passing the Name. It seemed to work as expected and removed as many of the text frames with the same Name as I asked it to.

    I might need to see more of how you are using RemoveLayoutFrame. Can you share more of your program?



  • 4.  RE: 'Remove Designer Frame Window..' not removing frame and refreshing layout

    Posted 12-15-2017 04:12

    If its being ignored could you please ask for the MapBasic Help to be updated as it's difficult to work out what is not being used by 64bit. It's still listed in the MapBasic v17 help that has recently been release. It specifically states that the 'set layout' statement can be used with both classic layout and layout window.

    Considering 64bit has been around since v12.5 I would have hoped these sort of things could have been mentioned in the help by now.

    I'll look into trying to send you some more code or screen shots of the affected output

    Thanks



  • 5.  RE: 'Remove Designer Frame Window..' not removing frame and refreshing layout

    Posted 12-15-2017 11:04

    Hi David,

    I created a bug for us to review and update the Set Layout documentation.