From fb841bc764408cc88f88c8931643648e30bbefe3 Mon Sep 17 00:00:00 2001 From: adelikat Date: Thu, 19 Jul 2012 00:19:47 +0000 Subject: [PATCH] check in luawriter winform files, needs to be hooked up --- .../tools/LuaWriter.Designer.cs | 61 +++++++++ BizHawk.MultiClient/tools/LuaWriter.cs | 43 +++++++ BizHawk.MultiClient/tools/LuaWriter.resx | 120 ++++++++++++++++++ 3 files changed, 224 insertions(+) create mode 100644 BizHawk.MultiClient/tools/LuaWriter.Designer.cs create mode 100644 BizHawk.MultiClient/tools/LuaWriter.cs create mode 100644 BizHawk.MultiClient/tools/LuaWriter.resx diff --git a/BizHawk.MultiClient/tools/LuaWriter.Designer.cs b/BizHawk.MultiClient/tools/LuaWriter.Designer.cs new file mode 100644 index 0000000000..9612b1c1a3 --- /dev/null +++ b/BizHawk.MultiClient/tools/LuaWriter.Designer.cs @@ -0,0 +1,61 @@ +namespace BizHawk.MultiClient.tools +{ + partial class LuaWriter + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.LuaText = new System.Windows.Forms.RichTextBox(); + this.SuspendLayout(); + // + // LuaText + // + this.LuaText.DetectUrls = false; + this.LuaText.Location = new System.Drawing.Point(12, 12); + this.LuaText.Name = "LuaText"; + this.LuaText.Size = new System.Drawing.Size(819, 417); + this.LuaText.TabIndex = 0; + this.LuaText.Text = ""; + this.LuaText.ZoomFactor = 1.2F; + this.LuaText.TextChanged += new System.EventHandler(this.LuaText_TextChanged); + // + // LuaWriter + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(843, 441); + this.Controls.Add(this.LuaText); + this.Name = "LuaWriter"; + this.Text = "LuaWriter"; + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.RichTextBox LuaText; + } +} \ No newline at end of file diff --git a/BizHawk.MultiClient/tools/LuaWriter.cs b/BizHawk.MultiClient/tools/LuaWriter.cs new file mode 100644 index 0000000000..6f1b6d8a8e --- /dev/null +++ b/BizHawk.MultiClient/tools/LuaWriter.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace BizHawk.MultiClient.tools +{ + public partial class LuaWriter : Form + { + string[] reserv = {"and", "break", "do", "else", "elseif", "end", "false", "for", "function", "if", "in", "local", "nil", "not", "or", "repeat", "return", "then", "true", "until", "while"}; + public LuaWriter() + { + InitializeComponent(); + } + + private void LuaText_TextChanged(object sender, EventArgs e) + { + int pos = LuaText.SelectionStart; + foreach (string str in reserv) + { + int temppos = 0; + do + { + LuaText.Find(str, temppos, RichTextBoxFinds.WholeWord | RichTextBoxFinds.MatchCase); + if (LuaText.SelectedText.Count() > 0) + { + LuaText.SelectionColor = Color.Blue; + } + LuaText.Select(LuaText.SelectionStart + LuaText.SelectedText.Count() + 1, 0); + temppos = LuaText.SelectionStart; + + } while (temppos < LuaText.Text.Count()); + } + LuaText.Select(pos, 0); + LuaText.SelectionColor = Color.Black; + } + + } +} diff --git a/BizHawk.MultiClient/tools/LuaWriter.resx b/BizHawk.MultiClient/tools/LuaWriter.resx new file mode 100644 index 0000000000..29dcb1b3a3 --- /dev/null +++ b/BizHawk.MultiClient/tools/LuaWriter.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file