3using System.Collections.Generic;
4using System.ComponentModel;
9using System.Threading.Tasks;
10using System.Windows.Forms;
18 InitializeComponent();
20 public static bool onTab =
false;
28 private void runBut_Click(
object sender, EventArgs e)
32 consoleBox.Text += textBox.Text + Environment.NewLine + o.ToString() + Environment.NewLine;
42 private void imagejBut_Click(
object sender, EventArgs e)
46 Fiji.RunOnImage(
ImageView.
SelectedImage, textBox.Text, headlessBox.Checked, tabRadioBut.Checked, biofBox.Checked, newTabBox.Checked);
47 consoleBox.Text += textBox.Text + Environment.NewLine;
54 filename = filename.Remove(filename.Length - 4, 4);
69 private void topMostBox_CheckedChanged(
object sender, EventArgs e)
71 this.TopMost = topMostBox.Checked;
78 private void BioConsole_FormClosing(
object sender, FormClosingEventArgs e)
93 private void BioConsole_KeyDown(
object sender, KeyEventArgs e)
95 if (e.KeyCode ==
Keys.Up)
98 textBox.Text = consoleBox.Lines[consoleBox.Lines.Length - 1 - line];
100 if (e.KeyCode ==
Keys.Down)
103 textBox.Text = consoleBox.Lines[consoleBox.Lines.Length - 1 - line];
111 private void tabRadioBut_CheckedChanged(
object sender, EventArgs e)
113 onTab = tabRadioBut.Checked;
120 private void biofBox_CheckedChanged(
object sender, EventArgs e)
125 private void headlessBox_CheckedChanged(
object sender, EventArgs e)
130 string chs =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
131 private string pred =
"";
132 private List<string> preds =
new List<string>();
133 private void textBox_TextChanged(
object sender, EventArgs e)
135 if (textBox.Text.Length == 0)
142 pred = pred.Replace(
"\t",
"").Replace(
"\r",
"").Replace(
"\n",
"");
143 if (pred.Contains(
' '))
144 pred = textBox.Text.Remove(0, textBox.Text.LastIndexOf(
' '));
146 pred = textBox.Text.Replace(
"\t",
"").Replace(
"\r",
"").Replace(
"\n",
"");
151 foreach (Char cs
in pred)
154 foreach (Char c
in chs)
167 pred = pred.Remove(0, ind + 1);
172 foreach (var cs
in Fiji.Macro.Commands)
174 if (cs.Value.Name.StartsWith(pred))
175 preds.Add(cs.Value.Name);
177 foreach (var cs
in Fiji.Macro.Functions)
179 if (cs.Value[0].Name.StartsWith(pred))
180 preds.Add(cs.Value[0].Name);
183 foreach (var item
in preds)
185 if (this.Width > TextRenderer.MeasureText(predLabel.Text,
this.Font).Width)
187 predLabel.Text += item +
", ";
191 if (textBox.Text.EndsWith(
'\t'))
193 string s = textBox.Text.TrimEnd(
'\t');
195 textBox.Text = s.Remove(s.Length - pred.Length, pred.Length) + preds[0];
197 textBox.SelectionStart = textBox.Text.Length;
200 private void newTabBox_CheckedChanged(
object sender, EventArgs e)
202 newTab = newTabBox.Checked;
System.Windows.Forms.Keys Keys
static bool useBioformats
ImageView control for image stacks, pyramidal and whole-slide-images.
static BioImage SelectedImage
static object RunString(string st)