diff --git a/BMGEditor/BMGEditor.csproj b/BMGEditor/BMGEditor.csproj index 346646f..ddfeae0 100644 --- a/BMGEditor/BMGEditor.csproj +++ b/BMGEditor/BMGEditor.csproj @@ -10,4 +10,19 @@ x64 + + + True + True + Resources.resx + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + \ No newline at end of file diff --git a/BMGEditor/Properties/Resources.Designer.cs b/BMGEditor/Properties/Resources.Designer.cs new file mode 100644 index 0000000..cfbfce5 --- /dev/null +++ b/BMGEditor/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// Ce code a été généré par un outil. +// Version du runtime :4.0.30319.42000 +// +// Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si +// le code est régénéré. +// +//------------------------------------------------------------------------------ + +namespace BMGEditor.Properties { + using System; + + + /// + /// Une classe de ressource fortement typée destinée, entre autres, à la consultation des chaînes localisées. + /// + // Cette classe a été générée automatiquement par la classe StronglyTypedResourceBuilder + // à l'aide d'un outil, tel que ResGen ou Visual Studio. + // Pour ajouter ou supprimer un membre, modifiez votre fichier .ResX, puis réexécutez ResGen + // avec l'option /str ou régénérez votre projet VS. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Retourne l'instance ResourceManager mise en cache utilisée par cette classe. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("BMGEditor.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Remplace la propriété CurrentUICulture du thread actuel pour toutes + /// les recherches de ressources à l'aide de cette classe de ressource fortement typée. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/BMGEditor/Properties/Resources.resx b/BMGEditor/Properties/Resources.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/BMGEditor/Properties/Resources.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 diff --git a/BMGEditor/UI/BMGEditForm.Designer.cs b/BMGEditor/UI/BMGEditForm.Designer.cs index dce59a2..444adff 100644 --- a/BMGEditor/UI/BMGEditForm.Designer.cs +++ b/BMGEditor/UI/BMGEditForm.Designer.cs @@ -28,111 +28,78 @@ /// private void InitializeComponent() { - this.menuStrip1 = new System.Windows.Forms.MenuStrip(); - this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.closeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.quitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BMGEditForm)); this.panel1 = new System.Windows.Forms.Panel(); this.entriesListBox = new System.Windows.Forms.ListBox(); - this.menuStrip1.SuspendLayout(); + this.toolStrip1 = new System.Windows.Forms.ToolStrip(); + this.openEntryBtn = new System.Windows.Forms.ToolStripButton(); this.panel1.SuspendLayout(); + this.toolStrip1.SuspendLayout(); this.SuspendLayout(); // - // menuStrip1 - // - this.menuStrip1.ImageScalingSize = new System.Drawing.Size(20, 20); - this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.fileToolStripMenuItem}); - this.menuStrip1.Location = new System.Drawing.Point(0, 0); - this.menuStrip1.Name = "menuStrip1"; - this.menuStrip1.Size = new System.Drawing.Size(800, 28); - this.menuStrip1.TabIndex = 0; - this.menuStrip1.Text = "menuStrip1"; - // - // fileToolStripMenuItem - // - this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.openToolStripMenuItem, - this.closeToolStripMenuItem, - this.saveToolStripMenuItem, - this.quitToolStripMenuItem}); - this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; - this.fileToolStripMenuItem.Size = new System.Drawing.Size(46, 24); - this.fileToolStripMenuItem.Text = "File"; - // - // openToolStripMenuItem - // - this.openToolStripMenuItem.Name = "openToolStripMenuItem"; - this.openToolStripMenuItem.Size = new System.Drawing.Size(128, 26); - this.openToolStripMenuItem.Text = "Open"; - // - // closeToolStripMenuItem - // - this.closeToolStripMenuItem.Name = "closeToolStripMenuItem"; - this.closeToolStripMenuItem.Size = new System.Drawing.Size(128, 26); - this.closeToolStripMenuItem.Text = "Close"; - // - // saveToolStripMenuItem - // - this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; - this.saveToolStripMenuItem.Size = new System.Drawing.Size(128, 26); - this.saveToolStripMenuItem.Text = "Save"; - // - // quitToolStripMenuItem - // - this.quitToolStripMenuItem.Name = "quitToolStripMenuItem"; - this.quitToolStripMenuItem.Size = new System.Drawing.Size(128, 26); - this.quitToolStripMenuItem.Text = "Quit"; - // // panel1 // + this.panel1.Controls.Add(this.toolStrip1); this.panel1.Controls.Add(this.entriesListBox); this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.panel1.Location = new System.Drawing.Point(0, 28); + this.panel1.Location = new System.Drawing.Point(0, 0); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(800, 422); + this.panel1.Size = new System.Drawing.Size(800, 450); this.panel1.TabIndex = 1; // // entriesListBox // - this.entriesListBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.entriesListBox.Dock = System.Windows.Forms.DockStyle.Bottom; this.entriesListBox.FormattingEnabled = true; this.entriesListBox.ItemHeight = 20; - this.entriesListBox.Location = new System.Drawing.Point(0, 0); + this.entriesListBox.Location = new System.Drawing.Point(0, 46); this.entriesListBox.Name = "entriesListBox"; - this.entriesListBox.Size = new System.Drawing.Size(800, 422); + this.entriesListBox.Size = new System.Drawing.Size(800, 404); this.entriesListBox.TabIndex = 0; // + // toolStrip1 + // + this.toolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; + this.toolStrip1.ImageScalingSize = new System.Drawing.Size(20, 20); + this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.openEntryBtn}); + this.toolStrip1.Location = new System.Drawing.Point(0, 0); + this.toolStrip1.Name = "toolStrip1"; + this.toolStrip1.Size = new System.Drawing.Size(800, 27); + this.toolStrip1.TabIndex = 1; + this.toolStrip1.Text = "toolStrip1"; + // + // openEntryBtn + // + this.openEntryBtn.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.openEntryBtn.Image = ((System.Drawing.Image)(resources.GetObject("openEntryBtn.Image"))); + this.openEntryBtn.ImageTransparentColor = System.Drawing.Color.Magenta; + this.openEntryBtn.Name = "openEntryBtn"; + this.openEntryBtn.Size = new System.Drawing.Size(80, 24); + this.openEntryBtn.Text = "openEntry"; + this.openEntryBtn.Click += new System.EventHandler(this.openEntryBtn_Click); + // // BMGEditForm // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(800, 450); this.Controls.Add(this.panel1); - this.Controls.Add(this.menuStrip1); - this.MainMenuStrip = this.menuStrip1; this.Name = "BMGEditForm"; this.Text = "BMGEditForm"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.BMGEditForm_FormClosing); - this.menuStrip1.ResumeLayout(false); - this.menuStrip1.PerformLayout(); this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); + this.toolStrip1.ResumeLayout(false); + this.toolStrip1.PerformLayout(); this.ResumeLayout(false); - this.PerformLayout(); } #endregion - - private System.Windows.Forms.MenuStrip menuStrip1; - private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; private System.Windows.Forms.Panel panel1; - private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem closeToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem quitToolStripMenuItem; private System.Windows.Forms.ListBox entriesListBox; + private System.Windows.Forms.ToolStrip toolStrip1; + private System.Windows.Forms.ToolStripButton openEntryBtn; } } \ No newline at end of file diff --git a/BMGEditor/UI/BMGEditForm.cs b/BMGEditor/UI/BMGEditForm.cs index 5b782b6..f8efbf2 100644 --- a/BMGEditor/UI/BMGEditForm.cs +++ b/BMGEditor/UI/BMGEditForm.cs @@ -1,4 +1,5 @@ -using System; +using BMGEditor.UI; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; @@ -36,5 +37,10 @@ namespace BMGEditor m_FileTbl.Close(); } + private void openEntryBtn_Click(object sender, EventArgs e) + { + Form txtEditForm = new TextEntryEditorForm(m_File.Entries[entriesListBox.SelectedIndex]); + txtEditForm.Show(); + } } } diff --git a/BMGEditor/UI/BMGEditForm.resx b/BMGEditor/UI/BMGEditForm.resx index 938108a..9ee1e08 100644 --- a/BMGEditor/UI/BMGEditForm.resx +++ b/BMGEditor/UI/BMGEditForm.resx @@ -57,7 +57,19 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + 17, 17 + + + + iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAEISURBVEhL3ZErDsJAGIR7DlA47oArV8CDR9RiSDAQPBcA + Qx1BgUMQBEk1ooJAKE0I4Wlqf5gmu1n6oqW7hiZfthkx33aqeZ5HKvEFpmmSYRhSQScXINB1XSroDAke + 96cUpAmupyPZsx7Z8x4drAnPpQmsgU7LdoHDJNIEYjnAlyBXJ3jPhVyaYLca8nLMhX+CPJXAOT+ouTj5 + p5in4asApdWpS8XRwT+zShIFG/fOyxlZJbGC9f5G5bHzUf6LJFJQqTViyxlxEmRiHhLUW10qDbeRpUGC + ErwjE/OQoG9dIsviYGWsXMwxc24BYLcO5pgZc+cWJIG5MbsyAUDnHwlUAkFHJZraR9NeMVq3zi+WF/0A + AAAASUVORK5CYII= + + \ No newline at end of file diff --git a/BMGEditor/UI/TextEntryEditorForm.Designer.cs b/BMGEditor/UI/TextEntryEditorForm.Designer.cs index 22886ec..8a1750b 100644 --- a/BMGEditor/UI/TextEntryEditorForm.Designer.cs +++ b/BMGEditor/UI/TextEntryEditorForm.Designer.cs @@ -92,9 +92,9 @@ // // richTextBox1 // - this.richTextBox1.Location = new System.Drawing.Point(235, 234); + this.richTextBox1.Location = new System.Drawing.Point(130, 234); this.richTextBox1.Name = "richTextBox1"; - this.richTextBox1.Size = new System.Drawing.Size(125, 120); + this.richTextBox1.Size = new System.Drawing.Size(230, 120); this.richTextBox1.TabIndex = 7; this.richTextBox1.Text = ""; // @@ -113,6 +113,7 @@ this.Controls.Add(this.textBox1); this.Name = "TextEntryEditorForm"; this.Text = "TextEntryEditorForm"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.TextEntryEditorForm_FormClosing); this.ResumeLayout(false); this.PerformLayout(); diff --git a/BMGEditor/UI/TextEntryEditorForm.cs b/BMGEditor/UI/TextEntryEditorForm.cs index 0e38eb0..769baae 100644 --- a/BMGEditor/UI/TextEntryEditorForm.cs +++ b/BMGEditor/UI/TextEntryEditorForm.cs @@ -12,9 +12,17 @@ namespace BMGEditor.UI { public partial class TextEntryEditorForm : Form { + BMG.TextEntry m_Entry; public TextEntryEditorForm(BMG.TextEntry txtEntry) { InitializeComponent(); + m_Entry = txtEntry; + richTextBox1.Text = m_Entry.text; + } + + private void TextEntryEditorForm_FormClosing(object sender, FormClosingEventArgs e) + { + m_Entry.text = richTextBox1.Text; } } }