The alter menu command causes LEGACY Tab to appear in MapInfo Pro 16

460 views
Skip to first unread message

Keith Tozier

unread,
Nov 17, 2016, 11:46:58 AM11/17/16
to MapInfo-L


I have found that using an alter menu command for changing the title of a menu causes the LEGACY tab to appear in MapInfo Pro 16.

under the LEGACY Tab there is just the word menu with no menu or controls at all.  Is this a bug?

The old style menu appears on the MAPPER_SHORTCUT and in the Tools Extension.

How should these be altered such that the LEGACY Tab does not appear? (MDN ON/MDN OFF)

1) Should they be altered a different way

or

2) Should code be written to remove the near empty LEGACY Tab.


Any recommendations would be appreciated.

Thank you in advance.


Keith Tozier
International Computer Works, Inc.




Peter Horsbøll Møller

unread,
Nov 18, 2016, 2:03:39 AM11/18/16
to mapi...@googlegroups.com

Keith,

 

The context menus can be alter using the classic Alter Menu statement. I have done that also without making the LEGACY tab appear.

'**Adding menu item to the Mapper window rightclick menu

Alter Menu ID M_SHORTCUT_MAPPER add

   GetResItemStr("MNU_CREATE_MAP_EXTENT")

      HelpMsg GetResItemStr("MNU_HLP_CREATE_MAP_EXTENT")

      Calling MAPEXTCreateMenu

 

But if you start modifying “normal” menus I would expect that to have some side effects as these don’t really exist.

 

You can also use the RibbonLib to modify the context menus, such as the MapperShortcut:

'**Adding a menu item to the Layer Control Maps Context menu

nCtrlIdx = RBNCntxtMenuAddMenuItem(MenuId_MapperShortcut, "mapCntxtMapExtent", GetResItemStr("MNU_CREATE_MAP_EXTENT"), "")

If nCtrlIdx > 0 Then

   Call RBNControlSetToolTipIdx(nCtrlIdx, PRGIGetApplicationName(), GetResItemStr("MNU_HLP_CREATE_MAP_EXTENT"), "")

   Call RBNControlSetIconsIdx(nCtrlIdx, CONTROL_SIZE_SMALL, "", PATH_IMAGES & "MapWindowExtent_24x24.png")

   Call RBNControlSetLeftMarginIdx(nCtrlIdx, 0)

   Call RBNControlSetCustomMBXHandlerIdx(nCtrlIdx, "MAPEXTCreateMenu")

End If

 

You can also modify the application context menu seen on the application itself in the Tools window:

nCtrlIdx    = RBNToolContextMenuAddMenuItem("rateApplication", GetResItemStr("MNU_RATE_APPLICATION"), "")

If nCtrlIdx > 0 Then

   Call RBNControlSetToolTipIdx(nCtrlIdx, PRGIGetApplicationName(), GetResItemStr("MNU_HLP_RATE_APPLICATION"), "")

   Call RBNControlSetIconsIdx(nCtrlIdx, CONTROL_SIZE_SMALL, PATH_IMAGES & "CommunityDownloads_16.png", "")

   Call RBNControlSetLeftMarginIdx(nCtrlIdx, 0)

   Call RBNControlSetCustomMBXHandlerIdx(nCtrlIdx, "MENUGoToCommunityDownloads")

End If

 

When using the RibbonLib, you can also assign images to the menuitems

 

What menu did you want to alter?

 

Peter Horsbøll Møller

Pitney Bowes

--
--
You received this message because you are subscribed to the
Google Groups "MapInfo-L" group.To post a message to this group, send
email to
mapi...@googlegroups.com
To unsubscribe from this group, go to:
http://groups.google.com/group/mapinfo-l/subscribe?hl=en
For more options, information and links to MapInfo resources (searching
archives, feature requests, to visit our Wiki, visit the Welcome page at
http://groups.google.com/group/mapinfo-l?hl=en

---
You received this message because you are subscribed to the Google Groups "MapInfo-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapinfo-l+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.




Keith Tozier

unread,
Nov 18, 2016, 10:15:59 AM11/18/16
to MapInfo-L
Peter,

I will definitely give it a try,

Once again, Thanks for your assistance.

Have a Great Day!

Keith Tozier

unread,
Nov 18, 2016, 10:47:07 AM11/18/16
to MapInfo-L
Peter,

I guess I responded before reading to the end.

You asked "What menu did you want to alter?"

I have the menu in two places The Tools Extensions and the Mapper Context menu.

So, I need to keep them in sync with the ribbon button I added in (basically an on/off button).

Again this should demonstrate a toggle type behavior as I allow the end user to toggle Move Duplicate Nodes

Another thought is to use an image to on the menus as I had done on the ribbon button. (red image is off and green image is on)

This way the menu title can just say "MDN"

I will get this straightened out,  I am still learning the new MI Pro interface.

Peter Horsbøll Møller

unread,
Nov 21, 2016, 2:11:43 AM11/21/16
to mapi...@googlegroups.com

I would do it like this:

 

Creating the control:

mnbtnSelInfoHandlerIdx   = RBNGroupAddButton("btnSelInfoHandler", GetResItemStr("STR_BTN_SEL_INFO_HANDLER"), "", sTabName, sGroupName)

If mnbtnSelInfoHandlerIdx > 0 Then

   Call RBNControlToggleIdx(mnbtnSelInfoHandlerIdx, TRUE)

   Call RBNControlSetToolTipIdx(mnbtnSelInfoHandlerIdx, PRGIGetApplicationName(), GetResItemStr("STR_TTIP_ENABLE_INFO_SEL"), "")

   Call RBNControlSetIconsIdx(mnbtnSelInfoHandlerIdx, CONTROL_SIZE_LARGE, "", PATH_IMAGES & "InfoSelHandlerGreen_32x32.png")

   Call RBNControlSetCustomMBXHandlerIdx(mnbtnSelInfoHandlerIdx, "SELINFOSwitchDisplay")

End If

 

Notice that I use a modular variable (mnbtnSelInfoHandlerIdx) to remember the Index of the control.

I can use this later in my application to switch the state of it.

 

And here you “switch” the button on/off:

Sub SELINFOSwitchDisplay

   mbInfoSelChangedHandlerEnabled = (NOT mbInfoSelChangedHandlerEnabled)

   Call RBNControlSelectedIdx(mnbtnSelInfoHandlerIdx, mbInfoSelChangedHandlerEnabled)

 

   If mbInfoSelChangedHandlerEnabled Then

      Call RBNControlSetToolTipIdx(mnbtnSelInfoHandlerIdx, PRGIGetApplicationName(), GetResItemStr("STR_TTIP_ENABLE_INFO_SEL"), "")

      Call RBNControlSetIconsIdx(mnbtnSelInfoHandlerIdx, CONTROL_SIZE_LARGE, "", msImageFolder & "InfoSelHandlerGreen_32x32.png")

   Else

      Call RBNControlSetToolTipIdx(mnbtnSelInfoHandlerIdx, PRGIGetApplicationName(), GetResItemStr("STR_TTIP_DISABLE_INFO_SEL"), "")

      Call RBNControlSetIconsIdx(mnbtnSelInfoHandlerIdx, CONTROL_SIZE_LARGE, "", msImageFolder & "InfoSelHandlerRed_32x32.png")

   End If

End Sub

 

Initially, I set the state to the opposite of what it was before.

The I use RBNControlSelectedIdx to either check or uncheck my control

And finally, depending on the current state I set the Tooltip text and the image of my control

 

Peter Horsbøll Møller

EMEA Channel Enablement Specialist

Location Intelligence | MapInfo

 

M: +45 29 133 769

peter....@pb.com | @phorsbollmoller

pitneybowes.com/dk | mapinfo.com

 

From: mapi...@googlegroups.com [mailto:mapi...@googlegroups.com] On Behalf Of Keith Tozier


Sent: 18. november 2016 16:47
To: MapInfo-L <mapi...@googlegroups.com>

--

--
You received this message because you are subscribed to the
Google Groups "MapInfo-L" group.To post a message to this group, send
email to


To unsubscribe from this group, go to:
http://groups.google.com/group/mapinfo-l/subscribe?hl=en
For more options, information and links to MapInfo resources (searching
archives, feature requests, to visit our Wiki, visit the Welcome page at
http://groups.google.com/group/mapinfo-l?hl=en

---
You received this message because you are subscribed to the Google Groups "MapInfo-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapinfo-l+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Keith Tozier

unread,
Nov 23, 2016, 4:46:13 PM11/23/16
to MapInfo-L

Peter,

The ribbon control works great, the old style menus not so great.


When I change the title of a (old fashion) menu item which is found in both the Home Tab>Tool Extension and Mapper Context Menu as seen below.

The menu is created using the old  "Create Menu" statement.

where this is just one of the many menu items.

"Node Combine..." Calling Node_combine,
"Node Split..." Calling Node_split,
"!MDN Off^MDN On" ID 35 calling Duplicate_Nodes,
"Retire T&LID..." Calling Retire_Segment,
"&Erase Line..." Calling EraseLine,

when I issue the:

alter menu item Duplicate_Nodes text "MDN Off"

  or

alter menu item Duplicate_Nodes text "MDN On"

is when the LEGACY Tab appears.






This is the Mapper Context Menu                              and                                                                                            this is the Tools Extension menu




I think I may have to either change the menu item to just MDN and rely upon the end user to look at the ribbon to determine if it is on(green) or off(red)


or create a pop out menu that  would be 


Create Menu "&MDN" As

"&MDN On..." Calling MDNOnSub,        
"&MDN Off..." Calling MDNOffSub


I have attempted to remove the legacy tab when it appears and then the


alter menu item Duplicate_Nodes text "MDN Off"

  or

alter menu item Duplicate_Nodes text "MDN On"


Does not work.





Reply all
Reply to author
Forward
0 new messages