From 2d472f11e677b41f32a02a086fb5f56b9e1ea004 Mon Sep 17 00:00:00 2001 From: Kurt Date: Sat, 21 Jul 2018 10:35:01 -0700 Subject: [PATCH] Allow "About" form to be translated use tabcontrol instead of toggling buttons --- PKHeX.WinForms/Misc/About.Designer.cs | 114 ++++++++++++++++---------- PKHeX.WinForms/Misc/About.cs | 24 +----- PKHeX.WinForms/Misc/About.resx | 20 +++-- 3 files changed, 87 insertions(+), 71 deletions(-) diff --git a/PKHeX.WinForms/Misc/About.Designer.cs b/PKHeX.WinForms/Misc/About.Designer.cs index dee336c3d..a66360606 100644 --- a/PKHeX.WinForms/Misc/About.Designer.cs +++ b/PKHeX.WinForms/Misc/About.Designer.cs @@ -29,66 +29,88 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(About)); - this.B_Close = new System.Windows.Forms.Button(); - this.RTB = new System.Windows.Forms.RichTextBox(); this.L_Thanks = new System.Windows.Forms.Label(); - this.B_Shortcuts = new System.Windows.Forms.Button(); + this.TC_About = new System.Windows.Forms.TabControl(); + this.Tab_Shortcuts = new System.Windows.Forms.TabPage(); + this.Tab_Changelog = new System.Windows.Forms.TabPage(); + this.RTB_Changelog = new System.Windows.Forms.RichTextBox(); + this.RTB_Shortcuts = new System.Windows.Forms.RichTextBox(); + this.TC_About.SuspendLayout(); + this.Tab_Shortcuts.SuspendLayout(); + this.Tab_Changelog.SuspendLayout(); this.SuspendLayout(); // - // B_Close - // - this.B_Close.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.B_Close.Location = new System.Drawing.Point(412, 340); - this.B_Close.Name = "B_Close"; - this.B_Close.Size = new System.Drawing.Size(75, 23); - this.B_Close.TabIndex = 0; - this.B_Close.Text = "Close"; - this.B_Close.UseVisualStyleBackColor = true; - this.B_Close.Click += new System.EventHandler(this.B_Close_Click); - // - // RTB - // - this.RTB.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.RTB.Location = new System.Drawing.Point(7, 9); - this.RTB.Name = "RTB"; - this.RTB.ReadOnly = true; - this.RTB.Size = new System.Drawing.Size(480, 322); - this.RTB.TabIndex = 1; - this.RTB.Text = ""; - this.RTB.WordWrap = false; - // // L_Thanks // this.L_Thanks.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.L_Thanks.AutoSize = true; - this.L_Thanks.Location = new System.Drawing.Point(12, 345); + this.L_Thanks.Location = new System.Drawing.Point(265, 4); this.L_Thanks.Name = "L_Thanks"; this.L_Thanks.Size = new System.Drawing.Size(147, 13); this.L_Thanks.TabIndex = 2; this.L_Thanks.Text = "Thanks to all the researchers!"; // - // B_Shortcuts + // TC_About // - this.B_Shortcuts.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.B_Shortcuts.Location = new System.Drawing.Point(337, 340); - this.B_Shortcuts.Name = "B_Shortcuts"; - this.B_Shortcuts.Size = new System.Drawing.Size(69, 23); - this.B_Shortcuts.TabIndex = 4; - this.B_Shortcuts.Text = "Shortcuts"; - this.B_Shortcuts.UseVisualStyleBackColor = true; - this.B_Shortcuts.Click += new System.EventHandler(this.B_Shortcuts_Click); + this.TC_About.Controls.Add(this.Tab_Shortcuts); + this.TC_About.Controls.Add(this.Tab_Changelog); + this.TC_About.Dock = System.Windows.Forms.DockStyle.Fill; + this.TC_About.Location = new System.Drawing.Point(0, 0); + this.TC_About.Margin = new System.Windows.Forms.Padding(0); + this.TC_About.Name = "TC_About"; + this.TC_About.SelectedIndex = 0; + this.TC_About.Size = new System.Drawing.Size(494, 372); + this.TC_About.TabIndex = 5; + // + // Tab_Shortcuts + // + this.Tab_Shortcuts.Controls.Add(this.RTB_Shortcuts); + this.Tab_Shortcuts.Location = new System.Drawing.Point(4, 22); + this.Tab_Shortcuts.Name = "Tab_Shortcuts"; + this.Tab_Shortcuts.Size = new System.Drawing.Size(486, 346); + this.Tab_Shortcuts.TabIndex = 0; + this.Tab_Shortcuts.Text = "Shortcuts"; + this.Tab_Shortcuts.UseVisualStyleBackColor = true; + // + // Tab_Changelog + // + this.Tab_Changelog.Controls.Add(this.RTB_Changelog); + this.Tab_Changelog.Location = new System.Drawing.Point(4, 22); + this.Tab_Changelog.Name = "Tab_Changelog"; + this.Tab_Changelog.Size = new System.Drawing.Size(486, 346); + this.Tab_Changelog.TabIndex = 1; + this.Tab_Changelog.Text = "Changelog"; + this.Tab_Changelog.UseVisualStyleBackColor = true; + // + // RTB_Changelog + // + this.RTB_Changelog.Dock = System.Windows.Forms.DockStyle.Fill; + this.RTB_Changelog.Location = new System.Drawing.Point(0, 0); + this.RTB_Changelog.Name = "RTB_Changelog"; + this.RTB_Changelog.ReadOnly = true; + this.RTB_Changelog.Size = new System.Drawing.Size(486, 346); + this.RTB_Changelog.TabIndex = 2; + this.RTB_Changelog.Text = ""; + this.RTB_Changelog.WordWrap = false; + // + // RTB_Shortcuts + // + this.RTB_Shortcuts.Dock = System.Windows.Forms.DockStyle.Fill; + this.RTB_Shortcuts.Location = new System.Drawing.Point(0, 0); + this.RTB_Shortcuts.Name = "RTB_Shortcuts"; + this.RTB_Shortcuts.ReadOnly = true; + this.RTB_Shortcuts.Size = new System.Drawing.Size(486, 346); + this.RTB_Shortcuts.TabIndex = 3; + this.RTB_Shortcuts.Text = ""; + this.RTB_Shortcuts.WordWrap = false; // // About // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(494, 372); - this.Controls.Add(this.B_Shortcuts); this.Controls.Add(this.L_Thanks); - this.Controls.Add(this.RTB); - this.Controls.Add(this.B_Close); + this.Controls.Add(this.TC_About); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false; this.MaximumSize = new System.Drawing.Size(910, 710); @@ -97,16 +119,20 @@ private void InitializeComponent() this.Name = "About"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "About"; + this.TC_About.ResumeLayout(false); + this.Tab_Shortcuts.ResumeLayout(false); + this.Tab_Changelog.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); } #endregion - - private System.Windows.Forms.Button B_Close; - private System.Windows.Forms.RichTextBox RTB; private System.Windows.Forms.Label L_Thanks; - private System.Windows.Forms.Button B_Shortcuts; + private System.Windows.Forms.TabControl TC_About; + private System.Windows.Forms.TabPage Tab_Shortcuts; + private System.Windows.Forms.RichTextBox RTB_Shortcuts; + private System.Windows.Forms.TabPage Tab_Changelog; + private System.Windows.Forms.RichTextBox RTB_Changelog; } } \ No newline at end of file diff --git a/PKHeX.WinForms/Misc/About.cs b/PKHeX.WinForms/Misc/About.cs index 425dd6c81..575921e25 100644 --- a/PKHeX.WinForms/Misc/About.cs +++ b/PKHeX.WinForms/Misc/About.cs @@ -1,5 +1,4 @@ -using System; -using System.Windows.Forms; +using System.Windows.Forms; namespace PKHeX.WinForms { @@ -8,24 +7,9 @@ public partial class About : Form public About() { InitializeComponent(); - RTB.Text = Properties.Resources.changelog; - } - private void B_Close_Click(object sender, EventArgs e) - { - Close(); - } - private void B_Shortcuts_Click(object sender, EventArgs e) - { - if (B_Shortcuts.Text == "Shortcuts") - { - RTB.Text = Properties.Resources.shortcuts; // display shortcuts - B_Shortcuts.Text = "Changelog"; - } - else - { - RTB.Text = Properties.Resources.changelog; // display changelog - B_Shortcuts.Text = "Shortcuts"; - } + WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage); + RTB_Changelog.Text = Properties.Resources.changelog; + RTB_Shortcuts.Text = Properties.Resources.shortcuts; } } } diff --git a/PKHeX.WinForms/Misc/About.resx b/PKHeX.WinForms/Misc/About.resx index f6ff744c1..ba04893c0 100644 --- a/PKHeX.WinForms/Misc/About.resx +++ b/PKHeX.WinForms/Misc/About.resx @@ -117,16 +117,22 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - True - - - True - True - + + True + + + True + + + True + + + True + + True