A typical GN4 menu appears in the XXX_TABITEMS.XML file, under GN4ShellMenus:
<?xml version="1.0" encoding="utf-8" ?>
<GN4ShellConfiguration
<GN4ShellMenus>
<Menuset Name="FredMain">
<Menu xmlns:l="http://www.teradp.com/schemas/GN4/1/Shell/Presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
[here comes the menu]
</Menu>
</Menuset>
</GN4ShellMenus>
</GN4ShellConfiguration>
There could be more menusets and menus that act depending on the current context.
Example: <MenuItem Header="_File"> <l:ShellMenuItem Header="New Article..." CommandParameter="ArticleNewDlg"> </MenuItem> Explanation: The only three variable parts are the drop-down menu name ("_File"), the option name ("New") and the system function ("ArticleNewDlg") that gets called when you click the menu command. It is expected that the system function is defined in the appropriate add-in (system or custom). If the specified name is not found in any add-in, or the current context is not the one where the option is to be enabled, the menu command will be dimmed. |
Example: <l:ShellMenuItem Header="_File"> <l:ShellMenuItem Header="New Article..." CommandParameter="ArticleNewDlg"> <l:ShellMenuItem.ToolTip>Create a new article</l:ShellMenuItem.ToolTip> </l:ShellMenuItem> Explanation: The only three variable parts are the drop-down menu name ("_File"), the option name ("New") and the system function ("ArticleNewDlg") that gets called when you click the menu command. It is expected that the system function is defined in the appropriate add-in (system or custom). If the specified name is not found in any add-in, or the current context is not the one where the option is to be enabled, the menu command will be dimmed. The tooltip appears when you hover your mouse over menu command. |
Example: <l:ShellMenuItem Header="_File"> <l:ShellMenuItem Header="New Article..." CommandParameter="ArticleNewDlg"> <l:ShellMenuItem.ToolTip>Create a new article</l:ShellMenuItem.ToolTip> </l:ShellMenuItem> <l:ShellMenuItem Header="Article by Template..." CommandParameter="ArticleNewTemplateDlg"/> <Separator/> <l:ShellMenuItem Header="New Assignment..." CommandParameter="ArticleNewAssignmentDlg"/> ... Explanation: The separator is to be added in its own line, as <Separator/>. |
Example: <l:ShellMenuItem Header="More..."> <l:ShellMenuItem Header="Selection to article..." CommandParameter="NotImplemented"/> <l:ShellMenuItem Header="Selection to new article..." CommandParameter="NotImplemented"/> <Separator/> <l:ShellMenuItem Header="As Auto-text" CommandParameter="NotImplemented"/> </l:ShellMenuItem> Explanation: A nested menu is simply added as a <MenuItem Header="AAAA"> that has no commands, and where AAAA is the name of the option. |
Example: <l:ShellMenuItem Header="Open Recent Articles"> <l:ShellDynamicMenuSeparator ItemsSource="{Binding Path=(l:ShellUI.Instance).MostRecentlyUsed.FilteredItems, RelativeSource={RelativeSource AncestorType={x:Type l:ShellWindow}}}"/> </l:ShellMenuItem> Note The higlighted line is broken in two parts for better readability. Should you want to paste it in your xxx_TabItems.xml, make sure to join it! Explanation: A recent items list is added through the syntax above. |
Example: <l:ShellMenuItem Header="Get 1" CommandParameter="GetSaveGet" Parameters="1"/> Note Here qualify only scripts with only one string type parameter - script with more than one parameter, or script with non-string parameters cannot be called in this way. |
Menu in browser
A typical browser menu has the following structure:
<menus>
<!-- Calendar, task & event-->
<menu name="Planning">
<menuItem text="New" iconUrl="do.ashx?Cmd=Icon&Name=tlb_NewForm&Size=16&Default=t">
<menuItem text="Task" iconUrl="do.ashx?Cmd=Icon&Name=t_task&Size=16&Default=t" navigateUrl="javascript:this.menuWebPart.showDialog('WFForm.aspx?wf=newTask&autoCloseMode\=2' ,null,870,650);" />
<menuItem text="Task copy" iconUrl="do.ashx?Cmd=Icon&Name=t_task&Size=16&Default=t" navigateUrl="javascript:this.menuWebPart.showDialog('WFForm.aspx?wf=newTask&autoCloseMode\=2&Ids='+this.menuWebPart.selectedIdList() ,null,820,650);" enable="One" />
<menuItem text="Upload iCalendar files" iconUrl="do.ashx?Cmd=Icon&Name=tlb_upload&Size=16" navigateUrl="javascript:this.menuWebPart.showDialog('WFForm.aspx?wf=uploadICal&pars=type:task',null,600,400);"/>
</menuItem>
<menuItem text="Edit" iconUrl="do.ashx?Cmd=Icon&Name=tlb_Edit&Size=16&Default=t" navigateUrl="javascript:this.menuWebPart.showDialog('EditObjectsForm.aspx?Ids='+this.menuWebPart.selectedIdList(),null,870,670);" enable="Some" />
<menuItem text="Delete" iconUrl="do.ashx?Cmd=Icon&Name=tlb_Delete&Size=16&Default=t" navigateUrl="javascript:this.menuWebPart.showDialog('DeleteForm.aspx?Ids='+this.menuWebPart.selectedIdList(),null);" enable="Some" />
<menuItem text="Send" iconUrl="do.ashx?Cmd=Icon&Name=tlb_Send&Size=16&Default=t">
<menuItem text="Send Forward" iconUrl="do.ashx?Cmd=Icon&Name=tlb_SendForward&Size=16&Default=t" navigateUrl="javascript:this.menuWebPart.showDialog('WFForm.aspx?wf=ContinueTaskCopyFlow&autoCloseMode\=1&ids='+this.menuWebPart.selectedIdList()+'&pars=type:sendOn',null,820,650);" enable="Some" />
<menuItem text="Send Back" iconUrl="do.ashx?Cmd=Icon&Name=tlb_SendBack&Size=16&Default=t" navigateUrl="javascript:this.menuWebPart.showDialog('WFForm.aspx?wf=ContinueTaskCopyFlow&autoCloseMode\=1&ids='+this.menuWebPart.selectedIdList()+'&pars=type:sendBack',null,820,650);" enable="Some" />
<menuItem text="Send to..." iconUrl="do.ashx?Cmd=Icon&Name=tlb_Send&Size=16&Default=t" navigateUrl="javascript:this.menuWebPart.showDialog('EditObjectsForm.aspx?objectUI\=sendTask&Ids='+this.menuWebPart.selectedIdList(),null,540,540);" enable="Some" />
</menuItem>
</menu>
Example: <menu name="Planning"> <menuItem text="New Task" iconUrl="do.ashx?Cmd=Icon&Name=t_task&Size=16&Default=t" navigateUrl="javascript:this.menuWebPart.showDialog('WFForm.aspx?wf=newTask&autoCloseMode\=2' ,null,870,650);" /> </menuItem> Explanation: The only three variable parts are the drop-down menu name ("Planning"), the option name ("New Task") and the argument of iconURL. |
Example: <menu name="Planning"> <menuItem text="New" iconUrl="do.ashx?Cmd=Icon&Name=tlb_NewForm&Size=16&Default=t"> <menuItem text="Task" iconUrl="do.ashx?Cmd=Icon&Name=t_task&Size=16&Default=t" navigateUrl="javascript:this.menuWebPart.showDialog('WFForm.aspx?wf=newTask&autoCloseMode\=2' ,null,870,650);" /> <menuItem text="Task copy" iconUrl="do.ashx?Cmd=Icon&Name=t_task&Size=16&Default=t" navigateUrl="javascript:this.menuWebPart.showDialog('WFForm.aspx?wf=newTask&autoCloseMode\=2&Ids='+this.menuWebPart.selectedIdList() ,null,820,650);" enable="One" /> <menuItem text="Upload iCalendar files" iconUrl="do.ashx?Cmd=Icon&Name=tlb_upload&Size=16" navigateUrl="javascript:this.menuWebPart.showDialog('WFForm.aspx?wf=uploadICal&pars=type:task',null,600,400);"/> </menuItem> Explanation: A nested menu is simply added as a <MenuItem text="AAAA"> that has no navigateUrl property, and where AAAA is the name of the option. |
See also
If a modified menu command / shortcut key do not function