Perhaps something like this:
Include "MapBasic.def"
Include "Icons.def"
Declare sub main
Declare Sub create_ButtonFromVendor
Declare Sub vendor_ButtonAction
Dim Vendors() as string
Sub Main
Onerror goto ErrorTrap
Call create_ButtonFromVendor
exit sub
ErrorTrap:
Note "Main: " & Err() & ":" & Error$()
resume next
end sub
Sub create_ButtonFromVendor
Dim i As Integer
i=2
redim Vendors(i)
Create ButtonPad "allVendor" As
ToggleButton
Icon MI_ICON_ZOOM_QUESTION
HelpMsg "Button: " & str$(1000)
Calling vendor_ButtonAction
Show
For i = 1 To Ubound(vendors)
Alter ButtonPad "allVendor" Add
ToggleButton
ID 1000 + i
Icon MI_ICON_ZOOM_QUESTION
Calling vendor_ButtonAction
HelpMsg "Button: " & str$(1000 + i)
Next
End Sub
'#######################################
Sub vendor_ButtonAction
Dim nVendorIndex As Integer
nVendorIndex = CommandInfo(CMD_INFO_TOOLBTN)
Note "You clicked on vendor " & nVendorIndex
End Sub
Regards,
-Bill
------------------------------
Bill Wemple
Principal Software Engineer, Quality Management
Precisely, Inc
precisely.com
------------------------------
Original Message:
Sent: 06-28-2022 13:25
From: Jay Russell
Subject: CustomMBXHandler with parameters?
Does anyone have tricks to allow passing of a parameter to buttons created in the new ribbon interface?
For example if I had a button to add a red or blue feature to a map based on Splitbutton. I would share everything in the code besides the style of the new feature.
Something similar to how it was done with the 32 bit buttons discussed here or another method:
Making a Button in mapinfo with conditional functionGeographic Information Systems Stack Exchange | remove preview |
apple-touch-icon@2.png?v=54e3ab1edcf3" width="200" height="200"> | Making a Button in mapinfo with conditional function | Thanks for contributing an answer to Geographic Information Systems Stack Exchange! Please be sure to answer the question. Provide details and share your research! Asking for help, clarification, or responding to other answers. Making statements based on opinion; back them up with references or personal experience. | View this on Geographic Information Systems Stack Exchange > |
|
|
------------------------------
Jay Russell
CENTERPOINT ENERGY RESOURCES
Houston TX
------------------------------