diff --git a/CodeStatistics/CodeStatistics.csproj b/CodeStatistics/CodeStatistics.csproj index 9432a9a..95aaf0f 100644 --- a/CodeStatistics/CodeStatistics.csproj +++ b/CodeStatistics/CodeStatistics.csproj @@ -63,6 +63,12 @@ <Compile Include="Collections\CharacterRangeSet.cs" /> <Compile Include="Collections\TopElementList.cs" /> <Compile Include="Data\Lang.cs" /> + <Compile Include="Forms\AboutForm.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="Forms\AboutForm.Designer.cs"> + <DependentUpon>AboutForm.cs</DependentUpon> + </Compile> <Compile Include="Forms\FormUtils.cs" /> <Compile Include="Forms\GitHubForm.cs"> <SubType>Form</SubType> @@ -182,6 +188,9 @@ <ItemGroup> <EmbeddedResource Include="Resources\template.html" /> </ItemGroup> + <ItemGroup> + <None Include="Resources\about.rtf" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. diff --git a/CodeStatistics/Data/Lang.cs b/CodeStatistics/Data/Lang.cs index 4e683ad..37d74ca 100644 --- a/CodeStatistics/Data/Lang.cs +++ b/CodeStatistics/Data/Lang.cs @@ -8,6 +8,7 @@ namespace CodeStatistics.Data{ static Lang(){ // figure out languages later Get = new Lang{ { "Title", "Code Statistics" }, + { "TitleAbout", "About" }, { "TitleProject", "Code Statistics - Project" }, { "TitleDebug", "Code Statistics - Project Debug" }, diff --git a/CodeStatistics/Forms/AboutForm.Designer.cs b/CodeStatistics/Forms/AboutForm.Designer.cs new file mode 100644 index 0000000..df10a21 --- /dev/null +++ b/CodeStatistics/Forms/AboutForm.Designer.cs @@ -0,0 +1,67 @@ +namespace CodeStatistics.Forms { + partial class AboutForm { + /// <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.textContents = new System.Windows.Forms.RichTextBox(); + this.SuspendLayout(); + // + // textContents + // + this.textContents.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.textContents.BackColor = System.Drawing.Color.White; + this.textContents.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.textContents.Cursor = System.Windows.Forms.Cursors.Default; + this.textContents.DetectUrls = false; + this.textContents.Location = new System.Drawing.Point(12, 12); + this.textContents.Name = "textContents"; + this.textContents.ReadOnly = true; + this.textContents.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.None; + this.textContents.ShortcutsEnabled = false; + this.textContents.Size = new System.Drawing.Size(269, 285); + this.textContents.TabIndex = 0; + this.textContents.TabStop = false; + // + // AboutForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.White; + this.ClientSize = new System.Drawing.Size(293, 309); + this.Controls.Add(this.textContents); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "AboutForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.RichTextBox textContents; + } +} \ No newline at end of file diff --git a/CodeStatistics/Forms/AboutForm.cs b/CodeStatistics/Forms/AboutForm.cs new file mode 100644 index 0000000..32e26f1 --- /dev/null +++ b/CodeStatistics/Forms/AboutForm.cs @@ -0,0 +1,14 @@ +using CodeStatistics.Data; +using CodeStatistics.Properties; +using System.Windows.Forms; + +namespace CodeStatistics.Forms{ + public partial class AboutForm : Form{ + public AboutForm(){ + InitializeComponent(); + + Text = Lang.Get["TitleAbout"]; + textContents.Rtf = Resources.about; + } + } +} diff --git a/CodeStatistics/Forms/MainForm.Designer.cs b/CodeStatistics/Forms/MainForm.Designer.cs index 95c1cb8..24b383d 100644 --- a/CodeStatistics/Forms/MainForm.Designer.cs +++ b/CodeStatistics/Forms/MainForm.Designer.cs @@ -88,6 +88,7 @@ this.btnViewAbout.Size = new System.Drawing.Size(150, 37); this.btnViewAbout.TabIndex = 3; this.btnViewAbout.UseVisualStyleBackColor = false; + this.btnViewAbout.Click += new System.EventHandler(this.btnViewAbout_Click); // // tableBottomPanel // diff --git a/CodeStatistics/Forms/MainForm.cs b/CodeStatistics/Forms/MainForm.cs index 9142d86..5ceb254 100644 --- a/CodeStatistics/Forms/MainForm.cs +++ b/CodeStatistics/Forms/MainForm.cs @@ -92,5 +92,9 @@ namespace CodeStatistics.Forms{ private void btnViewSourceCode_Click(object sender, EventArgs e){ Process.Start("https://github.com/chylex/Code-Statistics"); } + + private void btnViewAbout_Click(object sender, EventArgs e){ + new AboutForm().ShowDialog(); + } } } diff --git a/CodeStatistics/Properties/Resources.Designer.cs b/CodeStatistics/Properties/Resources.Designer.cs index 24d4c61..ee00819 100644 --- a/CodeStatistics/Properties/Resources.Designer.cs +++ b/CodeStatistics/Properties/Resources.Designer.cs @@ -60,6 +60,16 @@ namespace CodeStatistics.Properties { } } + /// <summary> + /// </summary> + internal static string about { + get { + return ResourceManager.GetString("about", resourceCulture); + } + } + + /// <summary> + /// </summary> internal static string template { get { return ResourceManager.GetString("template", resourceCulture); diff --git a/CodeStatistics/Properties/Resources.resx b/CodeStatistics/Properties/Resources.resx index 96255ce..79b26d2 100644 --- a/CodeStatistics/Properties/Resources.resx +++ b/CodeStatistics/Properties/Resources.resx @@ -118,6 +118,9 @@ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> + <data name="about" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\about.rtf;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;windows-1250</value> + </data> <data name="template" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\Resources\template.html;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;windows-1250</value> </data> diff --git a/CodeStatistics/Resources/about.rtf b/CodeStatistics/Resources/about.rtf new file mode 100644 index 0000000..30c5e68 Binary files /dev/null and b/CodeStatistics/Resources/about.rtf differ