//========================================================================================================= private void textBox1_MouseUp(object sender, MouseEventArgs e) { textBox1.ShortcutsEnabled = false; if (e.Button == MouseButtons.Left) { try { int ii = textBox1.GetCharIndexFromPosition(e.Location); xxx = (ii / 31); //find row if (xxx >= console.band_stacks[iii]) { return; // if you click past the last index freq, then do nothing. } textBox1.SelectionStart = (xxx * 31); textBox1.SelectionLength = 31; Debug.WriteLine("index at start of click " + console.iii); if (console.filter2[console.iii] == "") // check if current index locked { yyy = 1; console.SaveBand(); // put away last freq you were on before moving Debug.WriteLine("OPEN SO SAVE"); } else { Debug.WriteLine("LOCKED SO DONT SAVE " + console.iii + " says " + console.filter2[console.iii]); } console.iii = xxx; // update new position in bandstack for checking if its locked Debug.WriteLine("index after click " + console.iii); yyy = 0; updateindex(); console.SetBand(mode1[xxx], filter1[xxx], freq1[xxx], CTUN1[xxx], ZoomFactor1[xxx], CenterFreq1[xxx]); console.UpdateWaterfallLevelValues(); } catch { Debug.WriteLine("Failed to determine index or cannot save bandstack because its locked"); if (yyy == 1) { updateindex(); console.SetBand(mode1[xxx], filter1[xxx], freq1[xxx], CTUN1[xxx], ZoomFactor1[xxx], CenterFreq1[xxx]); console.UpdateWaterfallLevelValues(); } } } // LEFT CLICK MOUSE else if (e.Button == MouseButtons.Right) // ke9ns right click = lock or unlock bandstank memory { //----------------------------------------------------------- // This saves the bandstack (if unlocked) try { int ii = textBox1.GetCharIndexFromPosition(e.Location); xxx = (ii / 31); //find row if (xxx >= console.band_stacks[iii]) { return; // if you click past the last index freq, then do nothing. } textBox1.SelectionStart = (xxx * 31); textBox1.SelectionLength = 31; Debug.WriteLine("index at start of click " + console.iii); if (console.filter2[console.iii] == "") // check if current index locked { yyy = 1; console.SaveBand(); // put away last freq you were on before moving Debug.WriteLine("OPEN SO SAVE"); } else { Debug.WriteLine("LOCKED SO DONT SAVE " + console.iii + " says " + console.filter2[console.iii]); } console.iii = xxx; // update new position in bandstack for checking if its locked Debug.WriteLine("index after click " + console.iii); yyy = 0; updateindex(); console.SetBand(mode1[xxx], filter1[xxx], freq1[xxx], CTUN1[xxx], ZoomFactor1[xxx], CenterFreq1[xxx]); console.UpdateWaterfallLevelValues(); } catch { Debug.WriteLine("Failed to determine index or cannot save bandstack because its locked"); if (yyy == 1) { updateindex(); console.SetBand(mode1[xxx], filter1[xxx], freq1[xxx], CTUN1[xxx], ZoomFactor1[xxx], CenterFreq1[xxx]); console.UpdateWaterfallLevelValues(); } } //----------------------------------------------------------- // This toggles the LOCK / UNLOCK and saves it try { int ii = textBox1.GetCharIndexFromPosition(e.Location); Debug.WriteLine("BOX POS " + ii); xxx = (ii / 31); //find row if (xxx >= console.band_stacks[iii]) { return; // if you click past the last index freq, then do nothing. } textBox1.SelectionStart = (xxx * 31); textBox1.SelectionLength = 31; console.SaveBand(); // put away last freq you were on before moving updateindex(); console.SetBand(mode1[xxx], filter1[xxx], freq1[xxx], CTUN1[xxx], ZoomFactor1[xxx], CenterFreq1[xxx]); console.UpdateWaterfallLevelValues(); if (filter1[xxx].Contains("@")) { filter1[xxx] = filter1[xxx].Substring(0, (filter1[xxx].Length) - 1); // toggle LOCK OFF } else { filter1[xxx] = filter1[xxx] + "@"; // toggle LOCK ON } DB.SaveBandStack(console.last_band, xxx, mode1[xxx], filter1[xxx], freq1[xxx], CTUN1[xxx], ZoomFactor1[xxx], CenterFreq1[xxx]); Debug.WriteLine("band== " + console.last_band); Debug.WriteLine("xxx== " + xxx); Debug.WriteLine("bandstack== " + filter); Debug.WriteLine("freq== " + freq1[xxx]); bandstackupdate(); // update bandstack screen } catch { Debug.WriteLine("Bad location1"); } } // RIGHT CLICK MOUSE else if (e.Button == MouseButtons.Middle) // ke9ns Middle erases bandstack entries 1 at a time { try { if (console.band_stacks[iii] < 3) { return; // dont allow removing all the bandstacks } int ii = textBox1.GetCharIndexFromPosition(e.Location); xxx = (ii / 31); // find row if (xxx >= console.band_stacks[iii]) { return; // if you click past the last index freq, then do nothing. } textBox1.SelectionStart = (xxx * 31); textBox1.SelectionLength = 31; console.iii = xxx; // update new position in bandstack for checking if its locked if (filter1[xxx].Contains("@") == false) // can only delete an unlocked entry in the bandstack { console.PurgeBandStack(xxx, mode1[xxx], filter1[xxx], freq1[xxx].ToString()); console.BandStackUpdate(); bandstackupdate(); } } catch (Exception) { Debug.WriteLine("Bad location2"); } } // MIDDLE CLICK MOUSE buttonSort.Focus(); // put focus back on button } //textBox1_MouseUp