Beispiel #1
0
        public UserControlCommonBase PopOut(PanelInformation.PanelIDs selected)
        {
            Forms.UserControlForm tcf = usercontrolsforms.NewForm();
            tcf.Icon = Properties.Resources.edlogo_3mo_icon;

            UserControlCommonBase ctrl = PanelInformation.Create(selected);

            PanelInformation.PanelInfo poi = PanelInformation.GetPanelInfoByPanelID(selected);

            if (ctrl != null && poi != null)
            {
                int    numopened   = usercontrolsforms.CountOf(ctrl.GetType()) + 1;
                string windowtitle = poi.WindowTitle + " " + ((numopened > 1) ? numopened.ToString() : "");
                string refname     = poi.WindowRefName + numopened.ToString();

                System.Diagnostics.Trace.WriteLine("PO:Make " + windowtitle + " ucf " + ctrl.GetType().Name);

                //System.Diagnostics.Debug.WriteLine("TCF init");
                tcf.Init(ctrl, windowtitle, discoveryform.theme.WindowsFrame, refname, discoveryform.TopMost,
                         poi.DefaultTransparent, discoveryform.theme.LabelColor, discoveryform.theme.SPanelColor);

                //System.Diagnostics.Debug.WriteLine("UCCB init of " + ctrl.GetType().Name);
                ctrl.Init(discoveryform, UserControls.UserControlCommonBase.DisplayNumberPopOuts + numopened - 1);

                //System.Diagnostics.Debug.WriteLine("Show");
                tcf.Show();                                                     // this ends up, via Form Shown, calls LoadLayout in the UCCB.

                if (tcf.UserControl != null)
                {
                    tcf.UserControl.Font = discoveryform.theme.GetFont;        // Important. Apply font autoscaling to the user control
                }
                // ApplyToForm does not apply the font to the actual UC, only
                // specific children controls.  The TabControl in the discoveryform ends up autoscaling most stuff
                // the children directly attached to the discoveryform are not autoscaled

                discoveryform.theme.ApplyToForm(tcf);

                discoveryform.ActionRun(Actions.ActionEventEDList.onPopUp, null, new BaseUtils.Variables(new string[] { "PopOutName", refname, "PopOutTitle", windowtitle, "PopOutIndex", numopened.ToString() }));
            }

            return(ctrl);
        }
        public void CloseTabList()
        {
            List <int> idlist = new List <int>();

            idlist.Add(SelectedIndex);   // first is current index

            string tabnames = "";

            foreach (TabPage p in TabPages)      // all main tabs, load/display
            {
                UserControls.UserControlCommonBase uccb = p.Controls[0] as UserControls.UserControlCommonBase;
                uccb.Closing();
                PanelInformation.PanelInfo pi = PanelInformation.GetPanelInfoByType(uccb.GetType());
                idlist.Add(pi != null ? (int)pi.PopoutID : -1);
                idlist.Add(uccb.displaynumber);
                tabnames += p.Text + ";";
            }

            SQLiteConnectionUser.PutSettingString("MajorTabControlList", string.Join(",", idlist));
            SQLiteConnectionUser.PutSettingString("MajorTabControlName", tabnames);
        }
Beispiel #3
0
        internal void LoadSavedPopouts()
        {
            foreach (PanelInformation.PanelIDs p in Enum.GetValues(typeof(PanelInformation.PanelIDs)))        // in terms of PanelInformation.PopOuts Enum
            {
                int numtoopen = SQLiteConnectionUser.GetSettingInt(EDDProfiles.Instance.UserControlsPrefix + "SavedPanelInformation.PopOuts:" + p.ToString(), 0);
                PanelInformation.PanelInfo pi = PanelInformation.GetPanelInfoByPanelID(p);

                //System.Diagnostics.Debug.WriteLine("Load panel type " + paneltype.Name + " " + p.ToString() + " " + numtoopen);

                if (pi != null && numtoopen > 0) // paranoia on first..
                {
                    int numopened = usercontrolsforms.CountOf(pi.PopoutType);
                    if (numopened < numtoopen)
                    {
                        for (int i = numopened + 1; i <= numtoopen; i++)
                        {
                            PopOut(p);
                        }
                    }
                }
            }
        }
Beispiel #4
0
        public void CloseTabList()
        {
            List <int> idlist = new List <int>();

            idlist.Add(SelectedIndex);   // first is current index

            string tabnames = "";

            UserControls.UserControlContainerSplitter primary = PrimaryTab;

            foreach (TabPage p in TabPages)      // all main tabs, load/display
            {
                UserControls.UserControlCommonBase uccb = p.Controls[0] as UserControls.UserControlCommonBase;
                uccb.CloseDown();
                PanelInformation.PanelInfo pi = PanelInformation.GetPanelInfoByType(uccb.GetType());
                idlist.Add(Object.ReferenceEquals(uccb, primary) ? -1 : (int)pi.PopoutID);      // primary is marked -1
                idlist.Add(uccb.displaynumber);
                tabnames += p.Text + ";";
            }

            EliteDangerousCore.DB.UserDatabase.Instance.PutSettingString(EDDProfiles.Instance.UserControlsPrefix + "MajorTabControlList", string.Join(",", idlist));
            EliteDangerousCore.DB.UserDatabase.Instance.PutSettingString(EDDProfiles.Instance.UserControlsPrefix + "MajorTabControlName", tabnames);
        }