Hi, I would like to display a custom button with my C# Trados plugin when I open a sdlxliff file and then click on the "Review" menu. How do I do that? How can I display a custom button not in a created, but in an existing ribbon group?

Here is my code which does not work:

[RibbonGroup("ProjectsViewSampleActionGroup2", "Test", ContextByType = typeof(ProjectsController))]
[RibbonGroupLayout(LocationByType = typeof(TranslationStudioDefaultRibbonTabs.EditorReviewRibbonTabLocation))]
public class ProjectsViewSampleActionGroup : AbstractRibbonGroup
{
}

[Action("ProjectsViewSampleAction2", typeof(ProjectsController), Name = "ProjectsViewSampleAction_Name2", Description = "Meine Beschreibung", Icon = "ProjectsViewSampleAction_Icon")]
[ActionLayout(typeof(ProjectsViewSampleActionGroup), 1, DisplayType.Large)]
[ActionLayout(typeof(TranslationStudioDefaultContextMenus.EditorDocumentContextMenuLocation),1,DisplayType.Large)]
[Shortcut(Keys.Alt | Keys.F8)]
public class ProjectsViewSampleAction : AbstractViewControllerAction<ProjectsController>
{

protected override void Execute()
{...}
}

Parents
  • Former Member
    0 Former Member
    [RibbonGroup("sampleGroup", Name = "testGroup")]
    [RibbonGroupLayout(LocationByType = typeof(TranslationStudioDefaultRibbonTabs.EditorReviewRibbonTabLocation))]
    public class sampleGroup : AbstractRibbonGroup { }

    [Action("sampleAction", Name = "testAction")]
    [ActionLayout(typeof(sampleGroup))]
    public class sampleAction : AbstractAction
    {
    protected override void Execute() { }
    }
    check it out at 'Editor' view
  • Hi,
    many thanks for your answer. Here is my solution:
    class MyCustomTradosStudio
    {
    [RibbonGroup("ProjectsViewSampleActionGroup2", "Meine Aktion", ContextByType = typeof(EditorController))]
    [RibbonGroupLayout(LocationByType = typeof(TranslationStudioDefaultRibbonTabs.EditorReviewRibbonTabLocation))]
    public class ProjectsViewSampleActionGroup : AbstractRibbonGroup
    {
    }
    //
    [Action("ProjectsViewSampleAction2", typeof(EditorController), Name = "Aktionsname", Description = "Meine Beschreibung")]
    [ActionLayout(typeof(ProjectsViewSampleActionGroup), 1, DisplayType.Large)]

    [Shortcut(Keys.Alt | Keys.F8)]
    public class ProjectsViewSampleAction : AbstractViewControllerAction<AbstractViewController>
    {
    protected override void Execute()
    {
    MessageBox.Show("Great!");
    }
    }
    }
    This button is shown in the "Review" tab, but only, if "Translation Results" is set. If I click per example at "Messages" or "Comments", this button disappears. Is there a possibility to show it always on "Review"?

    Many regards,
    Andreas
Reply
  • Hi,
    many thanks for your answer. Here is my solution:
    class MyCustomTradosStudio
    {
    [RibbonGroup("ProjectsViewSampleActionGroup2", "Meine Aktion", ContextByType = typeof(EditorController))]
    [RibbonGroupLayout(LocationByType = typeof(TranslationStudioDefaultRibbonTabs.EditorReviewRibbonTabLocation))]
    public class ProjectsViewSampleActionGroup : AbstractRibbonGroup
    {
    }
    //
    [Action("ProjectsViewSampleAction2", typeof(EditorController), Name = "Aktionsname", Description = "Meine Beschreibung")]
    [ActionLayout(typeof(ProjectsViewSampleActionGroup), 1, DisplayType.Large)]

    [Shortcut(Keys.Alt | Keys.F8)]
    public class ProjectsViewSampleAction : AbstractViewControllerAction<AbstractViewController>
    {
    protected override void Execute()
    {
    MessageBox.Show("Great!");
    }
    }
    }
    This button is shown in the "Review" tab, but only, if "Translation Results" is set. If I click per example at "Messages" or "Comments", this button disappears. Is there a possibility to show it always on "Review"?

    Many regards,
    Andreas
Children