By default, navigators do not 'remember' the last used values between sessions, but restart with empty fields.
There's a mechanism to load and save last used values for certain navigator fields (but not for all). You have to script it in add-ins, individually for each navigator and each main tab.
In this topic you can find examples of how that is achieved for title, edition, and object library on the navigators of the Pages main tab.
You have to provide for loading of last used values in scripting, individually for each navigator. In the below examples, we load the last values on Fred4 startup (example OnInitialize), but also when you open the Pages main tab (example AddPagesTabItem), if you closed it in the mean time.
|
Last used values are saved indirectly, thus not on selecting the value in the navigator, but on doing some action on it. For example, if you open a page of the specified edition, the title and edition are stored in SystemUserOptions.F_LastTitle and SystemUserOptions.F_LastEdition. This means you cannot save, for example, the last selected folder, as it does not perform any other action than just to display results. Public Overridable Sub OnPageOpen() Implements IFredEvent.OnPageOpen If (Page IsNot Nothing) Then Dim window As IShellWindow = DirectCast(Main.Window, IShellWindow)
If Fred.GetWindowType = 1 Then ' do this only for pages - not for masters or libraries ' synchronize title and edition with the current page window.SetElementOnSearch("title", Page.GetPageEdition.titleRefAttr) window.SetElementOnSearch("edition", Page.GetPageEdition.idAttr) SystemUserOptions.F_LastTitle = Page.GetPageEdition.titleRefAttr SystemUserOptions.F_LastEdition = Page.GetPageEdition.idAttr For other type of values, e.g. last used object library, this is achieved in OnDrop method in Page.vb: ElseIf selectedObject.IsKindOf("libObj") Then Page.AddLibObjId(selectedObject.Id, 0, 0, 6) SystemUserOptions.F_LastObjLib = UtilsBase.GetObjAttrValue(selectedObject.Id, "libRef") |