I try to set the UseLargeIcon in a Ribbon PopupButton to FALSE.
This results in a E_FAIL.
If i add the button not to an PopupButton, i can set UseLargeIcon to FALSE without any problems
Any ideas why?
Cheers
Rene
Hi Rene,
A sample code says a thousand words 🙂 and makes it clearer what you mean. First I thought you were talking about setting the ButtonPopup's UseLargeIcon to false - which works fine:
AddButtonPopup(coll, false);
But then realized you probably meant the buttons inside it (modifying the SimpleAddIn project from the SDK samples):
ObjectCollection coll = m_inventorApplication.TransientObjects.CreateObjectCollection(); coll.Add(m_drawSlotButton.ButtonDefinition); coll.Add(m_addSlotOptionButton.ButtonDefinition); CommandControl buttonPopup = partSketchSlotRibbonPanelCtrls.AddButtonPopup(coll, false); buttonPopup.ChildControls.AddButton(m_drawSlotButton.ButtonDefinition, false); buttonPopup.ChildControls[1].UseLargeIcon = false; // << FAILS
It seems to me that inside the UI none of the popup button's children are small, unless they are checkboxes, like in View [tab] >> Appearance [panel] >> Shadows. So if you want to be consistent with the UI you would not force child buttons to be small.
Also, I think if making the child buttons small was supported it should be a property on the CommandControl (buttonPopup above) since setting it on a per child basis would look strange in my opinion.
Cheers,
Hi Adam,
thanks for your testing and comment.
But please see here:
The switch is a popup with small childs from Inventor.
This is also mentioned in the API-documentation -> AddPopup: "An example of this type of control is the 'Switch' control available in the Windows panel of the View tab." I looked at this and saw the small buttons.
Thats why I tried to set my own buttons like these one.
Cheers
Rene
Hi Rene,
I talked to engineering and it does not seem possible through the API at the moment. I logged a change-request for this feature, id 1518065.
Also, it is unfortunate that the example in the help file points to a control that cannot be reproduced through the API. As I understand, the help file will be modified to avoid this.
One thing that might work and you could try is using the generic Ribbon API directly. Not sure if it would have any side effects though:
http://adndevblog.typepad.com/manufacturing/2014/01/modify-ribbon-and-menu-items.html
Unless it's really necessary to have small child controls I would just use what the API currently offers.
Cheers,
Hi Adam,
thanks for the CR.
Please change the API not the documentation
Cheers
René