Hello,
I am customizing the ribbon in v17. I have successfully added a new tab, new groups to that tab and new buttons or split buttons to the group. However, I need to add a “Tool” button.
What is the equivalent of “Add ToolButton” for the ribbon?
Many thanks,
Louise
Louise Kavanagh
Managing Director
![]()
| louise....@apogeedata.co.uk | +44 (0)7736 438822
Hi Louise
Sorry that I haven’t responded earlier.
Here is an example where I’m adding a ToolButton to a group on a TabGroup:
nCtrlIdx = RBNGroupAddControl("DTPolylineAddStartNode", "Add Start Node", "", ControlType_ToolButton, sTabName, sGroupName)
If nCtrlIdx > 0 Then
'Create & Set the button tooltip
Call RBNControlSetToolTipIdx(nCtrlIdx, PRGIGetApplicationName(), "Add new start node to selected polyline where clicked.", "Make sure you have selected a polyline from the editable layer.")
'Set the button icon
Call RBNControlSetIconsIdx(nCtrlIdx, CONTROL_SIZE_LARGE, "", ApplicationDirectory$() & "Images\PolylineAddStartNode_32.png")
'Set DrawMode
Call RBNControlSetDrawModeIdx(nCtrlIdx, DM_CUSTOM_POINT)
'Set Cursor
Call RBNControlSetMICursorIdx(nCtrlIdx, MI_CURSOR_CROSSHAIR, "")
'Set Custom MapBasic Handle to the button
Call RBNControlSetCustomMBXHandlerIdx(nCtrlIdx, "DTPolylineAddStartNode")
End If
I have highlighted the major differences between adding a (Push)Button and a ToolButton in red;
- ControlType is ControlType_ToolButton
- You need to set the drawmode
- You need to set the cursor
Hope this helps
Peter Horsbøll Møller
Pitney Bowes
From: mapi...@googlegroups.com <mapi...@googlegroups.com>
On Behalf Of Louise Kavanagh
Sent: 14. oktober 2019 15:40
To: mapi...@googlegroups.com
Subject: [MI-L] Adding Tool Button to Ribbon Interface
CAUTION: THIS EMAIL IS FROM AN EXTERNAL SOURCE. Internet links, office documents or other attachments may contain viruses. Do not click on a link, open or enable any file unless you trust the sender.
--
--
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/009901d58294%24e5428410%24afc78c30%24%40apogeedata.co.uk.
Hi Peter,
No problem at all.
Thank you for this it was exactly what I have been looking for.
I also need to add a “Toggle” button at some point. For example, a button that when clicked will turn a layer display on/off. Does that make sense? Can you send me similar for this type of control?
Many thanks,
Louise
To view this discussion on the web visit https://groups.google.com/d/msgid/mapinfo-l/DM5P128MB0012EC84291B025D06343F4EEA930%40DM5P128MB0012.NAMP128.PROD.OUTLOOK.COM.
Hi Louise
Here is a small article describing how to create a ToggleButton using the RibbonLib:
Peter Horsbøll Møller
Pitney Bowes
From: mapi...@googlegroups.com <mapi...@googlegroups.com>
On Behalf Of Louise Kavanagh
Sent: 16. oktober 2019 14:14
To: mapi...@googlegroups.com
Subject: RE: [MI-L] Adding Tool Button to Ribbon Interface
CAUTION: THIS EMAIL IS FROM AN EXTERNAL SOURCE. Internet links, office documents or other attachments may contain viruses. Do not click on a link, open or enable any file unless you trust the sender.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapinfo-l/004301d5841b%2431d58d40%249580a7c0%24%40apogeedata.co.uk.
--
|
This message originated Externally. Use proper judgement and caution with attachments, links, or responses. |