Exemplo n.º 1
0
        private void newFileToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Files f = new Files();


            using (NewProject form2 = new NewProject())
            {
                form2.StartPosition = FormStartPosition.CenterParent;
                form2.ShowDialog();
                f.name      = form2.textbox1value;
                f.baseClass = form2.textbox2value;
                f.path      = form2.textbox3value;
            }

            TabPageEx tp = new TabPageEx();

            tp.Text = f.name;

            tp.ImageIndex = 0;
            krbTabControl1.TabPages.Add(tp);
            FastColoredTextBox tb = new FastColoredTextBox();

            tb.Language         = FastColoredTextBoxNS.Language.Lua;
            tb.AutoIndentChars  = false;
            tb.Parent           = tp;
            tb.ShowFoldingLines = true;
            tb.ContextMenuStrip = contextMenuStrip1;
            this.autocompleteMenu1.SetAutocompleteMenu(tb, this.autocompleteMenu1);
            tb.TextChanged      += new System.EventHandler <TextChangedEventArgs>(this.fastColoredTextBox1_TextChanged);
            tb.SelectionChanged += new System.EventHandler(this.fastColoredTextBox1_SelectionChanged);
            tb.Dock              = DockStyle.Fill;
            tb.CurrentLineColor  = Color.FromArgb(199, 220, 83);

            tb.ReadOnly = false;
            tb.Text     =
                @"function OnLoad()
    " + f.baseClass + @"()
end

class """ + f.baseClass + @"""
function " + f.baseClass + @":__init()
    AddDrawCallback(function() self:OnDraw() end)
    AddTickCallback(function() self:OnTick() end)
end

function " + f.baseClass + @":OnDraw()
    
end

function " + f.baseClass + @":OnTick()
    
end";

            krbTabControl1.SelectedTab = tp;
        }
Exemplo n.º 2
0
        private void newFileToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Files f = new Files();

            using (NewProject form2 = new NewProject())
            {
                form2.StartPosition = FormStartPosition.CenterParent;
                form2.ShowDialog();
                f.name = form2.textbox1value;
                f.baseClass = form2.textbox2value;
                f.path = form2.textbox3value;

            }

            TabPageEx tp = new TabPageEx();
            tp.Text = f.name;

            tp.ImageIndex = 0;
            krbTabControl1.TabPages.Add(tp);
            FastColoredTextBox tb = new FastColoredTextBox();
            tb.Language = FastColoredTextBoxNS.Language.Lua;
            tb.AutoIndentChars = false;
            tb.Parent = tp;
            tb.ShowFoldingLines = true;
            tb.ContextMenuStrip = contextMenuStrip1;
            this.autocompleteMenu1.SetAutocompleteMenu(tb, this.autocompleteMenu1);
            tb.TextChanged += new System.EventHandler<TextChangedEventArgs>(this.fastColoredTextBox1_TextChanged);
            tb.SelectionChanged += new System.EventHandler(this.fastColoredTextBox1_SelectionChanged);
            tb.Dock = DockStyle.Fill;
            tb.CurrentLineColor = Color.FromArgb(199,220,83);

            tb.ReadOnly = false;
            tb.Text =
            @"function OnLoad()
            " + f.baseClass + @"()
            end

            class """ + f.baseClass + @"""
            function " + f.baseClass + @":__init()
            AddDrawCallback(function() self:OnDraw() end)
            AddTickCallback(function() self:OnTick() end)
            end

            function " + f.baseClass + @":OnDraw()

            end

            function " + f.baseClass + @":OnTick()

            end";

            krbTabControl1.SelectedTab = tp;
        }