private void UpdateStats() { tpEditor tp = GetCurrentEditor(); if (tp != null) { rtfSelStatLabel.Text = "Ln: {0} Col: {1} Len: {2}".F(tp.Line, tp.Column, tp.Length); } }
private void checkToolStripMenuItem_Click(object sender, EventArgs e) { tpEditor tp = GetCurrentEditor(); if (tp != null) { tp.DoCheck(Context); } }
private void saveAsToolStripMenuItem_Click(object sender, System.EventArgs e) { tpEditor tp = GetCurrentEditor(); if (tp != null) { tp.SaveAs(); tp.Text = Path.GetFileName(tp.CurrPath); } UpdateTitle(); }
private void newFileToolStripMenuItem_Click(object sender, System.EventArgs e) { tpEditor tp = new tpEditor(); tp.New(); tp.TextChanged += editor_TextChanged; tp.Editor_SelectionChanged = UpdateStats; tcEditor.Add(tp); tcEditor.SelectedTab = tp; UpdateTitle(); }
private void openFileToolStripMenuItem_Click(object sender, System.EventArgs e) { tpEditor tp = new tpEditor(); if (tp.Open()) { tp.TextChanged += editor_TextChanged; tp.Editor_SelectionChanged = UpdateStats; tcEditor.Controls.Add(tp); tp.Text = Path.GetFileName(tp.CurrPath); tcEditor.SelectedTab = tp; UpdateTitle(); } else { tp.Dispose(); } }
private void UpdateTitle() { tpEditor tp = GetCurrentEditor(); if (tp != null) { bool chg = tp.IsChanged; if (tp.CurrPath != null) { Text = "{0} [{1}]".F(Globals.Title, tp.CurrPath + (chg ? "*" : "")); } else { Text = "{0} [{1}]".F(Globals.Title, "Untitled Document" + (chg ? "*" : "")); } } else { Text = Globals.Title; } }