Custom Start Page

Discussions related to SoftPro Select user interface development.

Moderator: Phil Barton

Post Reply
MattW
Posts: 46
Joined: Tue May 26, 2015 5:17 pm

Custom Start Page

Post by MattW »

We have built a custom start page using the Editor Factory to replace the default. For the most part it work correctly with new page being a WinForm control rather than a webpage as the default was.
The Select.exe config file is setup to point at our custom page.
The issue is, although the custom page loads successfully, it loads as a second tab leaving the original tab there. But now this original tab no longer points to the default page due to changing the config file and so loads blank with a header titled "Navigation Canceled".

Our current approach from removing the default tab works only intermittently, is there a better way to prevent that default tab from ever even appearing in the first place?
Additionally, since adding this custom page occasionally (generally on the first time Select is launched since logging in/restarting computer) it will launch IE with an empty page. Nothing in our code explicitly calls a browser or webpage, so i assume this would be configuration issue(maybe related to the old start page tab?) and would like to know what solutions there are to stop this behavior.

Below is our CustomEditorPane that inherits from EditorPane to create the custom startpage and remove the old tab:

Code: Select all

class CustomEditorPane : EditorPane
    {
        public CustomEditorPane()
        {}
        protected override Control OnCreateControl()
        {
                                   

            var shell = GetService<IShell>();
            var sps = GetService<SoftPro.Select.Client.SelectServer>();

            var editorControl = new WorkBench(shell, sps);
            editorControl.Disposed += (sender, args) => ClearOldStartPage(); 

            Title = editorControl.Title;
            ClearOldStartPage();

            return editorControl;
        }
        private void ClearOldStartPage()
        {
            var wm = GetService<IWindowManager>();
            foreach (var doc in wm.Windows.Where(x => x.Created && x.Situation == WindowSituation.Document && x.Caption == "Navigation Canceled"))
                doc.Close();
        }
    }

Code: Select all

class CustomEditorFactory : EditorFactory
    {
        public CustomEditorFactory(IServiceProvider sp)
            : base(sp)
        {}
        protected override IWindowPane OnCreateEditor(ref Uri moniker, ref string name, string view, object existingData, EditorCreateFlags flags, out object data, out Guid commandUI, ref bool mru)
        {            
            data = null;
            commandUI = new Guid("92A6C769-6AC0-4A87-97CB-96DAE703D4FC");
            IWindowPane pane = null;
            pane = new CustomEditorPane();
            name = pane.Title;
            data = pane;
            return pane;
        }
    }
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Custom Start Page

Post by BobRichards »

We had tried to introduce a way for third parties to provide replacement Start screens. The package would use a registration attribute to place specific tokens in the Select Editors registry area. Unfortunately, there is a bug in this area and you cannot do it at this time. I have submitted a bug report to fix this. Sorry.
Bob Richards, Senior Software Developer, SoftPro
chris.brady
Posts: 105
Joined: Wed Oct 17, 2012 4:20 pm

Re: Custom Start Page

Post by chris.brady »

Has this bug been fixed in the latest release (4.1)? If so, can you provide an example for how to implement this registration attribute?
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Custom Start Page

Post by BobRichards »

Yes. See the Select 4.1 SDK topic How-To/Modify the Start Page/Replace Start Page with Tool Window.
Bob Richards, Senior Software Developer, SoftPro
Post Reply