Esempio n. 1
0
        public override void Init()
        {
            DBBaseName = "LedgerGrid";

            dataGridViewLedger.MakeDoubleBuffered();
            dataGridViewLedger.DefaultCellStyle.WrapMode = DataGridViewTriState.False;

            var    jes      = EliteDangerousCore.JournalEntry.GetNameImageOfEvents(new string[] { "Ledger" });
            string cashtype = string.Join(";", jes.Select(x => x.Item1)) + ";";

            cfs = new FilterSelector();
            cfs.AddAllNone();
            cfs.AddGroupOption(cashtype, "Cash Transactions".T(EDTx.UserControlLedger_CashTransactions), JournalEntry.JournalTypeIcons[JournalTypeEnum.Bounty]);
            cfs.AddJournalEntries(new string[] { "Ledger", "LedgerNC" });
            cfs.SaveSettings += EventFilterChanged;

            discoveryform.OnHistoryChange += Redisplay;
            discoveryform.OnNewEntry      += NewEntry;

            BaseUtils.Translator.Instance.Translate(this);
            BaseUtils.Translator.Instance.Translate(contextMenuStrip, this);
            BaseUtils.Translator.Instance.Translate(toolTip, this);

            TravelHistoryFilter.InitaliseComboBox(comboBoxHistoryWindow, GetSetting(dbHistorySave, ""), incldockstartend: false);
        }
        public override void Init()
        {
            dataGridViewJournal.MakeDoubleBuffered();
            dataGridViewJournal.DefaultCellStyle.WrapMode = DataGridViewTriState.True;
            dataGridViewJournal.AutoSizeRowsMode          = DataGridViewAutoSizeRowsMode.DisplayedCells; // NEW! appears to work https://msdn.microsoft.com/en-us/library/74b2wakt(v=vs.110).aspx

            cfs = new FilterSelector(DbFilterSave);
            cfs.AddAllNone();
            cfs.AddJournalExtraOptions();
            cfs.AddJournalEntries();
            cfs.SaveSettings += EventFilterChanged;

            checkBoxCursorToTop.Checked = true;

            string filter = EliteDangerousCore.DB.UserDatabase.Instance.GetSettingString(DbFieldFilter, "");

            if (filter.Length > 0)
            {
                fieldfilter.FromJSON(filter);        // load filter
            }
            searchtimer = new Timer()
            {
                Interval = 500
            };
            searchtimer.Tick += Searchtimer_Tick;

            todotimer = new Timer()
            {
                Interval = 10
            };
            todotimer.Tick += Todotimer_Tick;

            discoveryform.OnHistoryChange += Display;
            discoveryform.OnNewEntry      += AddNewEntry;

            BaseUtils.Translator.Instance.Translate(this);
            BaseUtils.Translator.Instance.Translate(historyContextMenu, this);
            BaseUtils.Translator.Instance.Translate(toolTip, this);

            TravelHistoryFilter.InitaliseComboBox(comboBoxJournalWindow, DbHistorySave);

            dataViewScrollerPanel.LimitLargeChange = 4; // since row sizes can be variable, estimating large change on visible rows is problematic
        }
Esempio n. 3
0
        public override void Init()
        {
            DBBaseName = "JournalGrid";

            dataGridViewJournal.MakeDoubleBuffered();
            dataGridViewJournal.DefaultCellStyle.WrapMode = DataGridViewTriState.True;
            dataGridViewJournal.AutoSizeRowsMode          = DataGridViewAutoSizeRowsMode.DisplayedCells; // NEW! appears to work https://msdn.microsoft.com/en-us/library/74b2wakt(v=vs.110).aspx

            cfs = new FilterSelector();
            cfs.AddAllNone();
            cfs.AddJournalExtraOptions();
            cfs.AddJournalEntries();
            cfs.SaveSettings += EventFilterChanged;

            checkBoxCursorToTop.Checked = true;

            string filter = GetSetting(dbFieldFilter, "");

            if (filter.Length > 0)
            {
                fieldfilter.FromJSON(filter);        // load filter
            }
            searchtimer = new Timer()
            {
                Interval = 500
            };
            searchtimer.Tick += Searchtimer_Tick;

            todotimer = new Timer()
            {
                Interval = 10
            };
            todotimer.Tick += Todotimer_Tick;

            discoveryform.OnHistoryChange += HistoryChanged;
            discoveryform.OnNewEntry      += AddNewEntry;

            BaseUtils.Translator.Instance.Translate(this);
            BaseUtils.Translator.Instance.Translate(historyContextMenu, this);
            BaseUtils.Translator.Instance.Translate(toolTip, this);

            TravelHistoryFilter.InitaliseComboBox(comboBoxTime, GetSetting(dbHistorySave, ""));
        }
        public override void Init()
        {
            dataGridViewJournal.MakeDoubleBuffered();
            dataGridViewJournal.DefaultCellStyle.WrapMode = DataGridViewTriState.True;
            dataGridViewJournal.RowTemplate.Height        = 26;
            dataGridViewJournal.AutoSizeRowsMode          = DataGridViewAutoSizeRowsMode.DisplayedCells; // NEW! appears to work https://msdn.microsoft.com/en-us/library/74b2wakt(v=vs.110).aspx

            cfs = new FilterSelector(DbFilterSave);
            cfs.AddJournalExtraOptions();
            cfs.AddJournalEntries();
            cfs.Changed += EventFilterChanged;
            TravelHistoryFilter.InitaliseComboBox(comboBoxJournalWindow, DbHistorySave);

            checkBoxMoveToTop.Checked = SQLiteConnectionUser.GetSettingBool(DbAutoTop, true);

            string filter = SQLiteDBClass.GetSettingString(DbFieldFilter, "");

            if (filter.Length > 0)
            {
                fieldfilter.FromJSON(filter);        // load filter
            }
            searchtimer = new Timer()
            {
                Interval = 500
            };
            searchtimer.Tick += Searchtimer_Tick;

            todotimer = new Timer()
            {
                Interval = 10
            };
            todotimer.Tick += Todotimer_Tick;

            discoveryform.OnHistoryChange += Display;
            discoveryform.OnNewEntry      += AddNewEntry;

            BaseUtils.Translator.Instance.Translate(this);
            BaseUtils.Translator.Instance.Translate(historyContextMenu, this);
            BaseUtils.Translator.Instance.Translate(toolTip, this);
        }
Esempio n. 5
0
        public override void Init()
        {
            dataGridViewLedger.MakeDoubleBuffered();
            dataGridViewLedger.DefaultCellStyle.WrapMode = DataGridViewTriState.False;
            dataGridViewLedger.RowTemplate.Height        = 26;

            var    jes      = EliteDangerousCore.JournalEntry.GetListOfEventsWithOptMethodSortedImage(true, new string[] { "Ledger" });
            string cashtype = string.Join(";", jes.Select(x => x.Item1)) + ";";

            cfs = new FilterSelector(DbFilterSave);
            cfs.AddGroupOption("Cash Transactions".Tx(this), cashtype, JournalEntry.JournalTypeIcons[JournalTypeEnum.Bounty]);
            cfs.AddJournalEntries(new string[] { "Ledger", "LedgerNC" });
            cfs.Changed += EventFilterChanged;

            TravelHistoryFilter.InitaliseComboBox(comboBoxHistoryWindow, DbHistorySave, incldockstartend: false);

            discoveryform.OnHistoryChange += Redisplay;
            discoveryform.OnNewEntry      += NewEntry;

            BaseUtils.Translator.Instance.Translate(this);
            BaseUtils.Translator.Instance.Translate(contextMenuStrip, this);
            BaseUtils.Translator.Instance.Translate(toolTip, this);
        }
        public override void Init()
        {
            DBBaseName = materials ? "MaterialsGrid" : "CommoditiesGrid";

            dataGridViewMC.MakeDoubleBuffered();
            extCheckBoxWordWrap.Checked = GetSetting(dbWrapText, false);
            UpdateWordWrap();
            extCheckBoxWordWrap.Click += extCheckBoxWordWrap_Click;

            BaseUtils.Translator.Instance.Translate(this);
            BaseUtils.Translator.Instance.Translate(toolTip, this);

            cfs = new FilterSelector();
            cfs.AddAllNone();

            MaterialCommodityData[] items;
            Tuple <MaterialCommodityData.ItemType, string>[] types;

            if (materials)
            {
                dataGridViewMC.Columns[5].HeaderText = "Recipes".T(EDTx.UserControlMaterialCommodities_Recipes);
                labelItems1.Text = "Data".T(EDTx.UserControlMaterialCommodities_Data);
                labelItems2.Text = "Mats".T(EDTx.UserControlMaterialCommodities_Mats);

                items = MaterialCommodityData.GetMaterials(true);
                types = MaterialCommodityData.GetTypes((x) => !x.IsCommodity, true);

                var cats = MaterialCommodityData.GetCategories((x) => !x.IsCommodity, true);

                foreach (var t in cats)
                {
                    string[] members = MaterialCommodityData.GetFDNameMembersOfCategory(t.Item1, true);
                    cfs.AddGroupOption(String.Join(";", members) + ";", t.Item2);
                }
            }
            else
            {
                dataGridViewMC.Columns.Remove(dataGridViewMC.Columns[1]); //remove cat

                DataGridViewColumn c = dataGridViewMC.Columns[1];         // reassign column 1 to end and call recipes
                c.HeaderText   = "Recipes".T(EDTx.UserControlMaterialCommodities_Recipes);
                c.DisplayIndex = 4;                                       // need to change its display pos
                dataGridViewMC.Columns.Remove(c);                         // and to place it at the end otherwise it does not fill in the right order
                dataGridViewMC.Columns.Add(c);

                labelItems1.Text           = "Total".T(EDTx.UserControlMaterialCommodities_Total);
                textBoxItems2.Visible      = labelItems2.Visible = false;
                checkBoxShowZeros.Location = new Point(textBoxItems1.Right + 8, checkBoxShowZeros.Top);

                items = MaterialCommodityData.GetCommodities(true);
                types = MaterialCommodityData.GetTypes((x) => x.IsCommodity, true);

                MaterialCommodityData[] rare = items.Where(x => x.IsRareCommodity).ToArray();
                cfs.AddGroupOption(String.Join(";", rare.Select(x => x.FDName).ToArray()) + ";", "Rare".T(EDTx.UserControlMaterialCommodities_Rare));
            }

            foreach (var t in types)
            {
                string[] members = MaterialCommodityData.GetFDNameMembersOfType(t.Item1, true);
                cfs.AddGroupOption(String.Join(";", members) + ";", t.Item2);
            }

            foreach (var x in items)
            {
                cfs.AddStandardOption(x.FDName, x.Name);
            }

            checkBoxShowZeros.Checked         = !GetSetting(dbClearZero, true); // used to be clear zeros, now its show zeros, invert
            checkBoxShowZeros.CheckedChanged += CheckBoxClear_CheckedChanged;

            cfs.SaveSettings += FilterChanged;
        }
        public override void Init()
        {
            dataGridViewMC.MakeDoubleBuffered();
            dataGridViewMC.DefaultCellStyle.WrapMode = DataGridViewTriState.False;
            dataGridViewMC.RowTemplate.Height        = 26;

            BaseUtils.Translator.Instance.Translate(this);
            BaseUtils.Translator.Instance.Translate(toolTip, this);

            cfs = new FilterSelector(DbFilterSave);

            MaterialCommodityData[] items;
            string[] types;

            if (materials)
            {
                dataGridViewMC.Columns.Remove(dataGridViewMC.Columns[5]);       // to give name,shortname abv,category,type,number
                labelItems1.Text = "Data".Tx(this);
                labelItems2.Text = "Mats".Tx(this);

                items = MaterialCommodityData.GetMaterials(true);
                types = MaterialCommodityData.GetTypes((x) => !x.IsCommodity, true);

                MaterialCommodityData[] raw = items.Where(x => x.IsRaw).ToArray();
                cfs.AddGroupOption(String.Join(";", raw.Select(x => x.FDName).ToArray()) + ";", "Raw");
                MaterialCommodityData[] enc = items.Where(x => x.IsEncoded).ToArray();
                cfs.AddGroupOption(String.Join(";", enc.Select(x => x.FDName).ToArray()) + ";", "Encoded");
                MaterialCommodityData[] manu = items.Where(x => x.IsManufactured).ToArray();
                cfs.AddGroupOption(String.Join(";", manu.Select(x => x.FDName).ToArray()) + ";", "Manufactured");
            }
            else
            {
                dataGridViewMC.Columns.Remove(dataGridViewMC.Columns[1]);       //shortname
                dataGridViewMC.Columns.Remove(dataGridViewMC.Columns[1]);       //then category to give name,type,number, avg price
                labelItems1.Text       = "Total".Tx(this);
                textBoxItems2.Visible  = labelItems2.Visible = false;
                checkBoxClear.Location = new Point(textBoxItems1.Right + 8, checkBoxClear.Top);

                items = MaterialCommodityData.GetCommodities(true);
                types = MaterialCommodityData.GetTypes((x) => x.IsCommodity, true);

                MaterialCommodityData[] rare = items.Where(x => x.IsRareCommodity).ToArray();
                cfs.AddGroupOption(String.Join(";", rare.Select(x => x.FDName).ToArray()) + ";", "Rare");
            }

            foreach (string t in types)
            {
                string[] members = MaterialCommodityData.GetFDNameMembersOfType(t, true);
                cfs.AddGroupOption(String.Join(";", members) + ";", t);
            }

            foreach (var x in items)
            {
                cfs.AddStandardOption(x.FDName, x.Name);
            }

            checkBoxClear.Checked         = EliteDangerousCore.DB.SQLiteDBClass.GetSettingBool(DbClearZeroSave, true);
            checkBoxClear.CheckedChanged += CheckBoxClear_CheckedChanged;

            cfs.Closing += FilterChanged;
        }
        public override void Init()
        {
            dataGridViewMC.MakeDoubleBuffered();
            dataGridViewMC.DefaultCellStyle.WrapMode = DataGridViewTriState.False;

            BaseUtils.Translator.Instance.Translate(this);
            BaseUtils.Translator.Instance.Translate(toolTip, this);

            cfs = new FilterSelector(DbFilterSave);

            MaterialCommodityData[]  items;
            Tuple <string, string>[] types;

            cfs.AddAllNone();

            if (materials)
            {
                dataGridViewMC.Columns.Remove(dataGridViewMC.Columns[5]);       // to give name,shortname abv,category,type,number
                labelItems1.Text = "Data".T(EDTx.UserControlMaterialCommodities_Data);
                labelItems2.Text = "Mats".T(EDTx.UserControlMaterialCommodities_Mats);

                items = MaterialCommodityData.GetMaterials(true);
                types = MaterialCommodityData.GetTypes((x) => !x.IsCommodity, true);

                Tuple <string, string>[] cats = MaterialCommodityData.GetCategories((x) => !x.IsCommodity, true);

                foreach (var t in cats)
                {
                    string[] members = MaterialCommodityData.GetFDNameMembersOfCategory(t.Item1, true);
                    cfs.AddGroupOption(String.Join(";", members) + ";", t.Item2);
                }
            }
            else
            {
                dataGridViewMC.Columns.Remove(dataGridViewMC.Columns[1]);       //shortname
                dataGridViewMC.Columns.Remove(dataGridViewMC.Columns[1]);       //then category to give name,type,number, avg price
                labelItems1.Text       = "Total".T(EDTx.UserControlMaterialCommodities_Total);
                textBoxItems2.Visible  = labelItems2.Visible = false;
                checkBoxClear.Location = new Point(textBoxItems1.Right + 8, checkBoxClear.Top);

                items = MaterialCommodityData.GetCommodities(true);
                types = MaterialCommodityData.GetTypes((x) => x.IsCommodity, true);

                MaterialCommodityData[] rare = items.Where(x => x.IsRareCommodity).ToArray();
                cfs.AddGroupOption(String.Join(";", rare.Select(x => x.FDName).ToArray()) + ";", "Rare".T(EDTx.UserControlMaterialCommodities_Rare));
            }

            foreach (var t in types)
            {
                string[] members = MaterialCommodityData.GetFDNameMembersOfType(t.Item1, true);
                cfs.AddGroupOption(String.Join(";", members) + ";", t.Item2);
            }

            foreach (var x in items)
            {
                cfs.AddStandardOption(x.FDName, x.Name);
            }

            checkBoxClear.Checked         = EliteDangerousCore.DB.SQLiteDBClass.GetSettingBool(DbClearZeroSave, true);
            checkBoxClear.CheckedChanged += CheckBoxClear_CheckedChanged;

            cfs.SaveSettings += FilterChanged;
        }
Esempio n. 9
0
        public override void Init()
        {
            DBBaseName = "SPanel";

            config = (long)(GetSetting("Config", (int)config)) | ((long)(GetSetting("ConfigH", (int)(config >> 32))) << 32);
            toolStripMenuItemTargetLine.Checked                  = Config(Configuration.showTargetLine);
            toolStripMenuItemTime.Checked                        = Config(Configuration.showTime);
            EDSMButtonToolStripMenuItem.Checked                  = Config(Configuration.showEDSMButton);
            iconToolStripMenuItem.Checked                        = Config(Configuration.showIcon);
            showTargetToolStripMenuItem.Checked                  = Config(Configuration.showDistancePerStar);
            showNotesToolStripMenuItem.Checked                   = Config(Configuration.showNotes);
            showXYZToolStripMenuItem.Checked                     = Config(Configuration.showXYZ);
            showDescriptionToolStripMenuItem.Checked             = Config(Configuration.showDescription);
            showInformationToolStripMenuItem.Checked             = Config(Configuration.showInformation);
            blackBoxAroundTextToolStripMenuItem.Checked          = Config(Configuration.showBlackBoxAroundText);
            showDistancesOnFSDJumpsOnlyToolStripMenuItem.Checked = Config(Configuration.showDistancesOnFSDJumpsOnly);
            expandTextOverEmptyColumnsToolStripMenuItem.Checked  = Config(Configuration.showExpandOverColumns);
            showNothingWhenDockedtoolStripMenuItem.Checked       = Config(Configuration.showNothingWhenDocked);
            showSystemInformationToolStripMenuItem.Checked       = Config(Configuration.showSystemInformation);
            showCircumstellarZonesToolStripMenuItem.Checked      = Config(Configuration.showHabInformation);
            showMetalRichPlanetsToolStripMenuItem.Checked        = Config(Configuration.showMetalRichZone);
            showWaterWorldsToolStripMenuItem.Checked             = Config(Configuration.showWaterWrldZone);
            showEarthLikeToolStripMenuItem.Checked               = Config(Configuration.showEarthLikeZone);
            showAmmoniaWorldsToolStripMenuItem.Checked           = Config(Configuration.showAmmonWrldZone);
            showIcyPlanetsToolStripMenuItem.Checked              = Config(Configuration.showIcyPlanetZone);
            dontshowwhenInPanelToolStripMenuItem.Checked         = Config(Configuration.showNothingWhenPanel);
            completelyHideThePanelToolStripMenuItem.Checked      = Config(Configuration.showNoTitleWhenHidden);

            SetSurfaceScanBehaviour(null);
            SetScanPosition(null);
            SetLayoutOrder(GetSetting("Layout", layoutorder), false);  // also resets the tab order

            scanhide.Tick += HideScanData;

            dividercheck.Tick    += DividerCheck;
            dividercheck.Interval = 500;

            string tabs = GetSetting("PanelTabs", "");

            if (tabs.HasChars())
            {
                try
                {
                    List <int> tablist = tabs.Split(',').Select(int.Parse).ToList();

                    for (int i = 0; i < tablist.Count && i < columnpos.Count; i++)      // for what we have, and not more than pre-populated, fill
                    {
                        columnpos[i] = tablist[i];
                    }
                }
                catch { }
            }

            displayfont = discoveryform.theme.GetFont;

            pictureBox.ContextMenuStrip = contextMenuStrip;

            string filter = GetSetting(dbFieldFilter, "");

            if (filter.Length > 0)
            {
                fieldfilter.FromJSON(filter);        // load filter
            }
            cfs = new FilterSelector();
            cfs.AddAllNone();
            cfs.AddJournalExtraOptions();
            cfs.AddJournalEntries();
            cfs.SaveSettings += EventFilterChanged;

            dividers = new ExtButton[] { buttonExt0, buttonExt1, buttonExt2, buttonExt3, buttonExt4, buttonExt5, buttonExt6, buttonExt7, buttonExt8, buttonExt9, buttonExt10, buttonExt11, buttonExt12 };

            discoveryform.OnHistoryChange += Display;
            discoveryform.OnNewEntry      += NewEntry;
            discoveryform.OnNewTarget     += NewTarget;
            discoveryform.OnNewUIEvent    += OnNewUIEvent;

            BaseUtils.Translator.Instance.Translate(this);
            BaseUtils.Translator.Instance.Translate(contextMenuStrip, this);
        }
Esempio n. 10
0
        public override void Init()
        {
            dataGridViewMC.MakeDoubleBuffered();

            BaseUtils.Translator.Instance.Translate(this);
            BaseUtils.Translator.Instance.Translate(toolTip, this);

            cfs = new FilterSelector(DbFilterSave);

            MaterialCommodityData[] items;
            Tuple <MaterialCommodityData.ItemType, string>[] types;

            cfs.AddAllNone();

            if (materials)
            {
                dataGridViewMC.Columns[5].HeaderText = "Recipes".T(EDTx.UserControlMaterialCommodities_Recipes);
                labelItems1.Text = "Data".T(EDTx.UserControlMaterialCommodities_Data);
                labelItems2.Text = "Mats".T(EDTx.UserControlMaterialCommodities_Mats);

                items = MaterialCommodityData.GetMaterials(true);
                types = MaterialCommodityData.GetTypes((x) => !x.IsCommodity, true);

                var cats = MaterialCommodityData.GetCategories((x) => !x.IsCommodity, true);

                foreach (var t in cats)
                {
                    string[] members = MaterialCommodityData.GetFDNameMembersOfCategory(t.Item1, true);
                    cfs.AddGroupOption(String.Join(";", members) + ";", t.Item2);
                }
            }
            else
            {
                dataGridViewMC.Columns.Remove(dataGridViewMC.Columns[1]); //remove cat

                DataGridViewColumn c = dataGridViewMC.Columns[1];         // reassign column 1 to end and call recipes
                c.HeaderText   = "Recipes".T(EDTx.UserControlMaterialCommodities_Recipes);
                c.DisplayIndex = 4;                                       // need to change its display pos
                dataGridViewMC.Columns.Remove(c);                         // and to place it at the end otherwise it does not fill in the right order
                dataGridViewMC.Columns.Add(c);

                labelItems1.Text       = "Total".T(EDTx.UserControlMaterialCommodities_Total);
                textBoxItems2.Visible  = labelItems2.Visible = false;
                checkBoxClear.Location = new Point(textBoxItems1.Right + 8, checkBoxClear.Top);

                items = MaterialCommodityData.GetCommodities(true);
                types = MaterialCommodityData.GetTypes((x) => x.IsCommodity, true);

                MaterialCommodityData[] rare = items.Where(x => x.IsRareCommodity).ToArray();
                cfs.AddGroupOption(String.Join(";", rare.Select(x => x.FDName).ToArray()) + ";", "Rare".T(EDTx.UserControlMaterialCommodities_Rare));
            }

            foreach (var t in types)
            {
                string[] members = MaterialCommodityData.GetFDNameMembersOfType(t.Item1, true);
                cfs.AddGroupOption(String.Join(";", members) + ";", t.Item2);
            }

            foreach (var x in items)
            {
                cfs.AddStandardOption(x.FDName, x.Name);
            }

            checkBoxClear.Checked         = EliteDangerousCore.DB.UserDatabase.Instance.GetSettingBool(DbClearZeroSave, true);
            checkBoxClear.CheckedChanged += CheckBoxClear_CheckedChanged;

            extCheckBoxTruncateText.Checked         = EliteDangerousCore.DB.UserDatabase.Instance.GetSettingBool(DbTruncateText, true);
            extCheckBoxTruncateText.CheckedChanged += TruncateText_CheckedChanged;

            dataGridViewMC.DefaultCellStyle.WrapMode = DataGridViewTriState.True;
            dataGridViewMC.AutoSizeRowsMode          = extCheckBoxTruncateText.Checked ? DataGridViewAutoSizeRowsMode.None : DataGridViewAutoSizeRowsMode.AllCells;

            cfs.SaveSettings += FilterChanged;
        }