diff --git a/CustomControls/RecipeInformation.Designer.cs b/CustomControls/RecipeInformation.Designer.cs new file mode 100644 index 0000000..9648ea2 --- /dev/null +++ b/CustomControls/RecipeInformation.Designer.cs @@ -0,0 +1,508 @@ +namespace Recipsio +{ + partial class RecipeInformation + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + RecipeHeaderLayout = new System.Windows.Forms.TableLayoutPanel(); + AuthorGroupBox = new System.Windows.Forms.GroupBox(); + RecipeAuthor = new System.Windows.Forms.RichTextBox(); + CookTime = new System.Windows.Forms.GroupBox(); + CookTimeLayout = new System.Windows.Forms.TableLayoutPanel(); + CookDays = new System.Windows.Forms.Label(); + CookMinutes = new System.Windows.Forms.Label(); + CookHours = new System.Windows.Forms.Label(); + TotalTime = new System.Windows.Forms.GroupBox(); + panel1 = new System.Windows.Forms.Panel(); + TotalTimeValue = new System.Windows.Forms.Label(); + NameGroupBox = new System.Windows.Forms.GroupBox(); + RecipeName = new System.Windows.Forms.RichTextBox(); + PrepTime = new System.Windows.Forms.GroupBox(); + PrepTimeLayout = new System.Windows.Forms.TableLayoutPanel(); + PrepHours = new System.Windows.Forms.Label(); + PrepMinutes = new System.Windows.Forms.Label(); + RecipeInformationLayout = new System.Windows.Forms.TableLayoutPanel(); + DescriptionLabel = new System.Windows.Forms.Label(); + RecipeDescription = new System.Windows.Forms.RichTextBox(); + IngredientControlsLayout = new System.Windows.Forms.TableLayoutPanel(); + IngredientsLabel = new System.Windows.Forms.Label(); + AddIngredient = new System.Windows.Forms.Button(); + RemoveIngredient = new System.Windows.Forms.Button(); + RecipeIngredients = new System.Windows.Forms.ListBox(); + RecipeDirections = new System.Windows.Forms.ListBox(); + DirectionsControlsLayout = new System.Windows.Forms.TableLayoutPanel(); + DirectionsLabel = new System.Windows.Forms.Label(); + AddDirection = new System.Windows.Forms.Button(); + RemoveDirection = new System.Windows.Forms.Button(); + RecipeHeaderLayout.SuspendLayout(); + AuthorGroupBox.SuspendLayout(); + CookTime.SuspendLayout(); + CookTimeLayout.SuspendLayout(); + TotalTime.SuspendLayout(); + panel1.SuspendLayout(); + NameGroupBox.SuspendLayout(); + PrepTimeLayout.SuspendLayout(); + RecipeInformationLayout.SuspendLayout(); + IngredientControlsLayout.SuspendLayout(); + DirectionsControlsLayout.SuspendLayout(); + SuspendLayout(); + // + // RecipeHeaderLayout + // + RecipeHeaderLayout.ColumnCount = 3; + RecipeHeaderLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); + RecipeHeaderLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.3333359F)); + RecipeHeaderLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.3333359F)); + RecipeHeaderLayout.Controls.Add(AuthorGroupBox, 2, 0); + RecipeHeaderLayout.Controls.Add(CookTime, 1, 1); + RecipeHeaderLayout.Controls.Add(TotalTime, 2, 1); + RecipeHeaderLayout.Controls.Add(NameGroupBox, 0, 0); + RecipeHeaderLayout.Location = new System.Drawing.Point(0, 0); + RecipeHeaderLayout.Name = "RecipeHeaderLayout"; + RecipeHeaderLayout.RowCount = 2; + RecipeHeaderLayout.Size = new System.Drawing.Size(200, 100); + RecipeHeaderLayout.TabIndex = 0; + // + // AuthorGroupBox + // + AuthorGroupBox.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + AuthorGroupBox.Controls.Add(RecipeAuthor); + AuthorGroupBox.Location = new System.Drawing.Point(136, 3); + AuthorGroupBox.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + AuthorGroupBox.Name = "AuthorGroupBox"; + AuthorGroupBox.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3); + AuthorGroupBox.Size = new System.Drawing.Size(60, 49); + AuthorGroupBox.TabIndex = 22; + AuthorGroupBox.TabStop = false; + AuthorGroupBox.Text = "Author"; + // + // RecipeAuthor + // + RecipeAuthor.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + RecipeAuthor.Location = new System.Drawing.Point(9, 16); + RecipeAuthor.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + RecipeAuthor.Name = "RecipeAuthor"; + RecipeAuthor.Size = new System.Drawing.Size(104, 0); + RecipeAuthor.TabIndex = 0; + RecipeAuthor.Tag = "Author"; + RecipeAuthor.Text = ""; + // + // CookTime + // + CookTime.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + CookTime.Controls.Add(CookTimeLayout); + CookTime.Location = new System.Drawing.Point(68, 58); + CookTime.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3); + CookTime.Name = "CookTime"; + CookTime.Padding = new System.Windows.Forms.Padding(2, 3, 2, 3); + CookTime.Size = new System.Drawing.Size(62, 41); + CookTime.TabIndex = 19; + CookTime.TabStop = false; + CookTime.Tag = "Cook Time"; + CookTime.Text = "Cook Time"; + // + // CookTimeLayout + // + CookTimeLayout.ColumnCount = 3; + CookTimeLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.3333321F)); + CookTimeLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.3333321F)); + CookTimeLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.3333321F)); + CookTimeLayout.Controls.Add(CookDays, 0, 0); + CookTimeLayout.Controls.Add(CookMinutes, 2, 0); + CookTimeLayout.Controls.Add(CookHours, 1, 0); + CookTimeLayout.Dock = System.Windows.Forms.DockStyle.Fill; + CookTimeLayout.Location = new System.Drawing.Point(2, 19); + CookTimeLayout.Name = "CookTimeLayout"; + CookTimeLayout.RowCount = 1; + CookTimeLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + CookTimeLayout.Size = new System.Drawing.Size(58, 19); + CookTimeLayout.TabIndex = 2; + // + // CookDays + // + CookDays.Dock = System.Windows.Forms.DockStyle.Fill; + CookDays.Location = new System.Drawing.Point(4, 0); + CookDays.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + CookDays.Name = "CookDays"; + CookDays.Size = new System.Drawing.Size(11, 19); + CookDays.TabIndex = 6; + CookDays.Tag = "Days"; + CookDays.Text = "0 Days"; + CookDays.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // CookMinutes + // + CookMinutes.Dock = System.Windows.Forms.DockStyle.Fill; + CookMinutes.Location = new System.Drawing.Point(42, 0); + CookMinutes.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + CookMinutes.Name = "CookMinutes"; + CookMinutes.Size = new System.Drawing.Size(12, 19); + CookMinutes.TabIndex = 8; + CookMinutes.Tag = "Minutes"; + CookMinutes.Text = "0 Minutes"; + CookMinutes.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // CookHours + // + CookHours.Dock = System.Windows.Forms.DockStyle.Fill; + CookHours.Location = new System.Drawing.Point(23, 0); + CookHours.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + CookHours.Name = "CookHours"; + CookHours.Size = new System.Drawing.Size(11, 19); + CookHours.TabIndex = 7; + CookHours.Tag = "Hours"; + CookHours.Text = "0 Hours"; + CookHours.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // TotalTime + // + TotalTime.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + TotalTime.Controls.Add(panel1); + TotalTime.Location = new System.Drawing.Point(136, 58); + TotalTime.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + TotalTime.Name = "TotalTime"; + TotalTime.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3); + TotalTime.Size = new System.Drawing.Size(60, 41); + TotalTime.TabIndex = 20; + TotalTime.TabStop = false; + TotalTime.Text = "Total Time"; + // + // panel1 + // + panel1.Controls.Add(TotalTimeValue); + panel1.Dock = System.Windows.Forms.DockStyle.Fill; + panel1.Location = new System.Drawing.Point(4, 19); + panel1.Name = "panel1"; + panel1.Size = new System.Drawing.Size(52, 19); + panel1.TabIndex = 2; + // + // TotalTimeValue + // + TotalTimeValue.Dock = System.Windows.Forms.DockStyle.Fill; + TotalTimeValue.Location = new System.Drawing.Point(0, 0); + TotalTimeValue.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + TotalTimeValue.Name = "TotalTimeValue"; + TotalTimeValue.Size = new System.Drawing.Size(52, 19); + TotalTimeValue.TabIndex = 1; + TotalTimeValue.Text = "0 Days 0 Hours 0 Minutes"; + TotalTimeValue.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // NameGroupBox + // + NameGroupBox.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + RecipeHeaderLayout.SetColumnSpan(NameGroupBox, 2); + NameGroupBox.Controls.Add(RecipeName); + NameGroupBox.Location = new System.Drawing.Point(4, 3); + NameGroupBox.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + NameGroupBox.Name = "NameGroupBox"; + NameGroupBox.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3); + NameGroupBox.Size = new System.Drawing.Size(124, 49); + NameGroupBox.TabIndex = 2; + NameGroupBox.TabStop = false; + NameGroupBox.Text = "Name"; + // + // RecipeName + // + RecipeName.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + RecipeName.Location = new System.Drawing.Point(9, 16); + RecipeName.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + RecipeName.Multiline = false; + RecipeName.Name = "RecipeName"; + RecipeName.Size = new System.Drawing.Size(435, 0); + RecipeName.TabIndex = 0; + RecipeName.Tag = "Name"; + RecipeName.Text = ""; + // + // PrepTime + // + PrepTime.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + PrepTime.Location = new System.Drawing.Point(0, 0); + PrepTime.Name = "PrepTime"; + PrepTime.Size = new System.Drawing.Size(200, 100); + PrepTime.TabIndex = 0; + PrepTime.TabStop = false; + // + // PrepTimeLayout + // + PrepTimeLayout.ColumnCount = 3; + PrepTimeLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.3333321F)); + PrepTimeLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.3333359F)); + PrepTimeLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.3333359F)); + PrepTimeLayout.Controls.Add(PrepHours, 0, 0); + PrepTimeLayout.Location = new System.Drawing.Point(0, 0); + PrepTimeLayout.Name = "PrepTimeLayout"; + PrepTimeLayout.RowCount = 1; + PrepTimeLayout.Size = new System.Drawing.Size(200, 100); + PrepTimeLayout.TabIndex = 0; + // + // PrepHours + // + PrepHours.Dock = System.Windows.Forms.DockStyle.Fill; + PrepHours.Location = new System.Drawing.Point(4, 0); + PrepHours.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + PrepHours.Name = "PrepHours"; + PrepHours.Size = new System.Drawing.Size(58, 100); + PrepHours.TabIndex = 3; + PrepHours.Tag = "Days"; + PrepHours.Text = "0 Hours"; + PrepHours.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // PrepMinutes + // + PrepMinutes.Dock = System.Windows.Forms.DockStyle.Fill; + PrepMinutes.Location = new System.Drawing.Point(70, 0); + PrepMinutes.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + PrepMinutes.Name = "PrepMinutes"; + PrepMinutes.Size = new System.Drawing.Size(80, 21); + PrepMinutes.TabIndex = 4; + PrepMinutes.Tag = "Hours"; + PrepMinutes.Text = "0 Minutes"; + PrepMinutes.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // RecipeInformationLayout + // + RecipeInformationLayout.ColumnCount = 2; + RecipeInformationLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 95F)); + RecipeInformationLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + RecipeInformationLayout.Controls.Add(DescriptionLabel, 0, 0); + RecipeInformationLayout.Controls.Add(RecipeDescription, 1, 0); + RecipeInformationLayout.Controls.Add(IngredientControlsLayout, 0, 1); + RecipeInformationLayout.Controls.Add(RecipeIngredients, 1, 1); + RecipeInformationLayout.Controls.Add(RecipeDirections, 1, 2); + RecipeInformationLayout.Controls.Add(DirectionsControlsLayout, 0, 2); + RecipeInformationLayout.Dock = System.Windows.Forms.DockStyle.Fill; + RecipeInformationLayout.Location = new System.Drawing.Point(0, 0); + RecipeInformationLayout.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + RecipeInformationLayout.Name = "RecipeInformationLayout"; + RecipeInformationLayout.RowCount = 3; + RecipeInformationLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.3333321F)); + RecipeInformationLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.3333359F)); + RecipeInformationLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.3333321F)); + RecipeInformationLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + RecipeInformationLayout.Size = new System.Drawing.Size(470, 406); + RecipeInformationLayout.TabIndex = 1; + // + // DescriptionLabel + // + DescriptionLabel.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + DescriptionLabel.Location = new System.Drawing.Point(2, 0); + DescriptionLabel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + DescriptionLabel.Name = "DescriptionLabel"; + DescriptionLabel.Size = new System.Drawing.Size(88, 18); + DescriptionLabel.TabIndex = 1; + DescriptionLabel.Text = "&Description"; + // + // RecipeDescription + // + RecipeDescription.Dock = System.Windows.Forms.DockStyle.Fill; + RecipeDescription.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + RecipeDescription.Location = new System.Drawing.Point(97, 3); + RecipeDescription.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3); + RecipeDescription.Name = "RecipeDescription"; + RecipeDescription.Size = new System.Drawing.Size(371, 129); + RecipeDescription.TabIndex = 17; + RecipeDescription.Tag = "Description"; + RecipeDescription.Text = ""; + // + // IngredientControlsLayout + // + IngredientControlsLayout.ColumnCount = 1; + IngredientControlsLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + IngredientControlsLayout.Controls.Add(IngredientsLabel, 0, 0); + IngredientControlsLayout.Controls.Add(AddIngredient, 0, 1); + IngredientControlsLayout.Controls.Add(RemoveIngredient, 0, 2); + IngredientControlsLayout.Location = new System.Drawing.Point(0, 135); + IngredientControlsLayout.Margin = new System.Windows.Forms.Padding(0); + IngredientControlsLayout.Name = "IngredientControlsLayout"; + IngredientControlsLayout.RowCount = 3; + IngredientControlsLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.3333321F)); + IngredientControlsLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.3333321F)); + IngredientControlsLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.3333321F)); + IngredientControlsLayout.Size = new System.Drawing.Size(95, 87); + IngredientControlsLayout.TabIndex = 22; + // + // IngredientsLabel + // + IngredientsLabel.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + IngredientsLabel.Location = new System.Drawing.Point(2, 0); + IngredientsLabel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + IngredientsLabel.Name = "IngredientsLabel"; + IngredientsLabel.Size = new System.Drawing.Size(84, 18); + IngredientsLabel.TabIndex = 19; + IngredientsLabel.Text = "&Ingredients"; + // + // AddIngredient + // + AddIngredient.Dock = System.Windows.Forms.DockStyle.Fill; + AddIngredient.Location = new System.Drawing.Point(3, 32); + AddIngredient.Name = "AddIngredient"; + AddIngredient.Size = new System.Drawing.Size(89, 23); + AddIngredient.TabIndex = 20; + AddIngredient.Text = "Add"; + AddIngredient.UseVisualStyleBackColor = true; + AddIngredient.Click += Add_Recipe_Ingredient_Click; + // + // RemoveIngredient + // + RemoveIngredient.Dock = System.Windows.Forms.DockStyle.Fill; + RemoveIngredient.Location = new System.Drawing.Point(3, 61); + RemoveIngredient.Name = "RemoveIngredient"; + RemoveIngredient.Size = new System.Drawing.Size(89, 23); + RemoveIngredient.TabIndex = 21; + RemoveIngredient.Text = "Remove"; + RemoveIngredient.UseVisualStyleBackColor = true; + RemoveIngredient.Click += Remove_Ingredient_Click; + // + // RecipeIngredients + // + RecipeIngredients.Dock = System.Windows.Forms.DockStyle.Fill; + RecipeIngredients.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + RecipeIngredients.FormattingEnabled = true; + RecipeIngredients.ItemHeight = 15; + RecipeIngredients.Location = new System.Drawing.Point(98, 138); + RecipeIngredients.Name = "RecipeIngredients"; + RecipeIngredients.Size = new System.Drawing.Size(369, 129); + RecipeIngredients.TabIndex = 23; + RecipeIngredients.Tag = "Ingredients"; + // + // RecipeDirections + // + RecipeDirections.Dock = System.Windows.Forms.DockStyle.Fill; + RecipeDirections.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + RecipeDirections.FormattingEnabled = true; + RecipeDirections.ItemHeight = 15; + RecipeDirections.Location = new System.Drawing.Point(98, 273); + RecipeDirections.Name = "RecipeDirections"; + RecipeDirections.Size = new System.Drawing.Size(369, 130); + RecipeDirections.TabIndex = 24; + RecipeDirections.Tag = "Directions"; + // + // DirectionsControlsLayout + // + DirectionsControlsLayout.ColumnCount = 1; + DirectionsControlsLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + DirectionsControlsLayout.Controls.Add(DirectionsLabel, 0, 0); + DirectionsControlsLayout.Controls.Add(AddDirection, 0, 1); + DirectionsControlsLayout.Controls.Add(RemoveDirection, 0, 2); + DirectionsControlsLayout.Location = new System.Drawing.Point(3, 273); + DirectionsControlsLayout.Name = "DirectionsControlsLayout"; + DirectionsControlsLayout.RowCount = 3; + DirectionsControlsLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.3333321F)); + DirectionsControlsLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.3333321F)); + DirectionsControlsLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.3333321F)); + DirectionsControlsLayout.Size = new System.Drawing.Size(89, 87); + DirectionsControlsLayout.TabIndex = 25; + // + // DirectionsLabel + // + DirectionsLabel.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + DirectionsLabel.Location = new System.Drawing.Point(2, 0); + DirectionsLabel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + DirectionsLabel.Name = "DirectionsLabel"; + DirectionsLabel.Size = new System.Drawing.Size(79, 18); + DirectionsLabel.TabIndex = 18; + DirectionsLabel.Text = "&Directions"; + // + // AddDirection + // + AddDirection.Dock = System.Windows.Forms.DockStyle.Fill; + AddDirection.Location = new System.Drawing.Point(3, 32); + AddDirection.Name = "AddDirection"; + AddDirection.Size = new System.Drawing.Size(83, 23); + AddDirection.TabIndex = 19; + AddDirection.Text = "Add"; + AddDirection.UseVisualStyleBackColor = true; + AddDirection.Click += Add_Recipe_Description_Click; + // + // RemoveDirection + // + RemoveDirection.Dock = System.Windows.Forms.DockStyle.Fill; + RemoveDirection.Location = new System.Drawing.Point(3, 61); + RemoveDirection.Name = "RemoveDirection"; + RemoveDirection.Size = new System.Drawing.Size(83, 23); + RemoveDirection.TabIndex = 20; + RemoveDirection.Text = "Remove"; + RemoveDirection.UseVisualStyleBackColor = true; + RemoveDirection.Click += Remove_Recipe_Description_Click; + // + // RecipeInformation + // + AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + BackColor = System.Drawing.Color.FromArgb(252, 245, 229); + Controls.Add(RecipeInformationLayout); + Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + Name = "RecipeInformation"; + Size = new System.Drawing.Size(470, 406); + RecipeHeaderLayout.ResumeLayout(false); + AuthorGroupBox.ResumeLayout(false); + CookTime.ResumeLayout(false); + CookTimeLayout.ResumeLayout(false); + TotalTime.ResumeLayout(false); + panel1.ResumeLayout(false); + NameGroupBox.ResumeLayout(false); + PrepTimeLayout.ResumeLayout(false); + RecipeInformationLayout.ResumeLayout(false); + IngredientControlsLayout.ResumeLayout(false); + DirectionsControlsLayout.ResumeLayout(false); + ResumeLayout(false); + } + + #endregion + + private System.Windows.Forms.TableLayoutPanel RecipeHeaderLayout; + public System.Windows.Forms.GroupBox AuthorGroupBox; + public System.Windows.Forms.RichTextBox RecipeAuthor; + public System.Windows.Forms.GroupBox CookTime; + public System.Windows.Forms.TableLayoutPanel CookTimeLayout; + public System.Windows.Forms.Label CookDays; + public System.Windows.Forms.Label CookMinutes; + public System.Windows.Forms.Label CookHours; + public System.Windows.Forms.GroupBox TotalTime; + public System.Windows.Forms.Panel panel1; + public System.Windows.Forms.Label TotalTimeValue; + public System.Windows.Forms.GroupBox NameGroupBox; + public System.Windows.Forms.RichTextBox RecipeName; + private System.Windows.Forms.GroupBox PrepTime; + private System.Windows.Forms.TableLayoutPanel PrepTimeLayout; + public System.Windows.Forms.Label PrepHours; + public System.Windows.Forms.Label PrepMinutes; + public System.Windows.Forms.TableLayoutPanel RecipeInformationLayout; + public System.Windows.Forms.Label DescriptionLabel; + public System.Windows.Forms.RichTextBox RecipeDescription; + public System.Windows.Forms.TableLayoutPanel IngredientControlsLayout; + public System.Windows.Forms.Label IngredientsLabel; + public System.Windows.Forms.Button AddIngredient; + public System.Windows.Forms.Button RemoveIngredient; + public System.Windows.Forms.ListBox RecipeIngredients; + public System.Windows.Forms.ListBox RecipeDirections; + public System.Windows.Forms.TableLayoutPanel DirectionsControlsLayout; + public System.Windows.Forms.Label DirectionsLabel; + public System.Windows.Forms.Button AddDirection; + public System.Windows.Forms.Button RemoveDirection; + } +} diff --git a/CustomControls/RecipeInformation.cs b/CustomControls/RecipeInformation.cs new file mode 100644 index 0000000..b0b6f3d --- /dev/null +++ b/CustomControls/RecipeInformation.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Recipsio +{ + public partial class RecipeInformation : UserControl + { + public MainForm? MF; + public Toolbox? TB; + public RecipeInformation() + { + InitializeComponent(); + } + private void Add_Recipe_Ingredient_Click(object Sender, EventArgs E) + { + RecipeIngredientForm AIF = new(MF!, TB!); + AIF.ShowDialog(this); + } + private void Remove_Ingredient_Click(object Sender, EventArgs E) + { + if (RecipeIngredients.SelectedItem != null) + { + RecipeIngredients.Items.Remove(RecipeIngredients.SelectedItem); + } + } + private void Add_Recipe_Description_Click(object Sender, EventArgs e) + { + RecipeDirectionForm RDF = new(MF!, TB!); + RDF.ShowDialog(this); + } + private void Remove_Recipe_Description_Click(object Sender, EventArgs e) + { + if (RecipeDirections.SelectedItem != null) + { + RecipeDirections.Items.Remove(RecipeDirections.SelectedItem); + } + } + } +} diff --git a/CustomControls/RecipeInformation.resx b/CustomControls/RecipeInformation.resx new file mode 100644 index 0000000..af32865 --- /dev/null +++ b/CustomControls/RecipeInformation.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/CustomControls/Toolstrip.Designer.cs b/CustomControls/Toolstrip.Designer.cs new file mode 100644 index 0000000..5b2700f --- /dev/null +++ b/CustomControls/Toolstrip.Designer.cs @@ -0,0 +1,469 @@ +namespace Recipsio +{ + partial class Toolstrip + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + RecipeHeaderLayout = new System.Windows.Forms.TableLayoutPanel(); + AuthorGroupBox = new System.Windows.Forms.GroupBox(); + RecipeAuthor = new System.Windows.Forms.RichTextBox(); + CookTime = new System.Windows.Forms.GroupBox(); + CookTimeLayout = new System.Windows.Forms.TableLayoutPanel(); + CookDays = new System.Windows.Forms.Label(); + CookMinutes = new System.Windows.Forms.Label(); + CookHours = new System.Windows.Forms.Label(); + TotalTime = new System.Windows.Forms.GroupBox(); + panel1 = new System.Windows.Forms.Panel(); + TotalTimeValue = new System.Windows.Forms.Label(); + NameGroupBox = new System.Windows.Forms.GroupBox(); + RecipeName = new System.Windows.Forms.RichTextBox(); + PrepTime = new System.Windows.Forms.GroupBox(); + PrepTimeLayout = new System.Windows.Forms.TableLayoutPanel(); + PrepHours = new System.Windows.Forms.Label(); + PrepMinutes = new System.Windows.Forms.Label(); + MainToolStrip = new System.Windows.Forms.ToolStrip(); + ApplicationActions = new System.Windows.Forms.ToolStripDropDownButton(); + NewRecipeAction = new System.Windows.Forms.ToolStripMenuItem(); + SaveRecipeAction = new System.Windows.Forms.ToolStripMenuItem(); + DeleteRecipeAction = new System.Windows.Forms.ToolStripMenuItem(); + ApplicationActionsSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + ApplicationIngredientsAction = new System.Windows.Forms.ToolStripMenuItem(); + ApplicationTagsAction = new System.Windows.Forms.ToolStripMenuItem(); + ApplicationActionsSeparator2 = new System.Windows.Forms.ToolStripSeparator(); + SettingsAction = new System.Windows.Forms.ToolStripMenuItem(); + HelpAction = new System.Windows.Forms.ToolStripMenuItem(); + MainToolstripSeparator = new System.Windows.Forms.ToolStripSeparator(); + RecipeActions = new System.Windows.Forms.ToolStripDropDownButton(); + RecipeTagsAction = new System.Windows.Forms.ToolStripMenuItem(); + RecipeImagesAction = new System.Windows.Forms.ToolStripMenuItem(); + ExportShoppingListAction = new System.Windows.Forms.ToolStripMenuItem(); + toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + RecipeHeaderLayout.SuspendLayout(); + AuthorGroupBox.SuspendLayout(); + CookTime.SuspendLayout(); + CookTimeLayout.SuspendLayout(); + TotalTime.SuspendLayout(); + panel1.SuspendLayout(); + NameGroupBox.SuspendLayout(); + PrepTimeLayout.SuspendLayout(); + MainToolStrip.SuspendLayout(); + SuspendLayout(); + // + // RecipeHeaderLayout + // + RecipeHeaderLayout.ColumnCount = 3; + RecipeHeaderLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); + RecipeHeaderLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.3333359F)); + RecipeHeaderLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.3333359F)); + RecipeHeaderLayout.Controls.Add(AuthorGroupBox, 2, 0); + RecipeHeaderLayout.Controls.Add(CookTime, 1, 1); + RecipeHeaderLayout.Controls.Add(TotalTime, 2, 1); + RecipeHeaderLayout.Controls.Add(NameGroupBox, 0, 0); + RecipeHeaderLayout.Location = new System.Drawing.Point(0, 0); + RecipeHeaderLayout.Name = "RecipeHeaderLayout"; + RecipeHeaderLayout.RowCount = 2; + RecipeHeaderLayout.Size = new System.Drawing.Size(200, 100); + RecipeHeaderLayout.TabIndex = 0; + // + // AuthorGroupBox + // + AuthorGroupBox.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + AuthorGroupBox.Controls.Add(RecipeAuthor); + AuthorGroupBox.Location = new System.Drawing.Point(136, 3); + AuthorGroupBox.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + AuthorGroupBox.Name = "AuthorGroupBox"; + AuthorGroupBox.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3); + AuthorGroupBox.Size = new System.Drawing.Size(60, 49); + AuthorGroupBox.TabIndex = 22; + AuthorGroupBox.TabStop = false; + AuthorGroupBox.Text = "Author"; + // + // RecipeAuthor + // + RecipeAuthor.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + RecipeAuthor.Location = new System.Drawing.Point(9, 16); + RecipeAuthor.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + RecipeAuthor.Name = "RecipeAuthor"; + RecipeAuthor.Size = new System.Drawing.Size(104, 0); + RecipeAuthor.TabIndex = 0; + RecipeAuthor.Tag = "Author"; + RecipeAuthor.Text = ""; + // + // CookTime + // + CookTime.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + CookTime.Controls.Add(CookTimeLayout); + CookTime.Location = new System.Drawing.Point(68, 58); + CookTime.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3); + CookTime.Name = "CookTime"; + CookTime.Padding = new System.Windows.Forms.Padding(2, 3, 2, 3); + CookTime.Size = new System.Drawing.Size(62, 41); + CookTime.TabIndex = 19; + CookTime.TabStop = false; + CookTime.Tag = "Cook Time"; + CookTime.Text = "Cook Time"; + // + // CookTimeLayout + // + CookTimeLayout.ColumnCount = 3; + CookTimeLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.3333321F)); + CookTimeLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.3333321F)); + CookTimeLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.3333321F)); + CookTimeLayout.Controls.Add(CookDays, 0, 0); + CookTimeLayout.Controls.Add(CookMinutes, 2, 0); + CookTimeLayout.Controls.Add(CookHours, 1, 0); + CookTimeLayout.Dock = System.Windows.Forms.DockStyle.Fill; + CookTimeLayout.Location = new System.Drawing.Point(2, 19); + CookTimeLayout.Name = "CookTimeLayout"; + CookTimeLayout.RowCount = 1; + CookTimeLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + CookTimeLayout.Size = new System.Drawing.Size(58, 19); + CookTimeLayout.TabIndex = 2; + // + // CookDays + // + CookDays.Dock = System.Windows.Forms.DockStyle.Fill; + CookDays.Location = new System.Drawing.Point(4, 0); + CookDays.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + CookDays.Name = "CookDays"; + CookDays.Size = new System.Drawing.Size(11, 19); + CookDays.TabIndex = 6; + CookDays.Tag = "Days"; + CookDays.Text = "0 Days"; + CookDays.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // CookMinutes + // + CookMinutes.Dock = System.Windows.Forms.DockStyle.Fill; + CookMinutes.Location = new System.Drawing.Point(42, 0); + CookMinutes.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + CookMinutes.Name = "CookMinutes"; + CookMinutes.Size = new System.Drawing.Size(12, 19); + CookMinutes.TabIndex = 8; + CookMinutes.Tag = "Minutes"; + CookMinutes.Text = "0 Minutes"; + CookMinutes.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // CookHours + // + CookHours.Dock = System.Windows.Forms.DockStyle.Fill; + CookHours.Location = new System.Drawing.Point(23, 0); + CookHours.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + CookHours.Name = "CookHours"; + CookHours.Size = new System.Drawing.Size(11, 19); + CookHours.TabIndex = 7; + CookHours.Tag = "Hours"; + CookHours.Text = "0 Hours"; + CookHours.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // TotalTime + // + TotalTime.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + TotalTime.Controls.Add(panel1); + TotalTime.Location = new System.Drawing.Point(136, 58); + TotalTime.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + TotalTime.Name = "TotalTime"; + TotalTime.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3); + TotalTime.Size = new System.Drawing.Size(60, 41); + TotalTime.TabIndex = 20; + TotalTime.TabStop = false; + TotalTime.Text = "Total Time"; + // + // panel1 + // + panel1.Controls.Add(TotalTimeValue); + panel1.Dock = System.Windows.Forms.DockStyle.Fill; + panel1.Location = new System.Drawing.Point(4, 19); + panel1.Name = "panel1"; + panel1.Size = new System.Drawing.Size(52, 19); + panel1.TabIndex = 2; + // + // TotalTimeValue + // + TotalTimeValue.Dock = System.Windows.Forms.DockStyle.Fill; + TotalTimeValue.Location = new System.Drawing.Point(0, 0); + TotalTimeValue.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + TotalTimeValue.Name = "TotalTimeValue"; + TotalTimeValue.Size = new System.Drawing.Size(52, 19); + TotalTimeValue.TabIndex = 1; + TotalTimeValue.Text = "0 Days 0 Hours 0 Minutes"; + TotalTimeValue.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // NameGroupBox + // + NameGroupBox.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + RecipeHeaderLayout.SetColumnSpan(NameGroupBox, 2); + NameGroupBox.Controls.Add(RecipeName); + NameGroupBox.Location = new System.Drawing.Point(4, 3); + NameGroupBox.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + NameGroupBox.Name = "NameGroupBox"; + NameGroupBox.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3); + NameGroupBox.Size = new System.Drawing.Size(124, 49); + NameGroupBox.TabIndex = 2; + NameGroupBox.TabStop = false; + NameGroupBox.Text = "Name"; + // + // RecipeName + // + RecipeName.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + RecipeName.Location = new System.Drawing.Point(9, 16); + RecipeName.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + RecipeName.Multiline = false; + RecipeName.Name = "RecipeName"; + RecipeName.Size = new System.Drawing.Size(435, 0); + RecipeName.TabIndex = 0; + RecipeName.Tag = "Name"; + RecipeName.Text = ""; + // + // PrepTime + // + PrepTime.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + PrepTime.Location = new System.Drawing.Point(0, 0); + PrepTime.Name = "PrepTime"; + PrepTime.Size = new System.Drawing.Size(200, 100); + PrepTime.TabIndex = 0; + PrepTime.TabStop = false; + // + // PrepTimeLayout + // + PrepTimeLayout.ColumnCount = 3; + PrepTimeLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.3333321F)); + PrepTimeLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.3333359F)); + PrepTimeLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.3333359F)); + PrepTimeLayout.Controls.Add(PrepHours, 0, 0); + PrepTimeLayout.Location = new System.Drawing.Point(0, 0); + PrepTimeLayout.Name = "PrepTimeLayout"; + PrepTimeLayout.RowCount = 1; + PrepTimeLayout.Size = new System.Drawing.Size(200, 100); + PrepTimeLayout.TabIndex = 0; + // + // PrepHours + // + PrepHours.Dock = System.Windows.Forms.DockStyle.Fill; + PrepHours.Location = new System.Drawing.Point(4, 0); + PrepHours.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + PrepHours.Name = "PrepHours"; + PrepHours.Size = new System.Drawing.Size(58, 100); + PrepHours.TabIndex = 3; + PrepHours.Tag = "Days"; + PrepHours.Text = "0 Hours"; + PrepHours.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // PrepMinutes + // + PrepMinutes.Dock = System.Windows.Forms.DockStyle.Fill; + PrepMinutes.Location = new System.Drawing.Point(70, 0); + PrepMinutes.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + PrepMinutes.Name = "PrepMinutes"; + PrepMinutes.Size = new System.Drawing.Size(80, 21); + PrepMinutes.TabIndex = 4; + PrepMinutes.Tag = "Hours"; + PrepMinutes.Text = "0 Minutes"; + PrepMinutes.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // MainToolStrip + // + MainToolStrip.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; + MainToolStrip.Dock = System.Windows.Forms.DockStyle.Fill; + MainToolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; + MainToolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { ApplicationActions, MainToolstripSeparator, RecipeActions, toolStripSeparator1 }); + MainToolStrip.Location = new System.Drawing.Point(0, 0); + MainToolStrip.Name = "MainToolStrip"; + MainToolStrip.Size = new System.Drawing.Size(197, 49); + MainToolStrip.TabIndex = 5; + MainToolStrip.Text = "toolStrip1"; + // + // ApplicationActions + // + ApplicationActions.AutoSize = false; + ApplicationActions.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + ApplicationActions.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { NewRecipeAction, SaveRecipeAction, DeleteRecipeAction, ApplicationActionsSeparator1, ApplicationIngredientsAction, ApplicationTagsAction, ApplicationActionsSeparator2, SettingsAction, HelpAction }); + ApplicationActions.ImageTransparentColor = System.Drawing.Color.Magenta; + ApplicationActions.Name = "ApplicationActions"; + ApplicationActions.Size = new System.Drawing.Size(81, 25); + ApplicationActions.Text = "Application"; + // + // NewRecipeAction + // + NewRecipeAction.AutoSize = false; + NewRecipeAction.Name = "NewRecipeAction"; + NewRecipeAction.Size = new System.Drawing.Size(180, 22); + NewRecipeAction.Text = "New Recipe"; + NewRecipeAction.Click += Create_New_Recipe_Click; + // + // SaveRecipeAction + // + SaveRecipeAction.AutoSize = false; + SaveRecipeAction.Name = "SaveRecipeAction"; + SaveRecipeAction.Size = new System.Drawing.Size(180, 22); + SaveRecipeAction.Text = "Save Recipe"; + SaveRecipeAction.Click += Save_Recipe_Click; + // + // DeleteRecipeAction + // + DeleteRecipeAction.AutoSize = false; + DeleteRecipeAction.Name = "DeleteRecipeAction"; + DeleteRecipeAction.Size = new System.Drawing.Size(180, 22); + DeleteRecipeAction.Text = "Delete Recipe"; + DeleteRecipeAction.Click += Delete_Recipe_Click; + // + // ApplicationActionsSeparator1 + // + ApplicationActionsSeparator1.Name = "ApplicationActionsSeparator1"; + ApplicationActionsSeparator1.Size = new System.Drawing.Size(177, 6); + // + // ApplicationIngredientsAction + // + ApplicationIngredientsAction.Name = "ApplicationIngredientsAction"; + ApplicationIngredientsAction.Size = new System.Drawing.Size(180, 22); + ApplicationIngredientsAction.Text = "Ingredients"; + ApplicationIngredientsAction.Click += Options_Click; + // + // ApplicationTagsAction + // + ApplicationTagsAction.Name = "ApplicationTagsAction"; + ApplicationTagsAction.Size = new System.Drawing.Size(180, 22); + ApplicationTagsAction.Text = "Tags"; + ApplicationTagsAction.Click += Options_Click; + // + // ApplicationActionsSeparator2 + // + ApplicationActionsSeparator2.Name = "ApplicationActionsSeparator2"; + ApplicationActionsSeparator2.Size = new System.Drawing.Size(177, 6); + // + // SettingsAction + // + SettingsAction.Name = "SettingsAction"; + SettingsAction.Size = new System.Drawing.Size(180, 22); + SettingsAction.Text = "Settings"; + SettingsAction.Click += Options_Click; + // + // HelpAction + // + HelpAction.Name = "HelpAction"; + HelpAction.Size = new System.Drawing.Size(180, 22); + HelpAction.Text = "Help"; + HelpAction.Click += Options_Click; + // + // MainToolstripSeparator + // + MainToolstripSeparator.Name = "MainToolstripSeparator"; + MainToolstripSeparator.Size = new System.Drawing.Size(6, 49); + // + // RecipeActions + // + RecipeActions.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + RecipeActions.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { RecipeTagsAction, RecipeImagesAction, ExportShoppingListAction }); + RecipeActions.ImageTransparentColor = System.Drawing.Color.Magenta; + RecipeActions.Name = "RecipeActions"; + RecipeActions.Size = new System.Drawing.Size(55, 46); + RecipeActions.Text = "Recipe"; + // + // RecipeTagsAction + // + RecipeTagsAction.Name = "RecipeTagsAction"; + RecipeTagsAction.Size = new System.Drawing.Size(183, 22); + RecipeTagsAction.Text = "Tags"; + // + // RecipeImagesAction + // + RecipeImagesAction.Name = "RecipeImagesAction"; + RecipeImagesAction.Size = new System.Drawing.Size(183, 22); + RecipeImagesAction.Text = "Images"; + // + // ExportShoppingListAction + // + ExportShoppingListAction.Name = "ExportShoppingListAction"; + ExportShoppingListAction.Size = new System.Drawing.Size(183, 22); + ExportShoppingListAction.Text = "Export Shopping List"; + // + // toolStripSeparator1 + // + toolStripSeparator1.Name = "toolStripSeparator1"; + toolStripSeparator1.Size = new System.Drawing.Size(6, 49); + // + // Toolstrip + // + AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + BackColor = System.Drawing.Color.FromArgb(252, 245, 229); + Controls.Add(MainToolStrip); + Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + Name = "Toolstrip"; + Size = new System.Drawing.Size(197, 49); + RecipeHeaderLayout.ResumeLayout(false); + AuthorGroupBox.ResumeLayout(false); + CookTime.ResumeLayout(false); + CookTimeLayout.ResumeLayout(false); + TotalTime.ResumeLayout(false); + panel1.ResumeLayout(false); + NameGroupBox.ResumeLayout(false); + PrepTimeLayout.ResumeLayout(false); + MainToolStrip.ResumeLayout(false); + MainToolStrip.PerformLayout(); + ResumeLayout(false); + PerformLayout(); + } + + #endregion + + private System.Windows.Forms.TableLayoutPanel RecipeHeaderLayout; + public System.Windows.Forms.GroupBox AuthorGroupBox; + public System.Windows.Forms.RichTextBox RecipeAuthor; + public System.Windows.Forms.GroupBox CookTime; + public System.Windows.Forms.TableLayoutPanel CookTimeLayout; + public System.Windows.Forms.Label CookDays; + public System.Windows.Forms.Label CookMinutes; + public System.Windows.Forms.Label CookHours; + public System.Windows.Forms.GroupBox TotalTime; + public System.Windows.Forms.Panel panel1; + public System.Windows.Forms.Label TotalTimeValue; + public System.Windows.Forms.GroupBox NameGroupBox; + public System.Windows.Forms.RichTextBox RecipeName; + private System.Windows.Forms.GroupBox PrepTime; + private System.Windows.Forms.TableLayoutPanel PrepTimeLayout; + public System.Windows.Forms.Label PrepHours; + public System.Windows.Forms.Label PrepMinutes; + private System.Windows.Forms.ToolStrip MainToolStrip; + private System.Windows.Forms.ToolStripDropDownButton ApplicationActions; + private System.Windows.Forms.ToolStripMenuItem NewRecipeAction; + private System.Windows.Forms.ToolStripMenuItem SaveRecipeAction; + private System.Windows.Forms.ToolStripMenuItem DeleteRecipeAction; + private System.Windows.Forms.ToolStripSeparator ApplicationActionsSeparator1; + private System.Windows.Forms.ToolStripMenuItem ApplicationIngredientsAction; + private System.Windows.Forms.ToolStripMenuItem ApplicationTagsAction; + private System.Windows.Forms.ToolStripSeparator ApplicationActionsSeparator2; + private System.Windows.Forms.ToolStripMenuItem SettingsAction; + private System.Windows.Forms.ToolStripMenuItem HelpAction; + private System.Windows.Forms.ToolStripSeparator MainToolstripSeparator; + private System.Windows.Forms.ToolStripDropDownButton RecipeActions; + private System.Windows.Forms.ToolStripMenuItem RecipeTagsAction; + private System.Windows.Forms.ToolStripMenuItem RecipeImagesAction; + private System.Windows.Forms.ToolStripMenuItem ExportShoppingListAction; + public System.Windows.Forms.ToolStripSeparator toolStripSeparator1; + } +} diff --git a/CustomControls/Toolstrip.cs b/CustomControls/Toolstrip.cs new file mode 100644 index 0000000..a900120 --- /dev/null +++ b/CustomControls/Toolstrip.cs @@ -0,0 +1,63 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Recipsio +{ + public partial class Toolstrip : UserControl + { + public MainForm? MF; + public Toolbox? TB; + public Toolstrip() + { + InitializeComponent(); + } + private void Create_New_Recipe_Click(object Sender, EventArgs E) + { + TB.Clear_Content_Boxes(); + MF.CurrentRecipe = ""; + MF.RecipeList.SelectedItem = null; + } + private void Save_Recipe_Click(object Sender, EventArgs E) + { + if (TB.Is_Valid_Recipe()) + { + if (TB.Save_Recipe(RecipeName.Text, MF) == "New") + { + MF.RecipeList.Items.Add(RecipeName.Text); + } + } + } + private void Delete_Recipe_Click(object Sender, EventArgs E) + { + if (MF.CurrentRecipe == null) { return; } + MF.CurrentRecipe = MF.RecipeList.SelectedItem.ToString()!; + TB.Delete_Recipe(MF.CurrentRecipe); + TB.Clear_Content_Boxes(); + MF.RecipeList.Items.Remove(MF.CurrentRecipe); + MF.RecipeList.SelectedItem = null; + } + private void Options_Click(object Sender, EventArgs E) + { + Dictionary FormMap = new() + { + { "Images", typeof(ApplicationImagesForm) }, + { "Tags", typeof(ApplicationTagsForm) }, + { "Ingredients", typeof(ApplicationIngredientsForm) }, + { "Settings", typeof(ApplicationSettingsForm) }, + { "Help", typeof(ApplicationHelpForm) }, + }; + + ToolStripItem ItemClicked = (ToolStripItem)Sender; + _ = FormMap.TryGetValue(ItemClicked.Text, out Type? FormType); + Form NewForm = (Form)Activator.CreateInstance(FormType!, this, TB)!; + NewForm.ShowDialog(); + } + } +} diff --git a/CustomControls/Toolstrip.resx b/CustomControls/Toolstrip.resx new file mode 100644 index 0000000..741874d --- /dev/null +++ b/CustomControls/Toolstrip.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + 17, 17 + + \ No newline at end of file diff --git a/Forms/MainForm.Designer.cs b/Forms/MainForm.Designer.cs index 3378ef0..2510d97 100644 --- a/Forms/MainForm.Designer.cs +++ b/Forms/MainForm.Designer.cs @@ -30,46 +30,14 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); FormLayout = new System.Windows.Forms.TableLayoutPanel(); - RecipeInformationLayout = new System.Windows.Forms.TableLayoutPanel(); - DescriptionLabel = new System.Windows.Forms.Label(); - RecipeDescription = new System.Windows.Forms.RichTextBox(); - IngredientControlsLayout = new System.Windows.Forms.TableLayoutPanel(); - IngredientsLabel = new System.Windows.Forms.Label(); - AddIngredient = new System.Windows.Forms.Button(); - RemoveIngredient = new System.Windows.Forms.Button(); - RecipeIngredients = new System.Windows.Forms.ListBox(); - RecipeDirections = new System.Windows.Forms.ListBox(); - DirectionsControlsLayout = new System.Windows.Forms.TableLayoutPanel(); - DirectionsLabel = new System.Windows.Forms.Label(); - AddDirection = new System.Windows.Forms.Button(); - RemoveDirection = new System.Windows.Forms.Button(); - MainToolStrip = new System.Windows.Forms.ToolStrip(); - ApplicationActions = new System.Windows.Forms.ToolStripDropDownButton(); - NewRecipeAction = new System.Windows.Forms.ToolStripMenuItem(); - SaveRecipeAction = new System.Windows.Forms.ToolStripMenuItem(); - DeleteRecipeAction = new System.Windows.Forms.ToolStripMenuItem(); - ApplicationActionsSeparator1 = new System.Windows.Forms.ToolStripSeparator(); - ApplicationIngredientsAction = new System.Windows.Forms.ToolStripMenuItem(); - ApplicationTagsAction = new System.Windows.Forms.ToolStripMenuItem(); - ApplicationActionsSeparator2 = new System.Windows.Forms.ToolStripSeparator(); - SettingsAction = new System.Windows.Forms.ToolStripMenuItem(); - HelpAction = new System.Windows.Forms.ToolStripMenuItem(); - MainToolstripSeparator = new System.Windows.Forms.ToolStripSeparator(); - RecipeActions = new System.Windows.Forms.ToolStripDropDownButton(); - RecipeTagsAction = new System.Windows.Forms.ToolStripMenuItem(); - RecipeImagesAction = new System.Windows.Forms.ToolStripMenuItem(); - ExportShoppingListAction = new System.Windows.Forms.ToolStripMenuItem(); - toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); RecipeIcon = new System.Windows.Forms.PictureBox(); RecipeListLayout = new System.Windows.Forms.TableLayoutPanel(); RecipeList = new System.Windows.Forms.ListBox(); Search = new System.Windows.Forms.RichTextBox(); Header = new RecipeHeader(); + Information = new RecipeInformation(); + Tools = new Toolstrip(); FormLayout.SuspendLayout(); - RecipeInformationLayout.SuspendLayout(); - IngredientControlsLayout.SuspendLayout(); - DirectionsControlsLayout.SuspendLayout(); - MainToolStrip.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)RecipeIcon).BeginInit(); RecipeListLayout.SuspendLayout(); SuspendLayout(); @@ -80,11 +48,11 @@ private void InitializeComponent() FormLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 23.28767F)); FormLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 76.712326F)); FormLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 128F)); - FormLayout.Controls.Add(RecipeInformationLayout, 1, 3); - FormLayout.Controls.Add(MainToolStrip, 0, 0); FormLayout.Controls.Add(RecipeIcon, 2, 0); FormLayout.Controls.Add(RecipeListLayout, 0, 1); FormLayout.Controls.Add(Header, 1, 0); + FormLayout.Controls.Add(Information, 1, 3); + FormLayout.Controls.Add(Tools, 0, 0); FormLayout.Dock = System.Windows.Forms.DockStyle.Fill; FormLayout.Location = new System.Drawing.Point(0, 0); FormLayout.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); @@ -98,295 +66,6 @@ private void InitializeComponent() FormLayout.TabIndex = 0; FormLayout.MouseClick += Control_Mouse_Click; // - // RecipeInformationLayout - // - RecipeInformationLayout.ColumnCount = 2; - FormLayout.SetColumnSpan(RecipeInformationLayout, 2); - RecipeInformationLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 95F)); - RecipeInformationLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - RecipeInformationLayout.Controls.Add(DescriptionLabel, 0, 0); - RecipeInformationLayout.Controls.Add(RecipeDescription, 1, 0); - RecipeInformationLayout.Controls.Add(IngredientControlsLayout, 0, 1); - RecipeInformationLayout.Controls.Add(RecipeIngredients, 1, 1); - RecipeInformationLayout.Controls.Add(RecipeDirections, 1, 2); - RecipeInformationLayout.Controls.Add(DirectionsControlsLayout, 0, 2); - RecipeInformationLayout.Dock = System.Windows.Forms.DockStyle.Fill; - RecipeInformationLayout.Location = new System.Drawing.Point(251, 131); - RecipeInformationLayout.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - RecipeInformationLayout.Name = "RecipeInformationLayout"; - RecipeInformationLayout.RowCount = 4; - RecipeInformationLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.3333321F)); - RecipeInformationLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.3333321F)); - RecipeInformationLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.3333321F)); - RecipeInformationLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); - RecipeInformationLayout.Size = new System.Drawing.Size(936, 574); - RecipeInformationLayout.TabIndex = 0; - RecipeInformationLayout.MouseClick += Control_Mouse_Click; - // - // DescriptionLabel - // - DescriptionLabel.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - DescriptionLabel.Location = new System.Drawing.Point(2, 0); - DescriptionLabel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - DescriptionLabel.Name = "DescriptionLabel"; - DescriptionLabel.Size = new System.Drawing.Size(88, 18); - DescriptionLabel.TabIndex = 1; - DescriptionLabel.Text = "&Description"; - // - // RecipeDescription - // - RecipeDescription.Dock = System.Windows.Forms.DockStyle.Fill; - RecipeDescription.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - RecipeDescription.Location = new System.Drawing.Point(97, 3); - RecipeDescription.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3); - RecipeDescription.Name = "RecipeDescription"; - RecipeDescription.Size = new System.Drawing.Size(837, 178); - RecipeDescription.TabIndex = 17; - RecipeDescription.Tag = "Description"; - RecipeDescription.Text = ""; - // - // IngredientControlsLayout - // - IngredientControlsLayout.ColumnCount = 1; - IngredientControlsLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - IngredientControlsLayout.Controls.Add(IngredientsLabel, 0, 0); - IngredientControlsLayout.Controls.Add(AddIngredient, 0, 1); - IngredientControlsLayout.Controls.Add(RemoveIngredient, 0, 2); - IngredientControlsLayout.Location = new System.Drawing.Point(0, 184); - IngredientControlsLayout.Margin = new System.Windows.Forms.Padding(0); - IngredientControlsLayout.Name = "IngredientControlsLayout"; - IngredientControlsLayout.RowCount = 3; - IngredientControlsLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.3333321F)); - IngredientControlsLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.3333321F)); - IngredientControlsLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.3333321F)); - IngredientControlsLayout.Size = new System.Drawing.Size(95, 87); - IngredientControlsLayout.TabIndex = 22; - // - // IngredientsLabel - // - IngredientsLabel.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - IngredientsLabel.Location = new System.Drawing.Point(2, 0); - IngredientsLabel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - IngredientsLabel.Name = "IngredientsLabel"; - IngredientsLabel.Size = new System.Drawing.Size(84, 18); - IngredientsLabel.TabIndex = 19; - IngredientsLabel.Text = "&Ingredients"; - // - // AddIngredient - // - AddIngredient.Dock = System.Windows.Forms.DockStyle.Fill; - AddIngredient.Location = new System.Drawing.Point(3, 32); - AddIngredient.Name = "AddIngredient"; - AddIngredient.Size = new System.Drawing.Size(89, 23); - AddIngredient.TabIndex = 20; - AddIngredient.Text = "Add"; - AddIngredient.UseVisualStyleBackColor = true; - AddIngredient.Click += Add_Recipe_Ingredient_Click; - // - // RemoveIngredient - // - RemoveIngredient.Dock = System.Windows.Forms.DockStyle.Fill; - RemoveIngredient.Location = new System.Drawing.Point(3, 61); - RemoveIngredient.Name = "RemoveIngredient"; - RemoveIngredient.Size = new System.Drawing.Size(89, 23); - RemoveIngredient.TabIndex = 21; - RemoveIngredient.Text = "Remove"; - RemoveIngredient.UseVisualStyleBackColor = true; - RemoveIngredient.Click += Remove_Ingredient_Click; - // - // RecipeIngredients - // - RecipeIngredients.Dock = System.Windows.Forms.DockStyle.Fill; - RecipeIngredients.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - RecipeIngredients.FormattingEnabled = true; - RecipeIngredients.ItemHeight = 15; - RecipeIngredients.Location = new System.Drawing.Point(98, 187); - RecipeIngredients.Name = "RecipeIngredients"; - RecipeIngredients.Size = new System.Drawing.Size(835, 178); - RecipeIngredients.TabIndex = 23; - RecipeIngredients.Tag = "Ingredients"; - // - // RecipeDirections - // - RecipeDirections.Dock = System.Windows.Forms.DockStyle.Fill; - RecipeDirections.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - RecipeDirections.FormattingEnabled = true; - RecipeDirections.ItemHeight = 15; - RecipeDirections.Location = new System.Drawing.Point(98, 371); - RecipeDirections.Name = "RecipeDirections"; - RecipeDirections.Size = new System.Drawing.Size(835, 178); - RecipeDirections.TabIndex = 24; - RecipeDirections.Tag = "Directions"; - // - // DirectionsControlsLayout - // - DirectionsControlsLayout.ColumnCount = 1; - DirectionsControlsLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - DirectionsControlsLayout.Controls.Add(DirectionsLabel, 0, 0); - DirectionsControlsLayout.Controls.Add(AddDirection, 0, 1); - DirectionsControlsLayout.Controls.Add(RemoveDirection, 0, 2); - DirectionsControlsLayout.Location = new System.Drawing.Point(3, 371); - DirectionsControlsLayout.Name = "DirectionsControlsLayout"; - DirectionsControlsLayout.RowCount = 3; - DirectionsControlsLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.3333321F)); - DirectionsControlsLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.3333321F)); - DirectionsControlsLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.3333321F)); - DirectionsControlsLayout.Size = new System.Drawing.Size(89, 87); - DirectionsControlsLayout.TabIndex = 25; - // - // DirectionsLabel - // - DirectionsLabel.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - DirectionsLabel.Location = new System.Drawing.Point(2, 0); - DirectionsLabel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - DirectionsLabel.Name = "DirectionsLabel"; - DirectionsLabel.Size = new System.Drawing.Size(79, 18); - DirectionsLabel.TabIndex = 18; - DirectionsLabel.Text = "&Directions"; - // - // AddDirection - // - AddDirection.Dock = System.Windows.Forms.DockStyle.Fill; - AddDirection.Location = new System.Drawing.Point(3, 32); - AddDirection.Name = "AddDirection"; - AddDirection.Size = new System.Drawing.Size(83, 23); - AddDirection.TabIndex = 19; - AddDirection.Text = "Add"; - AddDirection.UseVisualStyleBackColor = true; - AddDirection.Click += Add_Recipe_Description_Click; - // - // RemoveDirection - // - RemoveDirection.Dock = System.Windows.Forms.DockStyle.Fill; - RemoveDirection.Location = new System.Drawing.Point(3, 61); - RemoveDirection.Name = "RemoveDirection"; - RemoveDirection.Size = new System.Drawing.Size(83, 23); - RemoveDirection.TabIndex = 20; - RemoveDirection.Text = "Remove"; - RemoveDirection.UseVisualStyleBackColor = true; - RemoveDirection.Click += Remove_Recipe_Description_Click; - // - // MainToolStrip - // - MainToolStrip.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; - MainToolStrip.Dock = System.Windows.Forms.DockStyle.Fill; - MainToolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; - MainToolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { ApplicationActions, MainToolstripSeparator, RecipeActions, toolStripSeparator1 }); - MainToolStrip.Location = new System.Drawing.Point(0, 0); - MainToolStrip.Name = "MainToolStrip"; - MainToolStrip.Size = new System.Drawing.Size(247, 28); - MainToolStrip.TabIndex = 4; - MainToolStrip.Text = "toolStrip1"; - // - // ApplicationActions - // - ApplicationActions.AutoSize = false; - ApplicationActions.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - ApplicationActions.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { NewRecipeAction, SaveRecipeAction, DeleteRecipeAction, ApplicationActionsSeparator1, ApplicationIngredientsAction, ApplicationTagsAction, ApplicationActionsSeparator2, SettingsAction, HelpAction }); - ApplicationActions.ImageTransparentColor = System.Drawing.Color.Magenta; - ApplicationActions.Name = "ApplicationActions"; - ApplicationActions.Size = new System.Drawing.Size(81, 25); - ApplicationActions.Text = "Application"; - // - // NewRecipeAction - // - NewRecipeAction.AutoSize = false; - NewRecipeAction.Name = "NewRecipeAction"; - NewRecipeAction.Size = new System.Drawing.Size(180, 22); - NewRecipeAction.Text = "New Recipe"; - NewRecipeAction.Click += Create_New_Recipe_Click; - // - // SaveRecipeAction - // - SaveRecipeAction.AutoSize = false; - SaveRecipeAction.Name = "SaveRecipeAction"; - SaveRecipeAction.Size = new System.Drawing.Size(180, 22); - SaveRecipeAction.Text = "Save Recipe"; - SaveRecipeAction.Click += Save_Recipe_Click; - // - // DeleteRecipeAction - // - DeleteRecipeAction.AutoSize = false; - DeleteRecipeAction.Name = "DeleteRecipeAction"; - DeleteRecipeAction.Size = new System.Drawing.Size(180, 22); - DeleteRecipeAction.Text = "Delete Recipe"; - DeleteRecipeAction.Click += Delete_Recipe_Click; - // - // ApplicationActionsSeparator1 - // - ApplicationActionsSeparator1.Name = "ApplicationActionsSeparator1"; - ApplicationActionsSeparator1.Size = new System.Drawing.Size(142, 6); - // - // ApplicationIngredientsAction - // - ApplicationIngredientsAction.Name = "ApplicationIngredientsAction"; - ApplicationIngredientsAction.Size = new System.Drawing.Size(145, 22); - ApplicationIngredientsAction.Text = "Ingredients"; - ApplicationIngredientsAction.Click += Options_Click; - // - // ApplicationTagsAction - // - ApplicationTagsAction.Name = "ApplicationTagsAction"; - ApplicationTagsAction.Size = new System.Drawing.Size(145, 22); - ApplicationTagsAction.Text = "Tags"; - ApplicationTagsAction.Click += Options_Click; - // - // ApplicationActionsSeparator2 - // - ApplicationActionsSeparator2.Name = "ApplicationActionsSeparator2"; - ApplicationActionsSeparator2.Size = new System.Drawing.Size(142, 6); - // - // SettingsAction - // - SettingsAction.Name = "SettingsAction"; - SettingsAction.Size = new System.Drawing.Size(145, 22); - SettingsAction.Text = "Settings"; - SettingsAction.Click += Options_Click; - // - // HelpAction - // - HelpAction.Name = "HelpAction"; - HelpAction.Size = new System.Drawing.Size(145, 22); - HelpAction.Text = "Help"; - HelpAction.Click += Options_Click; - // - // MainToolstripSeparator - // - MainToolstripSeparator.Name = "MainToolstripSeparator"; - MainToolstripSeparator.Size = new System.Drawing.Size(6, 28); - // - // RecipeActions - // - RecipeActions.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - RecipeActions.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { RecipeTagsAction, RecipeImagesAction, ExportShoppingListAction }); - RecipeActions.ImageTransparentColor = System.Drawing.Color.Magenta; - RecipeActions.Name = "RecipeActions"; - RecipeActions.Size = new System.Drawing.Size(55, 25); - RecipeActions.Text = "Recipe"; - // - // RecipeTagsAction - // - RecipeTagsAction.Name = "RecipeTagsAction"; - RecipeTagsAction.Size = new System.Drawing.Size(183, 22); - RecipeTagsAction.Text = "Tags"; - // - // RecipeImagesAction - // - RecipeImagesAction.Name = "RecipeImagesAction"; - RecipeImagesAction.Size = new System.Drawing.Size(183, 22); - RecipeImagesAction.Text = "Images"; - // - // ExportShoppingListAction - // - ExportShoppingListAction.Name = "ExportShoppingListAction"; - ExportShoppingListAction.Size = new System.Drawing.Size(183, 22); - ExportShoppingListAction.Text = "Export Shopping List"; - // - // toolStripSeparator1 - // - toolStripSeparator1.Name = "toolStripSeparator1"; - toolStripSeparator1.Size = new System.Drawing.Size(6, 28); - // // RecipeIcon // RecipeIcon.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; @@ -456,6 +135,27 @@ private void InitializeComponent() Header.Size = new System.Drawing.Size(809, 122); Header.TabIndex = 6; // + // Information + // + Information.BackColor = System.Drawing.Color.FromArgb(252, 245, 229); + FormLayout.SetColumnSpan(Information, 2); + Information.Dock = System.Windows.Forms.DockStyle.Fill; + Information.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + Information.Location = new System.Drawing.Point(250, 131); + Information.Name = "Information"; + Information.Size = new System.Drawing.Size(938, 574); + Information.TabIndex = 7; + // + // Tools + // + Tools.BackColor = System.Drawing.Color.FromArgb(252, 245, 229); + Tools.Dock = System.Windows.Forms.DockStyle.Fill; + Tools.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + Tools.Location = new System.Drawing.Point(3, 3); + Tools.Name = "Tools"; + Tools.Size = new System.Drawing.Size(241, 22); + Tools.TabIndex = 8; + // // MainForm // AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); @@ -474,12 +174,6 @@ private void InitializeComponent() KeyDown += Recipsio_Key_Down; MouseClick += Control_Mouse_Click; FormLayout.ResumeLayout(false); - FormLayout.PerformLayout(); - RecipeInformationLayout.ResumeLayout(false); - IngredientControlsLayout.ResumeLayout(false); - DirectionsControlsLayout.ResumeLayout(false); - MainToolStrip.ResumeLayout(false); - MainToolStrip.PerformLayout(); ((System.ComponentModel.ISupportInitialize)RecipeIcon).EndInit(); RecipeListLayout.ResumeLayout(false); ResumeLayout(false); @@ -489,54 +183,13 @@ private void InitializeComponent() public System.Windows.Forms.TableLayoutPanel FormLayout; - private System.Windows.Forms.ToolStrip MainToolStrip; - - private System.Windows.Forms.ToolStripDropDownButton ApplicationActions; - - private System.Windows.Forms.ToolStripMenuItem NewRecipeAction; - private System.Windows.Forms.ToolStripMenuItem SaveRecipeAction; - private System.Windows.Forms.ToolStripMenuItem DeleteRecipeAction; - - private System.Windows.Forms.ToolStripSeparator ApplicationActionsSeparator1; - - private System.Windows.Forms.ToolStripMenuItem ApplicationIngredientsAction; - private System.Windows.Forms.ToolStripMenuItem ApplicationTagsAction; - - private System.Windows.Forms.ToolStripSeparator ApplicationActionsSeparator2; - - private System.Windows.Forms.ToolStripMenuItem SettingsAction; - private System.Windows.Forms.ToolStripMenuItem HelpAction; - - private System.Windows.Forms.ToolStripSeparator MainToolstripSeparator; - - private System.Windows.Forms.ToolStripDropDownButton RecipeActions; - private System.Windows.Forms.ToolStripMenuItem RecipeTagsAction; - private System.Windows.Forms.ToolStripMenuItem RecipeImagesAction; - private System.Windows.Forms.ToolStripMenuItem ExportShoppingListAction; - public System.Windows.Forms.TableLayoutPanel RecipeListLayout; public System.Windows.Forms.RichTextBox Search; public System.Windows.Forms.ListBox RecipeList; - - public System.Windows.Forms.TableLayoutPanel RecipeInformationLayout; - - public System.Windows.Forms.Label DescriptionLabel; - public System.Windows.Forms.RichTextBox RecipeDescription; - - public System.Windows.Forms.TableLayoutPanel IngredientControlsLayout; - public System.Windows.Forms.Label IngredientsLabel; - public System.Windows.Forms.Button AddIngredient; - public System.Windows.Forms.Button RemoveIngredient; - public System.Windows.Forms.ListBox RecipeIngredients; - - public System.Windows.Forms.TableLayoutPanel DirectionsControlsLayout; - public System.Windows.Forms.Label DirectionsLabel; - public System.Windows.Forms.Button AddDirection; - public System.Windows.Forms.Button RemoveDirection; - public System.Windows.Forms.ListBox RecipeDirections; - public System.Windows.Forms.ToolStripSeparator toolStripSeparator1; public System.Windows.Forms.PictureBox RecipeIcon; public RecipeHeader Header; + public RecipeInformation Information; + private Toolstrip Tools; } } diff --git a/Forms/MainForm.cs b/Forms/MainForm.cs index ab03e77..4a4c926 100644 --- a/Forms/MainForm.cs +++ b/Forms/MainForm.cs @@ -20,39 +20,18 @@ public MainForm() { C.AutoSize = true; } + Header.MF = this; Header.TB = TB; + Information.MF = this; + Information.TB = TB; + Tools.MF = this; + Tools.TB = TB; TB.Generate_User_Directories(); TB.Load_Recipes(ref RecipeList); TB.Load_Ingredients(); KeyPreview = true; } - - private void Create_New_Recipe_Click(object Sender, EventArgs E) - { - TB.Clear_Content_Boxes(); - CurrentRecipe = ""; - RecipeList.SelectedItem = null; - } - private void Save_Recipe_Click(object Sender, EventArgs E) - { - //if (TB.Is_Valid_Recipe()) - //{ - // if (TB.Save_Recipe(RecipeName.Text, this) == "New") - // { - // RecipeList.Items.Add(RecipeName.Text); - // } - //} - } - private void Delete_Recipe_Click(object Sender, EventArgs E) - { - if (CurrentRecipe == null) { return; } - CurrentRecipe = RecipeList.SelectedItem.ToString()!; - TB.Delete_Recipe(CurrentRecipe); - TB.Clear_Content_Boxes(); - RecipeList.Items.Remove(CurrentRecipe); - RecipeList.SelectedItem = null; - } private void Control_Mouse_Click(object Sender, MouseEventArgs ME) { if (ActiveControl is RichTextBox) @@ -88,23 +67,6 @@ private void Recipsio_Key_Down(object Sender, KeyEventArgs KE) Close(); } } - - private void Options_Click(object Sender, EventArgs E) - { - Dictionary FormMap = new() - { - { "Images", typeof(ApplicationImagesForm) }, - { "Tags", typeof(ApplicationTagsForm) }, - { "Ingredients", typeof(ApplicationIngredientsForm) }, - { "Settings", typeof(ApplicationSettingsForm) }, - { "Help", typeof(ApplicationHelpForm) }, - }; - - ToolStripItem ItemClicked = (ToolStripItem)Sender; - _ = FormMap.TryGetValue(ItemClicked.Text, out Type? FormType); - Form NewForm = (Form)Activator.CreateInstance(FormType!, this, TB)!; - NewForm.ShowDialog(); - } private void Search_Leave(object Sender, EventArgs E) { if (Search.Text == "") @@ -125,29 +87,5 @@ private void Search_Text_Changed(object Sender, EventArgs E) { } - private void Add_Recipe_Ingredient_Click(object Sender, EventArgs E) - { - RecipeIngredientForm AIF = new(this, TB); - AIF.ShowDialog(this); - } - private void Remove_Ingredient_Click(object Sender, EventArgs E) - { - if (RecipeIngredients.SelectedItem != null) - { - RecipeIngredients.Items.Remove(RecipeIngredients.SelectedItem); - } - } - private void Add_Recipe_Description_Click(object Sender, EventArgs e) - { - RecipeDirectionForm RDF = new(this, TB); - RDF.ShowDialog(this); - } - private void Remove_Recipe_Description_Click(object Sender, EventArgs e) - { - if (RecipeDirections.SelectedItem != null) - { - RecipeDirections.Items.Remove(RecipeDirections.SelectedItem); - } - } } } \ No newline at end of file diff --git a/Forms/MainForm.resx b/Forms/MainForm.resx index 4021633..6ea7c29 100644 --- a/Forms/MainForm.resx +++ b/Forms/MainForm.resx @@ -117,12 +117,6 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 17, 17 - - - 17, 17 - diff --git a/Forms/RecipeDirectionForm.cs b/Forms/RecipeDirectionForm.cs index 6c6ce43..d931111 100644 --- a/Forms/RecipeDirectionForm.cs +++ b/Forms/RecipeDirectionForm.cs @@ -27,7 +27,7 @@ private void Submit_Recipe_Direction_Click(object Sender, EventArgs E) { if (RecipeDirection.Text != "") { - MF.RecipeDirections.Items.Add(RecipeDirection.Text); + MF.Information.RecipeDirections.Items.Add(RecipeDirection.Text); Close(); } else diff --git a/Forms/RecipeIngredientForm.cs b/Forms/RecipeIngredientForm.cs index b073526..f42dc90 100644 --- a/Forms/RecipeIngredientForm.cs +++ b/Forms/RecipeIngredientForm.cs @@ -39,7 +39,7 @@ private void Submit_Recipe_Ingredient_Click(object Sender, EventArgs E) if (ErrorMessage == "") { Ingredient ChosenIngredient = TB.Ingredients[IngredientChoice.SelectedItem.ToString()!]; - MF.RecipeIngredients.Items.Add($"{MeasurementAmount.Text} {MeasurementChoice.Text} ~ {ChosenIngredient.Name}"); + MF.Information.RecipeIngredients.Items.Add($"{MeasurementAmount.Text} {MeasurementChoice.Text} ~ {ChosenIngredient.Name}"); Close(); } else diff --git a/Toolbox/Clearing.cs b/Toolbox/Clearing.cs index a3568dc..c17e5b4 100644 --- a/Toolbox/Clearing.cs +++ b/Toolbox/Clearing.cs @@ -19,8 +19,8 @@ public void Clear_Content_Boxes() Clear_Times(MF.Header.PrepTimeBox); Clear_Times(MF.Header.CookTimeBox); MF.Header.TotalTimeValue.Text = "0 Days 0 Hours 0 Minutes"; - MF.RecipeDescription.Text = ""; - MF.RecipeIngredients.Items.Clear(); + MF.Information.RecipeDescription.Text = ""; + MF.Information.RecipeIngredients.Items.Clear(); } } } diff --git a/Toolbox/Recipes.cs b/Toolbox/Recipes.cs index 0353331..7185c12 100644 --- a/Toolbox/Recipes.cs +++ b/Toolbox/Recipes.cs @@ -15,9 +15,9 @@ public static string Build_File_Formatted_Recipe(MainForm MF) $":Author\n{MF.Header.TotalTimeValue.Text}\n" + $":PrepTime\n{MF.Header.TotalTimeValue.Text.Split(" ")[0]}:{MF.Header.TotalTimeValue.Text.Split(" ")[0]}:{MF.Header.TotalTimeValue.Text.Split(" ")[0]}\n" + $":CookTime\n{MF.Header.TotalTimeValue.Text.Split(" ")[0]}:{MF.Header.TotalTimeValue.Text.Split(" ")[0]}:{MF.Header.TotalTimeValue.Text.Split(" ")[0]}\n" + - $":Description\n{MF.RecipeDescription.Text}\n" + - $":Ingredients\n{string.Join("|", MF.RecipeIngredients.Items.Cast())}\n" + - $":Directions\n{string.Join("|", MF.RecipeDirections.Items.Cast())}"; + $":Description\n{MF.Information.RecipeDescription.Text}\n" + + $":Ingredients\n{string.Join("|", MF.Information.RecipeIngredients.Items.Cast())}\n" + + $":Directions\n{string.Join("|", MF.Information.RecipeDirections.Items.Cast())}"; } public void Load_Recipe(string CurrentRecipe) { @@ -65,7 +65,7 @@ public void Load_Recipe(string CurrentRecipe) List Ingredients = Lines[Index].Split('|').ToList(); foreach (string Ingredient in Ingredients) { - MF.RecipeIngredients.Items.Add(Ingredient); + MF.Information.RecipeIngredients.Items.Add(Ingredient); } } else if (DataState == "Directions") @@ -73,7 +73,7 @@ public void Load_Recipe(string CurrentRecipe) List Directions = Lines[Index].Split('|').ToList(); foreach (string Direction in Directions) { - MF.RecipeDirections.Items.Add(Direction); + MF.Information.RecipeDirections.Items.Add(Direction); } } } diff --git a/Toolbox/Validations.cs b/Toolbox/Validations.cs index 44c28c0..e7e8113 100644 --- a/Toolbox/Validations.cs +++ b/Toolbox/Validations.cs @@ -31,9 +31,9 @@ public bool Is_Valid_Recipe() MF.Header.RecipeAuthor, MF.Header.PrepTimeBox, MF.Header.CookTimeBox, - MF.RecipeDescription, - MF.RecipeIngredients, - MF.RecipeDirections, + MF.Information.RecipeDescription, + MF.Information.RecipeIngredients, + MF.Information.RecipeDirections, }; List EmptyFieldTags = new();