The control regarding which tab is / can be displayed in which application (also for tabs defined through inheritance) is achieved through menu commands and activation add-ins scripts. Besides this, note that Pages, Editions and Tracking main tabs can be displayed only in Fred4.
MainTabPopup
In the <Menuset Name="Global"> in Ted4_TabItems.xml and Fred4_TabItems.xml, there are menu commands to load main tabs, that call the scripts, listed under CommandParameter. If you want to make some main tabs inaccessible to all users, remove them from the menu. Should you want to make them forbidden for some users, and available for others, set the permissions on the scripts. See also the notes related to the Start main tab.
<ContextMenu Name="MainTabPopup"> <l:ShellMenuItem Header="_Pages" Tag="#1111.gif" CommandParameter="AddPagesTabItem"/> <l:ShellMenuItem Header="_Editions" Tag="#nu4.gif" CommandParameter="AddEditionsTabItem"/> <l:ShellMenuItem Header="_Tracking" Tag="#office1244.gif" CommandParameter="AddTracyTabItem"/> <l:ShellMenuItem Header="_Articles" Tag="#1112.gif" CommandParameter="AddArticlesTabItem"/> <l:ShellMenuItem Header="_Shell" Tag="#bitmap42.gif" CommandParameter="AddShellMainTab"/> <l:ShellMenuItem Header="_Publishing" Tag="#office1154.gif" CommandParameter="AddPublishingTabItem"/> <l:ShellMenuItem Header="C_ontacts" Tag="#nu38.gif" CommandParameter="AddContactsTabItem"/> <l:ShellMenuItem Header="_Planning" CommandParameter="AddPlanningMainTab"/> <l:ShellMenuItem Header="_Collections" CommandParameter="AddCollectionsMainTab"/> <l:ShellMenuItem Header="_Start" Tag="#office0486.gif" CommandParameter="AddStartTabItem"/> <Separator/> <l:ShellMenuItem Header="_Close Current Tab" Tag="#office0131.gif" CommandParameter="CloseTab"/> <l:ShellMenuItem Header="Edit Tab _Name" CommandParameter="EditMainTabHeader"/> </ContextMenu> |
Start main tab
Under <l:ShellTabItem x:Name="StartMainTab" in Ted4_TabItems.xml and Fred4_TabItems.xml, there's a list of main tabs. If you want to make some main tabs inaccessible to all users, remove them from the list. Should you want to make them forbidden for some users, and available for others, set the permissions on the scripts.
See also the notes related to the MainTabPopup.
Opening some main tabs by default
If you want some main tabs to be opened by default in a given GN4 application, you can call them in the OnInitialize scripts in the given xxx.vb file, where xxx is Fred4, Ted4 or Shell.
If no workspace is loaded on startup, this script automatically loads the Pages main tab. Protected Overrides Sub OnInitialize(ByVal isStartUp As Boolean) MyBase.OnInitialize(isStartUp)
m_Fred4 = DirectCast(DirectCast(ShellWindow.App, ILegacyShellApp).LegacyApp, IFredApp)
If isStartUp Then If Not App.DesktopManager.LoadOnStartup(ShellWindow, True) Then ' add Pages main tab Tabs.AddTab("Fred4Pages") Tabs.SelectedTabIndex = 0 Dim selTab As TabItem = Tabs.SelectedTab selTab.Focus()
' show default Pages toolbars: It is an user preference on the Startup subtab of Extra tab (Edit > Preferences) If Not SystemUserOptions.fr_NoDefToolbars Then ShowDefToolbarsPages() End If
'If Not App.DesktopManager.LoadOnStartup(ShellWindow, True) Then 'Tabs.AddTab("Fred4Editions") 'Tabs.SelectedTabIndex = 1 'selTab = Tabs.SelectedTab 'Tabs.SelectedTab.ToggleToolBar(MainToolBar.MainEdt, "Main", "Top", 1)
'' select Pages as the default tab and put it in focus 'Tabs.SelectedTabIndex = 0 'selTab = Tabs.SelectedTab 'selTab.Focus()
ShellWindow.Window.Show() ' Which window size? It is an user preference on the Startup subtab of Extra tab (Edit > Preferences) If SystemUserOptions.fr_NoMaximize Then ShellWindow.Window.WindowState = Windows.WindowState.Normal ' put window to normal Else ShellWindow.Window.WindowState = Windows.WindowState.Maximized ' put window to maximized End If End If ' crop or fit if the image is smaller that the object being replaced - default turned off temporarily on 3-Mar-2011 by BrunoS If SystemUserOptions.F_ImgProcFitAllways Then Fred.AppSetImgProcessing(IFredApp.eLoadCrop.lcFit) End If
Dim tmp As IShellWindow = ShellWindow If (tmp IsNot Nothing) Then tmp.SetElementOnSearch("title", Fred.GetCurrentTitleId) If SystemUserOptions.F_LastEdition <> 0 Then tmp.SetElementOnSearch("edition", SystemUserOptions.F_LastEdition) End If End If End Sub |
If no workspace is loaded on startup, this script automatically loads the Articles main tab. Protected Overrides Sub OnInitialize(ByVal isStartUp As Boolean) m_Ted4 = DirectCast(DirectCast(ShellWindow.App, ILegacyShellApp).LegacyApp, ITedApp)
If (Not App.IsFred) And isStartUp Then If Not App.DesktopManager.LoadOnStartup(ShellWindow, True) Then Tabs.AddTab("Ted4Articles") Tabs.SelectedTabIndex = 0 Dim selTab As TabItem = Tabs.SelectedTab selTab.Focus() ShellWindow.Window.WindowState = Windows.WindowState.Normal ShellWindow.Window.Show() ' Which window size? It is an user preference on the Startup subtab of Extra tab (Edit > Preferences) If SystemUserOptions.te_NoMaximize Then ShellWindow.Window.WindowState = Windows.WindowState.Normal ' put window to normal Else ShellWindow.Window.WindowState = Windows.WindowState.Maximized ' put window to maximized End If ' show default toolbars: It is an user preference on the Startup subtab of Extra tab (Edit > Preferences) If Not SystemUserOptions.te_NoDefToolbars Then ShowDefToolbarsArticles() End If ' nothing can be done with palettes here as they're available only when page is opened - look at OnOpenArticle in Article.vb. End If End If End Sub |