Exemplo n.º 1
0
 public void CopyTextFrom( UserControlLog other )
 {
     richTextBox_History.CopyFrom(other.richTextBox_History);
 }
Exemplo n.º 2
0
 public void CopyTextFrom(UserControlLog other)
 {
     richTextBox_History.CopyFrom(other.richTextBox_History);
 }
Exemplo n.º 3
0
        public void PopOut(PopOuts selected)
        {
            UserControlForm tcf = usercontrolsforms.NewForm(_discoveryForm.option_nowindowreposition);
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(EDDiscovery.EDDiscoveryForm));
            tcf.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));

            if (selected == PopOuts.Log)
            {
                int numopened = usercontrolsforms.CountOf(typeof(UserControlLog)) + 1;

                UserControlLog uclog = new UserControlLog(); // Add a log
                tcf.Init(uclog, "Log " + ((numopened > 1) ? numopened.ToString() : ""), _discoveryForm.theme.WindowsFrame, "Log" + numopened, _discoveryForm.TopMost);
                uclog.Init(_discoveryForm, numopened);
                uclog.AppendText(_discoveryForm.LogText, _discoveryForm.theme.TextBackColor);
            }
            else if (selected == PopOuts.NS)
            {
                int numopened = usercontrolsforms.CountOf(typeof(UserControlStarDistance)) + 1;

                UserControlStarDistance ucsd = new UserControlStarDistance(); // Add a closest distance tab
                tcf.Init(ucsd, "Nearest Stars " + ((numopened > 1) ? numopened.ToString() : ""), _discoveryForm.theme.WindowsFrame,  "StarDistance" + numopened, _discoveryForm.TopMost);

                ucsd.Init(_discoveryForm, numopened);
                if (lastclosestsystems != null)           // if we have some, fill in this grid
                    ucsd.FillGrid(lastclosestname, lastclosestsystems);
            }
            else if (selected == PopOuts.Materials)
            {
                int numopened = usercontrolsforms.CountOf(typeof(UserControlMaterials)) + 1;

                UserControlMaterials ucmc = new UserControlMaterials(); // Add a closest distance tab
                tcf.Init(ucmc, "Materials " + ((numopened > 1) ? numopened.ToString() : ""), _discoveryForm.theme.WindowsFrame, "Materials" + numopened, _discoveryForm.TopMost);

                ucmc.Init(_discoveryForm, numopened);
                HistoryEntry curpos = userControlTravelGrid.GetCurrentHistoryEntry;
                if (curpos != null)
                    ucmc.Display(curpos.MaterialCommodity.Sort(false));
            }
            else if (selected == PopOuts.Commodities)
            {
                int numopened = usercontrolsforms.CountOf(typeof(UserControlCommodities)) + 1;

                UserControlCommodities ucmc = new UserControlCommodities(); // Add a closest distance tab
                tcf.Init(ucmc, "Commodities " + ((numopened > 1) ? numopened.ToString() : ""), _discoveryForm.theme.WindowsFrame, "Commodities" + numopened, _discoveryForm.TopMost);

                ucmc.Init(_discoveryForm, numopened);
                HistoryEntry curpos = userControlTravelGrid.GetCurrentHistoryEntry;
                if (curpos != null)
                    ucmc.Display(curpos.MaterialCommodity.Sort(true));
            }
            else if (selected == PopOuts.Ledger)
            {
                int numopened = usercontrolsforms.CountOf(typeof(UserControlLedger)) + 1;

                UserControlLedger ucmc = new UserControlLedger(); // Add a closest distance tab
                tcf.Init(ucmc, "Ledger " + ((numopened > 1) ? numopened.ToString() : ""), _discoveryForm.theme.WindowsFrame, "Ledger" + numopened, _discoveryForm.TopMost);

                ucmc.Init(_discoveryForm, numopened);
                ucmc.Display(_discoveryForm.history.materialcommodititiesledger);
                ucmc.OnGotoJID += GotoJID;
            }
            else if (selected == PopOuts.Journal)
            {
                int numopened = usercontrolsforms.CountOf(typeof(UserControlJournalGrid)) + 1;  // used to determine name and also key for DB
                UserControlJournalGrid uctg = new UserControlJournalGrid();
                tcf.Init(uctg, "Journal History " + ((numopened > 1) ? numopened.ToString() : ""), _discoveryForm.theme.WindowsFrame, "JournalHistory" + numopened, _discoveryForm.TopMost);
                uctg.Init(_discoveryForm, numopened);
                uctg.Display(_discoveryForm.history);
                uctg.NoPopOutIcon();
                uctg.NoHistoryIcon();
            }
            else if (selected == PopOuts.TravelGrid)    // match order in bitmap mp and comboBoxCustomPopOut
            {
                int numopened = usercontrolsforms.CountOf(typeof(UserControlTravelGrid)) + 1;  // used to determine name and also key for DB
                UserControlTravelGrid uctg = new UserControlTravelGrid();
                tcf.Init(uctg,"Travel History " + ((numopened > 1) ? numopened.ToString() : ""), _discoveryForm.theme.WindowsFrame, "TravelHistory" + numopened, _discoveryForm.TopMost);
                uctg.Init(_discoveryForm, numopened);
                uctg.Display(_discoveryForm.history);
                uctg.NoPopOutIcon();
                uctg.NoHistoryIcon();
            }
            else if (selected == PopOuts.ScreenShot)    // match order in bitmap mp and comboBoxCustomPopOut
            {
                int numopened = usercontrolsforms.CountOf(typeof(UserControlScreenshot)) + 1;  // used to determine name and also key for DB
                UserControlScreenshot ucm = new UserControlScreenshot();
                tcf.Init(ucm, "ScreenShot " + ((numopened > 1) ? numopened.ToString() : ""), _discoveryForm.theme.WindowsFrame, "ScreenShot" + numopened, _discoveryForm.TopMost);
                ucm.Init(_discoveryForm, numopened);
            }
            else if (selected == PopOuts.Statistics)    // match order in bitmap mp and comboBoxCustomPopOut
            {
                int numopened = usercontrolsforms.CountOf(typeof(UserControlStats)) + 1;  // used to determine name and also key for DB
                UserControlStats ucm = new UserControlStats();
                tcf.Init(ucm,"Statistics " + ((numopened > 1) ? numopened.ToString() : ""), _discoveryForm.theme.WindowsFrame, "Stats" + numopened, _discoveryForm.TopMost);
                ucm.Init(_discoveryForm, numopened);
                ucm.SelectionChanged(userControlTravelGrid.GetCurrentHistoryEntry, _discoveryForm.history);
            }
            else if (selected == PopOuts.Scan)
            {
                int numopened = usercontrolsforms.CountOf(typeof(UserControlScan)) + 1;  // used to determine name and also key for DB
                UserControlScan ucm = new UserControlScan();
                tcf.Init(ucm, "Scan " + ((numopened > 1) ? numopened.ToString() : ""), _discoveryForm.theme.WindowsFrame, "Scan" + numopened, _discoveryForm.TopMost);
                tcf.InitForTransparency(false, _discoveryForm.theme.LabelColor, _discoveryForm.theme.SPanelColor);
                ucm.Init(_discoveryForm, numopened);
            }
            else if (selected == PopOuts.Spanel2)
            {
                int numopened = usercontrolsforms.CountOf(typeof(UserControlSpanel)) + 1;  // used to determine name and also key for DB
                UserControlSpanel ucm = new UserControlSpanel();
                tcf.Init(ucm, "Summary Panel " + ((numopened > 1) ? numopened.ToString() : ""), _discoveryForm.theme.WindowsFrame, "Spanel" + numopened, true);
                tcf.InitForTransparency(true, _discoveryForm.theme.LabelColor, _discoveryForm.theme.SPanelColor);
                ucm.Init(_discoveryForm, numopened);
            }

            tcf.Show();

            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);

            if (selected == PopOuts.Spanel2)                            // need to theme, before draw, as it needs the theme colours set up
                ((UserControlSpanel)tcf.UserControl).Display(_discoveryForm.history);
            if (selected == PopOuts.Scan)                            // need to theme, before draw, as it needs the theme colours set up
                ((UserControlScan)tcf.UserControl).Display(userControlTravelGrid.GetCurrentHistoryEntry, _discoveryForm.history);
        }