public ScriptDlg(Script scr, AdvData data) { mData = data; mScript = scr; InitializeComponent(); int[] tabs = { 20, 40, 60, 80, 100, 120, 140 }; scripttext.SelectionTabs = tabs; linenumberbox.Paint += new PaintEventHandler(linenumberbox_Paint); scripttext.VScroll += new EventHandler(scripttext_VScroll); scripttext.TextChanged += new EventHandler(scripttext_TextChanged); scripttext.MouseDown += new MouseEventHandler(scripttext_MouseDown); scripttext.KeyUp += new KeyEventHandler(scripttext_KeyUp); scripttext.KeyDown += new KeyEventHandler(scripttext_KeyDown); matches.SelectedIndexChanged += new EventHandler(matches_SelectedIndexChanged); this.FormClosed += new FormClosedEventHandler(ScriptDlg_FormClosed); //scripttext updateScript(); //parsing stuff mParser = new PcdkParser(data.Settings.ScriptingLanguage); mParser.initSyntax(); mParser.Comment += new PcdkParser.commentCB(colorComment); mParser.Function += new PcdkParser.functionCB(colorFunction); mParser.ParseError += new PcdkParser.parseError(mParser_ParseError); mKeywordFont = new Font(scripttext.Font, FontStyle.Bold); parseScript(); if (!mHistory.Contains(scr)) { if (mHistory.Count > 4) { mHistory.RemoveAt(4); } mHistory.Insert(0, scr); } else { mHistory.Remove(scr); mHistory.Insert(0, scr); } }
public ScriptDlg(Script scr, AdvData data) { mData = data; mScript = scr; InitializeComponent(); int[] tabs = { 20, 40, 60, 80, 100, 120, 140 }; scripttext.SelectionTabs = tabs; linenumberbox.Paint += new PaintEventHandler(linenumberbox_Paint); scripttext.VScroll += new EventHandler(scripttext_VScroll); scripttext.TextChanged += new EventHandler(scripttext_TextChanged); scripttext.MouseDown += new MouseEventHandler(scripttext_MouseDown); scripttext.KeyUp += new KeyEventHandler(scripttext_KeyUp); scripttext.KeyDown += new KeyEventHandler(scripttext_KeyDown); matches.SelectedIndexChanged += new EventHandler(matches_SelectedIndexChanged); this.FormClosed += new FormClosedEventHandler(ScriptDlg_FormClosed); //scripttext updateScript(); //parsing stuff mParser = new PcdkParser(data.Settings.ScriptingLanguage); mParser.initSyntax(); mParser.Comment += new PcdkParser.commentCB(colorComment); mParser.Function += new PcdkParser.functionCB(colorFunction); mParser.ParseError += new PcdkParser.parseError(mParser_ParseError); mKeywordFont = new Font(scripttext.Font, FontStyle.Bold); parseScript(); if (!mHistory.Contains(scr)) { if (mHistory.Count > 4) mHistory.RemoveAt(4); mHistory.Insert(0, scr); } else { mHistory.Remove(scr); mHistory.Insert(0, scr); } }
public void updateLanguageList() { PcdkParser parser = new PcdkParser(Settings.ScriptingLanguage); parser.initSyntax(); parser.Function += new PcdkParser.functionCB(parser_Function); Language.beginRefresh(); foreach (Dictionary<string, Script> scripts in mScripts) { foreach (KeyValuePair<string, Script> pair in scripts) { parser.parseText(pair.Value.Text); } } mLanguages["origin"].addWord(Language.Section.Commands, Settings.WalkText, null); mLanguages["origin"].addWord(Language.Section.Commands, Settings.LinkText, null); mLanguages["origin"].addWord(Language.Section.Commands, Settings.GiveLink, null); foreach (KeyValuePair<string,string> pair in Settings.Commands){ mLanguages["origin"].addWord(Language.Section.Commands, pair.Value, null); } Language.endRefresh(this); }