CommandInfo(CMD_INFO_MENUITEM) when called from a button in a custom ribbon interface

20 views
Skip to first unread message

Nicholas G Lawrence

unread,
Aug 10, 2021, 2:08:11 AM8/10/21
to mapi...@googlegroups.com

Hello all,


I am upgrading some code from 32-bit to 64-bit which means rebuilding the interface to a new user interface.

The previous code built a menu interface with the Create Menu command

and assigned an ID ID menu_item_id

 

The Sub that is called then uses CommandInfo(CMD_INFO_MENUITEM) to get the ID of the menu item that was just clicked upon.

How do I replicate this in the ribbon interface?

Which SetRbnBtnCtrl… command assigns the ID to the button on the ribbon?

 

Nick Lawrence
Senior Spatial Science Officer | Geospatial Technologies
Engineering & Technology | Transport and Main Roads

 

Floor 19 | 313 Adelaide Street | Brisbane City Qld 4000
GPO Box 1412 | Brisbane City Qld 4001
P: (07) 30667977
E: nicholas....@tmr.qld.gov.au
W:
www.tmr.qld.gov.au

 


WARNING: This email (including any attachments) may contain legally privileged, confidential or private information and may be protected by copyright. You may only use it if you are the person(s) it was intended to be sent to and if you use it in an authorised way. No one is allowed to use, review, alter, transmit, disclose, distribute, print or copy this email without appropriate authority.

If this email was not intended for you and was sent to you by mistake, please telephone or email me immediately, destroy any hard copies of this email and delete it and any copies of it from your computer system. Any right which the sender may have under copyright law, and any legal privilege and confidentiality attached to this email is not waived or destroyed by that mistake.

It is your responsibility to ensure that this email does not contain and is not affected by computer viruses, defects or interference by third parties or replication problems (including incompatibility with your computer system).

Opinions contained in this email do not necessarily reflect the opinions of the Department of Transport and Main Roads, or endorsed organisations utilising the same infrastructure.

Peter Horsbøll Møller

unread,
Aug 10, 2021, 4:22:09 AM8/10/21
to mapi...@googlegroups.com

Hi Nick

 

With the ribbon it works a bit differently.

You don’t specify the ID for the individual control that you add, but you can query what ID they have been assigned.

 

You ask for the control ID (CtrlID).

What function to use depends on the control type.

 

For standard buttons, use:

nCtrlID = GetMICtrlCtrlId(rbnControl)

 

For ToolButons, use:

nCtrlID = GetRbnToolBtnCtrlCtrlId (rbnControl)

 

where rbnControl is the control you have created.

 

If you use the Alter ButtonPad/Create ButtonPad statement to create you interface (requires v17.0.1), I think the other method will still work.

That is by applying your own CtrlID. This has been discussed here in the Knowledge Community.

 

Also note that with MapInfo Pro v2021 coming early October will have full MapBasic support for building your custom ribbon interface. Finally!

 

Peter Horsbøll Møller

www.precisely.com

 

Peter Horsbøll Møller
Principal Sales Engineer - Distinguished Engineer

 

From: 'Nicholas G Lawrence' via MapInfo-L <mapi...@googlegroups.com>
Sent: 10. august 2021 08:08
To: mapi...@googlegroups.com
Subject: [MI-L] CommandInfo(CMD_INFO_MENUITEM) when called from a button in a custom ribbon interface

 

This message originated Externally. Use proper judgement and caution with attachments, links, or responses.

 

--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapinfo-l/SY4P282MB2266E1C87CB63E3C70CE7795D3F79%40SY4P282MB2266.AUSP282.PROD.OUTLOOK.COM.

Reply all
Reply to author
Forward
0 new messages