Create a custom ribbon

Dear community members,

I have been looking through the API documentation but could not find information on how to create a custom ribbon. Is this not possible or did I look at the wrong place?

I have created a new view and I would like to create a custom "Home" ribbon for this new view. If this is not possible, is there any way to display the "Add-Ins" ribbon by default instead of the "View" one. I could then use the "Add-ins" ribbon to add my groups and actions.

Thanks in advance for your support.

I wish a merry Christmas and a happy new year to the whole community!

Regards,

Laurent

  • Hi Laurent,

    Unfortunately, I don't think either of your requests are possible through the API!

    Hopefully SDL improves this area in the future...

    Merry Christmas and Happy New Years! [*]

  • Hi Laurent,

    When I look at apps such as Qualitivity, it does seem to be possible to fully customise the ribbons on the Home tab, as this screen seems to suggest:

    I.e. you have a new view and then you have full control over what you put on the Home tab, possibly also the other tabs. As I am not a developer I can't tell you how exactly this is done, but I would assume that when you create your view you maybe get an empty Home tab and rather than customise it you just put UI elements on it? Hopefully, others - i.e. proper coders :) - can comment on this, too, at some point.

    Thanks and Happy Holidays everyone

    Daniel

  • Hi Laurent,

    Sorry, I misread the question in my initial reply (I read it to mean a custom tab in an existing view)! I'm glad Daniel Brockman brought up the Qualitative plug-in, as you *can* make custom home tabs for views.

    In order to make your "Home" tab for your custom view, you need to do the following:

       [RibbonGroup("MyRibbonGroup")]

       [RibbonGroupLayout(LocationByType = typeof(TranslationStudioDefaultRibbonTabs.HomeRibbonTabLocation))]

       class MyRibbonGroup : AbstractRibbonGroup

       {

       }

       [Action("MyAction", typeof(MyView))]

       [ActionLayout(typeof(MyRibbonGroup))]

       public class MyAction : AbstractViewControllerAction<MyView>

       {

          ...

       }

     

    I am assuming "MyView" is your custom view. The key here is the following two lines:

       [Action("MyAction", typeof(MyView))]

       [ActionLayout(typeof(MyRibbonGroup))]

    The first line "typeof(MyView)" associates your action with your view, so it only appears when you switch to your view.

    The second line "(typeof(MyRibbonGroup)" associates the action with your custom ribbon group.

  • Dear Jesse, dear Daniel,

    Thanks for your reply and your help. It works as expected... and it is logic too, when you look closer to it. The Home ribbon is part of the Studio default ribbon tabs collection, which by default, applies to all Studio views... It is just not displayed because it is empty.

    Regards,

    Laurent
  • Former Member
    0 Former Member

    Hi, Laurent,

    You can create your own customized Ribbon the easy way. The Ribbon is not a concept and/or feature created by SDL Trados. It is simply a feature originally from Microsoft. Any developer in Microsoft Windows can create applications with the look and feel of SDL Trados or memoQ which, by the way, makes extensive use of the Ribbon. Of course, that is something really complex, only for experienced developers. I prefer the cleaner and more consistent look (and Ribbon) of Studio, though. This feature will turn 10 years this year. It was initially released with Microsoft Office 2007.

    Please, find information directly from Microsoft here: https://support.office.com/en-us/article/Customize-the-ribbon-in-Office-00f24ca7-6021-48d3-9514-a31a460ecb31

    I would say, in general, nothing compares to Microsoft Windows usability and beauty. This Ribbon feature is also present at the operating level system. That, in plain English, means you can see it in action in the File Explore (Windows Key + E) where you can see two Ribbons: Computer and View, each one with its own sections.

    I am attaching here a view of my customized Ribbon, which I called "My Workflow". I did not have to program anything or deal with APIs. It took me only a few minutes to create it. The beauty of it it's that your customized Ribbon is, as all Ribbons, "context-sensitive". By the way, you can create your own Ribbons in any Microsoft Office program: Word, Excel, etc.

    It's actually fun playing with the Ribbon. Try it. I hope this information is useful for you and for other Studio users.

    Now, if you are more into developing and coding take a look at this Microsoft page: https://msdn.microsoft.com/en-us/library/bb386097.aspx I recall that the master object was called RibbonX, but that is probably no longer used. Everything is XML based.

     

    Greetings!

    Gene