Changing width of buttons in Ribbon panel

Changing width of buttons in Ribbon panel

helsted
Contributor Contributor
2,207 Views
7 Replies
Message 1 of 8

Changing width of buttons in Ribbon panel

helsted
Contributor
Contributor

Hi

 

I'm making a custom ribbon tab where I would like to be able to specify the width of the buttons in a given ribbon panel such that they all have the same width. I've looked into the methods provided by AdWindows (e.g. https://thebuildingcoder.typepad.com/blog/2011/02/pimp-my-autocad-or-revit-ribbon.html) but I can't find any functions that modify the individual buttons - and furthermore how to only apply this to a single ribbon tab.

Currently my tab looks like the one below (I've just used a placeholder image for the buttons as of now).
Example.png

 

Does anybody know how to accomplish this?

0 Likes
2,208 Views
7 Replies
Replies (7)
Message 2 of 8

RPTHOMAS108
Mentor
Mentor

Seems they are governed by text width which is governed by font size.

 

You could also incorporate line feed characters to split 'Curtain Walls' into two lines. I think using a split button would be a better option. Or implement a DockableFrame with IExternalEventHandler to give you more freedom with your multiple controls.

 

The Revit ribbon is just the starting point I don't understand why so many developers seem to be obsessed with mutilating it with AdWindows. I guess it comes down to wanting to be highly visible, prominent or even pre-eminent perhaps. The fight for the Ribbon space, Ribbon wars.

Message 3 of 8

helsted
Contributor
Contributor

While I also considered a split button, the design of the ribbon with individual buttons comes from the explicit desires of the end users so it's quite locked. The idea was to make it as simple and intuitive as possible such that less tech savvy people could use it. 
Currently the text governs the width of the button, yes. I've tried simply adding spaces to the names such that they had an equal amount of characters which worked. However, this looked quite strange in the tool tip where the spaces were included in the name as well.

0 Likes
Message 4 of 8

RPTHOMAS108
Mentor
Mentor

You could change size of font perhaps but then it is harder to read. You could try eliminating the text altogether by using a couple of characters and matching the colour of the font to the button background (then button width would be governed by icon). There may be a restriction on only having non-printable characters in the button text but you could try that.

 

Tootip would use button text as default if you don't set it explicitly.

 

'less tech savvy people'?

 

Who are they trusting with their Revit modelling these days?

0 Likes
Message 5 of 8

helsted
Contributor
Contributor

Tech savvy might have been a poor choice of wording - rather those who do not do the modelling themselves but rather use the model to assess the design, retrieve geometric quantities etc. afterwards.

Can you change the title in the tool tip independently of the name of the button?

0 Likes
Message 6 of 8

RPTHOMAS108
Mentor
Mentor

Yes. Refer to:

 

RibbonItemData.ToolTip

The text that appears to start with when mouse is static over control.

and
RibbonItemData.LongDescription

The extended text that appears after mouse is static a bit longer.

 

I believe that if RibbonItemData.ToolTip is not used then the tooltip is taken from the button text (to populate it by default with something) as you've experienced.

0 Likes
Message 7 of 8

helsted
Contributor
Contributor

Hmm, I can't quite get it working - the results are the same as using PushButtonData. I might just stick with the differently sized buttons - it might also look better with the correct images in place.

0 Likes
Message 8 of 8

jeremy_tammik
Alumni
Alumni

> Tech savvy might have been a poor choice of wording - rather those who do not do the modelling themselves but rather use the model to assess the design, retrieve geometric quantities etc. afterwards.

 

You might also want to consider a completely different and possibly more efficient approach to provide assess to the design, retrieve geometric quantities etc. afterwards.

 

Using the Forge viewer (or other viewing alternatives of your own) would enable you do do exactly that at very little cost, definitely less than providing Revit licenses for people; it would even enable you to provide unlimited world-wide access to certain restricted data sets, if that is of use. As an extreme example, consider a BIM model that is used to automatically generate access or escape routing directions in an airport. Several orders of magnitude more viewers than modellers.

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes