SplitButton Apply Change Selected?

SplitButton Apply Change Selected?

Tiffany_Hayden_
Collaborator Collaborator
403 Views
3 Replies
Message 1 of 4

SplitButton Apply Change Selected?

Tiffany_Hayden_
Collaborator
Collaborator

When a change is selected in a split button, is there a way to change or modify the main control to show which one was selected? For example, if I choose Option 1 as the option is there a way to change Model to something like Model Option 1 or somehow show the option that was selected? I am just curious on how to show the user what has been selected. Any help would be greatly appreciated. Or if there is a better option let me know! 

 

Tiffany_Hayden__1-1713815496020.png

 

 

Dim secondPanel As RibbonPanel = newStandardRibbonTab.RibbonPanels.Add("Highlight Filter", "id_xSecondPanel_" & targetRibbon.InternalName, g_addInClientID)
Dim oDefs As ObjectCollection
oDefs = g_inventorApplication.TransientObjects.CreateObjectCollection
oDefs.Add(m_Option1)
oDefs.Add(m_Option2)

secondPanel.CommandControls.AddSplitButton(m_TestDropdown, oDefs, True)

 

 

I want it to work like this. 

Tiffany_Hayden__0-1713815898328.png

 

 

Tiffany Hayden
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Accepted solutions (1)
404 Views
3 Replies
Replies (3)
Message 2 of 4

Curtis_Waguespack
Consultant
Consultant
Accepted solution

@Tiffany_Hayden_ 

 

I think you want the AddButtonPopup or AddSplitButtonMRU methods. 

In looking closer the button you referenced seems to be a ButtonPopup ( the SplitButtonMRU behaves slightly different).

 

I have an example of SplitButtonMRU ( most recently used) , PopUp and ButtonPopup in one of the templates I provided from the AU class I presented last fall.

 

See link for example pics and a link to the download files

  • The one with the 1,2,3 buttons is a TogglePopup button and uses a separate image as the main button.
  • The one with paint brushes is a ButtonPopup and presents the list each time its clicked, and shows the last command used.
  • The one with the camel is the SplitButtonMRU and runs the last used command automatically when the button is clicked, and only shows the list if the list arrow is clicked specifically.
 

related link for future readers:

https://help.autodesk.com/view/INVNTOR/2023/ENU/?guid=GUID-2C7F4497-5B95-480F-9397-07E480FDF93C

 

MFG601910 AU Custom Inventor Addin Button Stacks Template Example.png

 

 

Hope that helps,
Curtis

 

EESignature

Message 3 of 4

Tiffany_Hayden_
Collaborator
Collaborator

@Curtis_Waguespack thanks so much. I will check it out. I looked at your class last week and I must have missed it. Thanks for the swift response! I'll look at it in the morning! 

Tiffany Hayden
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Message 4 of 4

Tiffany_Hayden_
Collaborator
Collaborator

The AddButtonPopup was exactly what I was looking for! Thank you so much! @Curtis_Waguespack 

 

Dim secondPanel As RibbonPanel = newStandardRibbonTab.RibbonPanels.Add("Highlight Filter", "id_xSecondPanel_" & targetRibbon.InternalName, g_addInClientID)
Dim oDefs As ObjectCollection
oDefs = g_inventorApplication.TransientObjects.CreateObjectCollection
oDefs.Add(m_68)
oDefs.Add(m_128)

secondPanel.CommandControls.AddButtonPopup(oDefs, False)

 

 

Tiffany Hayden
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature