Lua Writer - start syntax color config dialog and font config, neither do anything yet

This commit is contained in:
adelikat 2012-07-23 01:32:41 +00:00
parent 973aa8f9ae
commit 6379aafbae
6 changed files with 247 additions and 6 deletions

View File

@ -360,6 +360,12 @@
<Compile Include="tools\LuaWriterBox.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="tools\LuaWriterColorConfig.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="tools\LuaWriterColorConfig.Designer.cs">
<DependentUpon>LuaWriterColorConfig.cs</DependentUpon>
</Compile>
<Compile Include="tools\WatchCommon.cs" />
<EmbeddedResource Include="AVOut\FFmpegWriterForm.resx">
<DependentUpon>FFmpegWriterForm.cs</DependentUpon>
@ -417,6 +423,9 @@
<EmbeddedResource Include="tools\LuaWriter.resx">
<DependentUpon>LuaWriter.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="tools\LuaWriterColorConfig.resx">
<DependentUpon>LuaWriterColorConfig.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="tools\RamWatch.resx">
<DependentUpon>RamWatch.cs</DependentUpon>
<SubType>Designer</SubType>

View File

@ -113,17 +113,17 @@
//
// fontToolStripMenuItem
//
this.fontToolStripMenuItem.Enabled = false;
this.fontToolStripMenuItem.Name = "fontToolStripMenuItem";
this.fontToolStripMenuItem.Size = new System.Drawing.Size(178, 22);
this.fontToolStripMenuItem.Text = "Font";
this.fontToolStripMenuItem.Text = "&Font";
this.fontToolStripMenuItem.Click += new System.EventHandler(this.fontToolStripMenuItem_Click);
//
// syntaxHighlightingToolStripMenuItem
//
this.syntaxHighlightingToolStripMenuItem.Enabled = false;
this.syntaxHighlightingToolStripMenuItem.Name = "syntaxHighlightingToolStripMenuItem";
this.syntaxHighlightingToolStripMenuItem.Size = new System.Drawing.Size(178, 22);
this.syntaxHighlightingToolStripMenuItem.Text = "Syntax Highlighting";
this.syntaxHighlightingToolStripMenuItem.Text = "&Syntax Highlighting";
this.syntaxHighlightingToolStripMenuItem.Click += new System.EventHandler(this.syntaxHighlightingToolStripMenuItem_Click);
//
// MessageLabel
//

View File

@ -18,14 +18,13 @@ namespace BizHawk.MultiClient
//Line numbers
//Option to toggle line numbers
//Go to line number Ctrl+G
//Syntax highlighting on emulua libraries
//Auto-complete drop down on functions in libraries
//intellisense on library functions
//New lua script menu item on console
//Open up a basic while true do emu.frameadvance() end code block on new lua script
//Option to turn off basic lua script
//Color config menu item
//Font config menu item
//Load/Save font
//Tool strip
//function toolstrip button (inserts a function end block and puts cursor on blank line between them
//when pressing enter on function blah, it should put the end afterwards
@ -41,6 +40,7 @@ namespace BizHawk.MultiClient
public Regex keyWords = new Regex("and|break|do|else|if|end|false|for|function|in|local|nil|not|or|repeat|return|then|true|until|while|elseif");
char[] Symbols = { '+', '-', '*', '/', '%', '^', '#', '=', '<', '>', '(', ')', '{', '}', '[', ']', ';', ':', ',', '.' };
public Regex libraryWords;
Font LuaTextFont = new Font("Courier New", 8);
public LuaWriter()
{
@ -426,5 +426,22 @@ namespace BizHawk.MultiClient
{
SaveScriptAs();
}
private void syntaxHighlightingToolStripMenuItem_Click(object sender, EventArgs e)
{
LuaWriterColorConfig l = new LuaWriterColorConfig();
l.ShowDialog();
}
private void fontToolStripMenuItem_Click(object sender, EventArgs e)
{
FontDialog f = new FontDialog();
DialogResult result = f.ShowDialog();
if (result == DialogResult.OK)
{
LuaText.Font = LuaTextFont = f.Font;
}
}
}
}

View File

@ -0,0 +1,76 @@
namespace BizHawk.MultiClient.tools
{
partial class LuaWriterColorConfig
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.OK = new System.Windows.Forms.Button();
this.Cancel = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// OK
//
this.OK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.OK.Location = new System.Drawing.Point(116, 227);
this.OK.Name = "OK";
this.OK.Size = new System.Drawing.Size(75, 23);
this.OK.TabIndex = 0;
this.OK.Text = "&Ok";
this.OK.UseVisualStyleBackColor = true;
//
// Cancel
//
this.Cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.Cancel.Location = new System.Drawing.Point(197, 227);
this.Cancel.Name = "Cancel";
this.Cancel.Size = new System.Drawing.Size(75, 23);
this.Cancel.TabIndex = 1;
this.Cancel.Text = "&Cancel";
this.Cancel.UseVisualStyleBackColor = true;
//
// LuaWriterColorConfig
//
this.AcceptButton = this.OK;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.Cancel;
this.ClientSize = new System.Drawing.Size(284, 262);
this.Controls.Add(this.Cancel);
this.Controls.Add(this.OK);
this.Name = "LuaWriterColorConfig";
this.ShowIcon = false;
this.Text = "Syntax Highlight Config";
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button OK;
private System.Windows.Forms.Button Cancel;
}
}

View File

@ -0,0 +1,19 @@
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 LuaWriterColorConfig : Form
{
public LuaWriterColorConfig()
{
InitializeComponent();
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>