Exemplo n.º 1
0
        private void UpdateStats()
        {
            tpEditor tp = GetCurrentEditor();

            if (tp != null)
            {
                rtfSelStatLabel.Text = "Ln: {0}    Col: {1}    Len: {2}".F(tp.Line, tp.Column, tp.Length);
            }
        }
Exemplo n.º 2
0
        private void checkToolStripMenuItem_Click(object sender, EventArgs e)
        {
            tpEditor tp = GetCurrentEditor();

            if (tp != null)
            {
                tp.DoCheck(Context);
            }
        }
Exemplo n.º 3
0
        private void saveAsToolStripMenuItem_Click(object sender, System.EventArgs e)
        {
            tpEditor tp = GetCurrentEditor();

            if (tp != null)
            {
                tp.SaveAs();
                tp.Text = Path.GetFileName(tp.CurrPath);
            }
            UpdateTitle();
        }
Exemplo n.º 4
0
        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();
        }
Exemplo n.º 5
0
        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();
            }
        }
Exemplo n.º 6
0
        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;
            }
        }