public void HistoryChanged(HistoryList hl) // on History change { if (hl == null) // just for safety { return; } Tuple <long, int> pos = CurrentGridPosByJID(); current_historylist = hl; rowsbyjournalid.Clear(); systemsentered.Clear(); dataGridViewStarList.Rows.Clear(); var filter = (TravelHistoryFilter)comboBoxHistoryWindow.SelectedItem ?? TravelHistoryFilter.NoFilter; List <HistoryEntry> result = filter.Filter(hl); // last entry, first in list result = HistoryList.FilterHLByTravel(result); // keep only travel entries (location after death, FSD jumps) foreach (HistoryEntry he in result) // last first.. { if (!systemsentered.ContainsKey(he.System.name)) { systemsentered[he.System.name] = new List <HistoryEntry>(); } systemsentered[he.System.name].Add(he); // first entry is newest jump to, second is next last, etc } foreach (List <HistoryEntry> syslist in systemsentered.Values) // will be in order of entry.. { AddNewHistoryRow(false, syslist); // add, with the properties of the first (latest) entry, giving the number of entries.. } StaticFilters.FilterGridView(dataGridViewStarList, textBoxFilter.Text); int rowno = FindGridPosByJID(pos.Item1, true); // find row.. must be visible.. -1 if not found/not visible if (rowno >= 0) { dataGridViewStarList.CurrentCell = dataGridViewStarList.Rows[rowno].Cells[pos.Item2]; // its the current cell which needs to be set, moves the row marker as well currentGridRow = (rowno!=-1) ? } else if (dataGridViewStarList.Rows.GetRowCount(DataGridViewElementStates.Visible) > 0) { rowno = dataGridViewStarList.Rows.GetFirstRow(DataGridViewElementStates.Visible); dataGridViewStarList.CurrentCell = dataGridViewStarList.Rows[rowno].Cells[StarHistoryColumns.StarName]; } else { rowno = -1; } dataGridViewStarList.Columns[0].HeaderText = EDDiscoveryForm.EDDConfig.DisplayUTC ? "Game Time" : "Time"; //System.Diagnostics.Debug.WriteLine("Fire HC"); FireChangeSelection(); // and since we repainted, we should fire selection, as we in effect may have selected a new one }
public void Display(HistoryList hl) { if (hl == null) // just for safety { return; } current_historylist = hl; Tuple <long, int> pos = CurrentGridPosByJID(); var filter = (TravelHistoryFilter)comboBoxJournalWindow.SelectedItem ?? TravelHistoryFilter.NoFilter; List <HistoryEntry> result = filter.Filter(hl); result = HistoryList.FilterByJournalEvent(result, SQLiteDBClass.GetSettingString(DbFilterSave, "All")); dataGridViewJournal.Rows.Clear(); for (int ii = 0; ii < result.Count; ii++) //foreach (var item in result) { AddNewJournalRow(false, result[ii]); // for every one in filter, add a row. } StaticFilters.FilterGridView(dataGridViewJournal, textBoxFilter.Text); int rowno = FindGridPosByJID(pos.Item1); if (rowno > 0) { dataGridViewJournal.CurrentCell = dataGridViewJournal.Rows[rowno].Cells[pos.Item2]; // its the current cell which needs to be set, moves the row marker as well currentGridRow = (rowno!=-1) ? } dataGridViewJournal.Columns[0].HeaderText = EDDiscoveryForm.EDDConfig.DisplayUTC ? "Game Time" : "Time"; }
private void Display(HistoryList hl, bool disablesorting) { if (hl == null) // just for safety { return; } current_historylist = hl; Tuple <long, int> pos = CurrentGridPosByJID(); SortOrder sortorder = dataGridViewJournal.SortOrder; int sortcol = dataGridViewJournal.SortedColumn?.Index ?? -1; if (sortcol >= 0 && disablesorting) { dataGridViewJournal.Columns[sortcol].HeaderCell.SortGlyphDirection = SortOrder.None; sortcol = -1; } var filter = (TravelHistoryFilter)comboBoxJournalWindow.SelectedItem ?? TravelHistoryFilter.NoFilter; List <HistoryEntry> result = filter.Filter(hl); fdropdown = hl.Count() - result.Count(); result = HistoryList.FilterByJournalEvent(result, SQLiteDBClass.GetSettingString(DbFilterSave, "All"), out ftotalevents); result = FilterHelpers.FilterHistory(result, fieldfilter, discoveryform.Globals, out ftotalfilters); dataGridViewJournal.Rows.Clear(); rowsbyjournalid.Clear(); for (int ii = 0; ii < result.Count; ii++) //foreach (var item in result) { AddNewJournalRow(false, result[ii]); // for every one in filter, add a row. } StaticFilters.FilterGridView(dataGridViewJournal, textBoxFilter.Text); UpdateToolTipsForFilter(); int rowno = FindGridPosByJID(pos.Item1, true); if (rowno >= 0) { dataGridViewJournal.CurrentCell = dataGridViewJournal.Rows[rowno].Cells[pos.Item2]; // its the current cell which needs to be set, moves the row marker as well currentGridRow = (rowno!=-1) ? } dataGridViewJournal.Columns[0].HeaderText = EDDiscoveryForm.EDDConfig.DisplayUTC ? "Game Time" : "Time"; if (sortcol >= 0) { dataGridViewJournal.Sort(dataGridViewJournal.Columns[sortcol], (sortorder == SortOrder.Descending) ? ListSortDirection.Descending : ListSortDirection.Ascending); dataGridViewJournal.Columns[sortcol].HeaderCell.SortGlyphDirection = sortorder; } FireChangeSelection(); }
public void HistoryChanged(HistoryList hl) // on History change { if (hl == null) // just for safety { return; } current_historylist = hl; Tuple <long, int> pos = CurrentGridPosByJID(); var filter = (TravelHistoryFilter)comboBoxHistoryWindow.SelectedItem ?? TravelHistoryFilter.NoFilter; List <HistoryEntry> result = filter.Filter(hl); int ftotal; result = HistoryList.FilterByJournalEvent(result, SQLiteDBClass.GetSettingString(DbFilterSave, "All"), out ftotal); toolTip.SetToolTip(buttonFilter, (ftotal > 0) ? ("Total filtered out " + ftotal) : "Filter out entries based on event type"); result = FilterHelpers.FilterHistory(result, fieldfilter, discoveryform.Globals, out ftotal); toolTip.SetToolTip(buttonField, (ftotal > 0) ? ("Total filtered out " + ftotal) : "Filter out entries matching the field selection"); dataGridViewTravel.Rows.Clear(); rowsbyjournalid.Clear(); for (int ii = 0; ii < result.Count; ii++) //foreach (var item in result) { AddNewHistoryRow(false, result[ii]); // for every one in filter, add a row. } StaticFilters.FilterGridView(dataGridViewTravel, textBoxFilter.Text); int rowno = FindGridPosByJID(pos.Item1, true); // find row.. must be visible.. -1 if not found/not visible if (rowno >= 0) { dataGridViewTravel.CurrentCell = dataGridViewTravel.Rows[rowno].Cells[pos.Item2]; // its the current cell which needs to be set, moves the row marker as well currentGridRow = (rowno!=-1) ? } else if (dataGridViewTravel.Rows.GetRowCount(DataGridViewElementStates.Visible) > 0) { rowno = dataGridViewTravel.Rows.GetFirstRow(DataGridViewElementStates.Visible); dataGridViewTravel.CurrentCell = dataGridViewTravel.Rows[rowno].Cells[TravelHistoryColumns.Description]; } else { rowno = -1; } dataGridViewTravel.Columns[0].HeaderText = EDDiscoveryForm.EDDConfig.DisplayUTC ? "Game Time" : "Time"; //System.Diagnostics.Debug.WriteLine("Fire HC"); if (OnHistoryChanged != null) { OnHistoryChanged(hl); } FireChangeSelection(); // and since we repainted, we should fire selection, as we in effect may have selected a new one }
private void textBoxFilter_TextChanged(object sender, EventArgs e) { Tuple<long, int> pos = CurrentGridPosByJID(); StaticFilters.FilterGridView(dataGridViewTravel, textBoxFilter.Text); int rowno = FindGridPosByJID(pos.Item1,true); if (rowno >= 0) dataGridViewTravel.CurrentCell = dataGridViewTravel.Rows[rowno].Cells[pos.Item2]; }
public void Display(HistoryList hl) // rowno current.. -1 if nothing { if (hl == null) // just for safety { return; } current_historylist = hl; Tuple <long, int> pos = CurrentGridPosByJID(); var filter = (TravelHistoryFilter)comboBoxHistoryWindow.SelectedItem ?? TravelHistoryFilter.NoFilter; List <HistoryEntry> result = filter.Filter(hl); result = HistoryList.FilterByJournalEvent(result, SQLiteDBClass.GetSettingString(DbFilterSave, "All")); dataGridViewTravel.Rows.Clear(); for (int ii = 0; ii < result.Count; ii++) //foreach (var item in result) { AddNewHistoryRow(false, result[ii]); // for every one in filter, add a row. } StaticFilters.FilterGridView(dataGridViewTravel, textBoxFilter.Text); int rowno = FindGridPosByJID(preferred_jid >= 0 ? preferred_jid : pos.Item1); // either go back to preferred, or to remembered above preferred_jid = -1; // 1 shot at this if (rowno >= 0) { dataGridViewTravel.CurrentCell = dataGridViewTravel.Rows[rowno].Cells[pos.Item2]; // its the current cell which needs to be set, moves the row marker as well currentGridRow = (rowno!=-1) ? } else if (dataGridViewTravel.Rows.GetRowCount(DataGridViewElementStates.Visible) > 0) { rowno = dataGridViewTravel.Rows.GetFirstRow(DataGridViewElementStates.Visible); dataGridViewTravel.CurrentCell = dataGridViewTravel.Rows[rowno].Cells[TravelHistoryColumns.Description]; } else { rowno = -1; } currentGridRow = rowno; dataGridViewTravel.Columns[0].HeaderText = EDDiscoveryForm.EDDConfig.DisplayUTC ? "Game Time" : "Time"; if (OnRedisplay != null) { OnRedisplay(hl); } }
private void Searchtimer_Tick(object sender, EventArgs e) { searchtimer.Stop(); this.Cursor = Cursors.WaitCursor; SaveBackAnyChanges(); StaticFilters.FilterGridView(dataGridViewBookMarks, textBoxFilter.Text); RefreshCurrentEdit(); this.Cursor = Cursors.Default; }
private void textBoxFilter_TextChanged(object sender, EventArgs e) { Tuple <long, int> pos = CurrentGridPosByJID(); StaticFilters.FilterGridView(dataGridViewJournal, textBoxFilter.Text); int rowno = FindGridPosByJID(pos.Item1, true); if (rowno >= 0) { dataGridViewJournal.CurrentCell = dataGridViewJournal.Rows[rowno].Cells[pos.Item2]; // its the current cell which needs to be set, moves the row marker as well currentGridRow = (rowno!=-1) ? } }
private void Display(Ledger mc) { DataGridViewColumn sortcol = dataGridViewLedger.SortedColumn != null ? dataGridViewLedger.SortedColumn : dataGridViewLedger.Columns[0]; SortOrder sortorder = dataGridViewLedger.SortOrder; dataGridViewLedger.Rows.Clear(); bool utctime = EDDiscoveryForm.EDDConfig.DisplayUTC; current_mc = mc; labelNoItems.Visible = true; if (mc != null && mc.Transactions.Count > 0) { var filter = (TravelHistoryFilter)comboBoxHistoryWindow.SelectedItem ?? TravelHistoryFilter.NoFilter; List <Ledger.Transaction> filteredlist = filter.Filter(mc.Transactions); filteredlist = FilterByJournalEvent(filteredlist, SQLiteDBClass.GetSettingString(DbFilterSave, "All")); if (filteredlist.Count > 0) { for (int i = filteredlist.Count - 1; i >= 0; i--) { Ledger.Transaction tx = filteredlist[i]; object[] rowobj = { utctime?tx.utctime : tx.utctime.ToLocalTime(), tx.jtype.ToString().SplitCapsWord(), tx.notes, (tx.cashadjust > 0) ? tx.cashadjust.ToString("N0") : "", (tx.cashadjust < 0) ? (-tx.cashadjust).ToString("N0") : "", tx.cash.ToString("N0"), (tx.profitperunit != 0) ? tx.profitperunit.ToString("N0") : "" }; dataGridViewLedger.Rows.Add(rowobj); dataGridViewLedger.Rows[dataGridViewLedger.Rows.Count - 1].Tag = tx.jid; } StaticFilters.FilterGridView(dataGridViewLedger, textBoxFilter.Text); labelNoItems.Visible = false; } } dataGridViewLedger.Columns[0].HeaderText = utctime ? "Game Time" : "Time"; dataGridViewLedger.Sort(sortcol, (sortorder == SortOrder.Descending) ? ListSortDirection.Descending : ListSortDirection.Ascending); dataGridViewLedger.Columns[sortcol.Index].HeaderCell.SortGlyphDirection = sortorder; }
private void Searchtimer_Tick(object sender, EventArgs e) { searchtimer.Stop(); this.Cursor = Cursors.WaitCursor; Tuple <long, int> pos = CurrentGridPosByJID(); StaticFilters.FilterGridView(dataGridViewJournal, textBoxFilter.Text); int rowno = FindGridPosByJID(pos.Item1, true); if (rowno >= 0) { dataGridViewJournal.CurrentCell = dataGridViewJournal.Rows[rowno].Cells[pos.Item2]; // its the current cell which needs to be set, moves the row marker as well currentGridRow = (rowno!=-1) ? } this.Cursor = Cursors.Default; }
public void Display(HistoryList hl) { if (hl == null) // just for safety { return; } current_historylist = hl; Tuple <long, int> pos = CurrentGridPosByJID(); var filter = (TravelHistoryFilter)comboBoxJournalWindow.SelectedItem ?? TravelHistoryFilter.NoFilter; List <HistoryEntry> result = filter.Filter(hl); int ftotal; result = HistoryList.FilterByJournalEvent(result, SQLiteDBClass.GetSettingString(DbFilterSave, "All"), out ftotal); toolTip.SetToolTip(buttonFilter, (ftotal > 0) ? ("Total filtered out " + ftotal) : "Filter out entries based on event type"); result = FilterHelpers.FilterHistory(result, fieldfilter, discoveryform.Globals, out ftotal); toolTip.SetToolTip(buttonField, (ftotal > 0) ? ("Total filtered out " + ftotal) : "Filter out entries matching the field selection"); dataGridViewJournal.Rows.Clear(); rowsbyjournalid.Clear(); for (int ii = 0; ii < result.Count; ii++) //foreach (var item in result) { AddNewJournalRow(false, result[ii]); // for every one in filter, add a row. } StaticFilters.FilterGridView(dataGridViewJournal, textBoxFilter.Text); int rowno = FindGridPosByJID(pos.Item1, true); if (rowno >= 0) { dataGridViewJournal.CurrentCell = dataGridViewJournal.Rows[rowno].Cells[pos.Item2]; // its the current cell which needs to be set, moves the row marker as well currentGridRow = (rowno!=-1) ? } dataGridViewJournal.Columns[0].HeaderText = EDDiscoveryForm.EDDConfig.DisplayUTC ? "Game Time" : "Time"; FireChangeSelection(); }
public void Display(MaterialCommoditiesLedger mc) { dataGridViewLedger.Rows.Clear(); bool utctime = EDDiscoveryForm.EDDConfig.DisplayUTC; current_mc = mc; labelNoItems.Visible = true; if (mc != null && mc.Transactions.Count > 0) { var filter = (TravelHistoryFilter)comboBoxHistoryWindow.SelectedItem ?? TravelHistoryFilter.NoFilter; List <MaterialCommoditiesLedger.Transaction> filteredlist = filter.Filter(mc.Transactions); filteredlist = FilterByJournalEvent(filteredlist, DB.SQLiteDBClass.GetSettingString(DbFilterSave, "All")); if (filteredlist.Count > 0) { for (int i = filteredlist.Count - 1; i >= 0; i--) { MaterialCommoditiesLedger.Transaction tx = filteredlist[i]; object[] rowobj = { utctime?tx.utctime : tx.utctime.ToLocalTime(), Tools.SplitCapsWord(tx.jtype.ToString()), tx.notes, (tx.cashadjust > 0) ? tx.cashadjust.ToString("N0") : "", (tx.cashadjust < 0) ? (-tx.cashadjust).ToString("N0") : "", tx.cash.ToString("N0"), (tx.profitperunit != 0) ? tx.profitperunit.ToString("N0") : "" }; dataGridViewLedger.Rows.Add(rowobj); dataGridViewLedger.Rows[dataGridViewLedger.Rows.Count - 1].Tag = tx.jid; } StaticFilters.FilterGridView(dataGridViewLedger, textBoxFilter.Text); labelNoItems.Visible = false; } } dataGridViewLedger.Columns[0].HeaderText = utctime ? "Game Time" : "Time"; }
private void Searchtimer_Tick(object sender, EventArgs e) { searchtimer.Stop(); this.Cursor = Cursors.WaitCursor; //System.Diagnostics.Debug.WriteLine(Environment.TickCount % 10000 + "Searching"); Tuple <long, int> pos = CurrentGridPosByJID(); StaticFilters.FilterGridView(dataGridViewTravel, textBoxFilter.Text); int rowno = FindGridPosByJID(pos.Item1, true); if (rowno >= 0) { dataGridViewTravel.CurrentCell = dataGridViewTravel.Rows[rowno].Cells[pos.Item2]; } this.Cursor = Cursors.Default; //System.Diagnostics.Debug.WriteLine(Environment.TickCount % 10000 + "Complete"); }
private void textBoxFilter_TextChanged(object sender, EventArgs e) { StaticFilters.FilterGridView(dataGridViewLedger, textBoxFilter.Text); }
private void textBoxFilter_KeyUp(object sender, KeyEventArgs e) { StaticFilters.FilterGridView(dataGridViewLedger, textBoxFilter.Text); }