added window organization

This commit is contained in:
EggMan20339 2024-02-07 09:30:20 -05:00
parent 07b8175dbd
commit cc5ff94fd3
7 changed files with 279 additions and 7 deletions

View File

@ -0,0 +1,2 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/Environment/AssemblyExplorer/XmlDocument/@EntryValue">&lt;AssemblyExplorer /&gt;</s:String></wpf:ResourceDictionary>

View File

@ -46,6 +46,12 @@
<Reference Include="System.Xml"/>
</ItemGroup>
<ItemGroup>
<Compile Include="frmAbout.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmAbout.Designer.cs">
<DependentUpon>frmAbout.cs</DependentUpon>
</Compile>
<Compile Include="frmCalculate.cs">
<SubType>Form</SubType>
</Compile>
@ -66,6 +72,9 @@
</Compile>
<Compile Include="Program.cs"/>
<Compile Include="Properties\AssemblyInfo.cs"/>
<EmbeddedResource Include="frmAbout.resx">
<DependentUpon>frmAbout.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmCalculate.resx">
<DependentUpon>frmCalculate.cs</DependentUpon>
</EmbeddedResource>

62
Chapter6/frmAbout.Designer.cs generated Normal file
View File

@ -0,0 +1,62 @@
using System.ComponentModel;
namespace Chapter6
{
partial class frmAbout
{
/// <summary>
/// Required designer variable.
/// </summary>
private 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.btnOK = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// btnOK
//
this.btnOK.Location = new System.Drawing.Point(350, 330);
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size(75, 23);
this.btnOK.TabIndex = 0;
this.btnOK.Text = "OK";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// frmAbout
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(437, 365);
this.Controls.Add(this.btnOK);
this.Name = "frmAbout";
this.Text = "frmAbout";
this.ResumeLayout(false);
}
private System.Windows.Forms.Button btnOK;
#endregion
}
}

42
Chapter6/frmAbout.cs Normal file
View File

@ -0,0 +1,42 @@
using System;
using System.Drawing;
using System.Windows.Forms;
namespace Chapter6
{
public partial class frmAbout : Form
{
public frmAbout()
{
InitializeComponent();
Text = "About";
StartPosition = FormStartPosition.CenterParent;
Size = new Size(400, 300);
var aboutLabel = new Label
{
Text = "MDI Application\nVersion Alpha 0.0.1\n©2024 EggTech\nAll rights reserved.",
TextAlign = ContentAlignment.MiddleCenter,
Dock = DockStyle.Fill
};
var closeButton = new Button
{
Text = "Close",
Dock = DockStyle.Bottom
};
closeButton.Click += (sender, e) => { Close(); };
Controls.Add(aboutLabel);
Controls.Add(closeButton);
}
private void btnOK_Click(object sender, EventArgs e)
{
Close();
}
}
}

120
Chapter6/frmAbout.resx Normal file
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>

View File

@ -123,31 +123,34 @@ namespace Chapter6
// mnuWindowArrangeIcons
//
this.mnuWindowArrangeIcons.Name = "mnuWindowArrangeIcons";
this.mnuWindowArrangeIcons.Size = new System.Drawing.Size(147, 22);
this.mnuWindowArrangeIcons.Size = new System.Drawing.Size(152, 22);
this.mnuWindowArrangeIcons.Text = "Arrange Icons";
//
// mnuWindowsCascade
//
this.mnuWindowsCascade.Name = "mnuWindowsCascade";
this.mnuWindowsCascade.Size = new System.Drawing.Size(147, 22);
this.mnuWindowsCascade.Size = new System.Drawing.Size(152, 22);
this.mnuWindowsCascade.Text = "Cascade";
this.mnuWindowsCascade.Click += new System.EventHandler(this.mnuWindowsCascade_Click);
//
// munWindowHorizontal
//
this.munWindowHorizontal.Name = "munWindowHorizontal";
this.munWindowHorizontal.Size = new System.Drawing.Size(147, 22);
this.munWindowHorizontal.Size = new System.Drawing.Size(152, 22);
this.munWindowHorizontal.Text = "Horizontal";
this.munWindowHorizontal.Click += new System.EventHandler(this.munWindowHorizontal_Click);
//
// mnuWindowVertical
//
this.mnuWindowVertical.Name = "mnuWindowVertical";
this.mnuWindowVertical.Size = new System.Drawing.Size(147, 22);
this.mnuWindowVertical.Size = new System.Drawing.Size(152, 22);
this.mnuWindowVertical.Text = "Vertical";
this.mnuWindowVertical.Click += new System.EventHandler(this.mnuWindowVertical_Click);
//
// mnuWindowCloseAll
//
this.mnuWindowCloseAll.Name = "mnuWindowCloseAll";
this.mnuWindowCloseAll.Size = new System.Drawing.Size(147, 22);
this.mnuWindowCloseAll.Size = new System.Drawing.Size(152, 22);
this.mnuWindowCloseAll.Text = "Close All";
//
// mnuHelp
@ -162,6 +165,7 @@ namespace Chapter6
this.mnuHelpAbout.Name = "mnuHelpAbout";
this.mnuHelpAbout.Size = new System.Drawing.Size(107, 22);
this.mnuHelpAbout.Text = "About";
this.mnuHelpAbout.Click += new System.EventHandler(this.mnuHelpAbout_Click);
//
// frmMain
//

View File

@ -44,7 +44,7 @@ namespace Chapter6
frmSummary aform = new frmSummary();
mnuFile.Visible = true;
mnuEditSummary.Enabled = true;
aform.MdiParent = this;
@ -52,8 +52,41 @@ namespace Chapter6
aform.Show();
aform.Focus();
mnuEditCalculate.Checked = true;
mnuEditSummary.Checked = true;
}
private void mnuHelpAbout_Click(object sender, EventArgs e)
{
frmAbout aform = new frmAbout();
mnuFile.Visible = true;
aform.MdiParent = this;
aform.StartPosition = FormStartPosition.CenterParent;
aform.Show();
aform.Focus();
mnuHelpAbout.Checked = true;
}
private void mnuWindowVertical_Click(object sender, EventArgs e)
{
this.LayoutMdi(MdiLayout.TileVertical);
}
private void munWindowHorizontal_Click(object sender, EventArgs e)
{
LayoutMdi(MdiLayout.TileHorizontal);
}
private void mnuWindowsCascade_Click(object sender, EventArgs e)
{
LayoutMdi(MdiLayout.Cascade);
}
}
}