Click here to Skip to main content
11,638,881 members (69,319 online)
Click here to Skip to main content
Articles » Languages » C# » Applications » Downloads
Add your own
alternative version

CooksMate

, 21 Jan 2008 GPL3 34.9K 718 22
A simple program to help get the timing of a roast dinner
cooksmate-bin-mono.zip
cooksmate-bin-mono
CooksMate
mono
cooksmate.exe
cooksmate.exe.mdb
cooksmate.sh
log4net.dll
uk.org.aspellclark.common.dll
uk.org.aspellclark.common.gui.dll
cooksmate-bin-net.zip
cooksmate-bin-net
CooksMate
bin
Debug
cooksmate.exe
cooksmate.log
log4net.dll
uk.org.aspellclark.common.dll
uk.org.aspellclark.common.gui.dll
cooksmate-src.zip
cooksmate-src
Common
common.build
Properties
src
main
csharp
NotImplementedDlg.resources
CommonFile
common.file.build
CommonGui
common.gui.build
CooksMate
cooksmate.build
cooksmate.sh
cooksmate_norm.png
DlgAction.resources
DlgEditRecipe.resources
MainForm.resources
libs
mono
log4net.dll
Mono.GetOptions.dll
sqlite-3.5.4.so
net
log4net.dll
Mono.GetOptions.dll
sqlite3.def
sqlite3.dll
/*
 * Created by SharpDevelop.
 * User: andy
 * Date: 21/12/2007
 * Time: 19:34
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */

using System;
using System.Drawing;
using System.Windows.Forms;
using log4net;

using uk.org.aspellclark.cooksmate.engine;

namespace uk.org.aspellclark.cooksmate
{
    /// <summary>
    ///   <name>DlgEditRecipe</name>
    ///   <namespace>uk.org.aspellclark.todolist</namespace>
    ///   <version>1.0</version>
    ///   <author>Andy Aspell-Clark</author>
    ///   <description>Display a simple about box
    ///   </description>
    ///   <history>
    ///     <historyitem> 1 Jan 2008  1.0 ARAC  Initial Version.</historyitem>
    ///   </history>
    /// </summary>
	public class DlgEditRecipe : System.Windows.Forms.Form
	{
		// Create a logger for use in this class
		private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

		public string buttonSelected = common.gui.Constants.CANCEL_BUTTON;
		public Recipe recipe;
		
		public Recipe RecipeObj
		{
			get {return this.recipe;}
			set {this.recipe = value;
			}
		}
		
		/// <summary>
		/// Action Dialog constructor
		/// </summary>
		public DlgEditRecipe()
		{
			//
			// The InitializeComponent() call is required for Windows Forms designer support.
			//
			InitializeComponent();
		}
		
		#region Windows Forms Designer generated code
		/// <summary>
		/// This method is required for Windows Forms designer support.
		/// Do not change the method contents inside the source code editor. The Forms designer might
		/// not be able to load this method if it was changed manually.
		/// </summary>
		private void InitializeComponent() {
			this.lblActionName = new System.Windows.Forms.Label();
			this.lblServeTime = new System.Windows.Forms.Label();
			this.label2 = new System.Windows.Forms.Label();
			this.btnDone = new System.Windows.Forms.Button();
			this.btnCancel = new System.Windows.Forms.Button();
			this.txtName = new System.Windows.Forms.TextBox();
			this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
			this.txtNotes = new System.Windows.Forms.RichTextBox();
			this.SuspendLayout();
			// 
			// lblActionName
			// 
			this.lblActionName.Location = new System.Drawing.Point(12, 11);
			this.lblActionName.Name = "lblActionName";
			this.lblActionName.Size = new System.Drawing.Size(79, 16);
			this.lblActionName.TabIndex = 0;
			this.lblActionName.Text = "Name";
			// 
			// lblServeTime
			// 
			this.lblServeTime.Location = new System.Drawing.Point(12, 36);
			this.lblServeTime.Name = "lblServeTime";
			this.lblServeTime.Size = new System.Drawing.Size(79, 16);
			this.lblServeTime.TabIndex = 2;
			this.lblServeTime.Text = "Serve Time";
			// 
			// label2
			// 
			this.label2.Location = new System.Drawing.Point(12, 62);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(79, 16);
			this.label2.TabIndex = 4;
			this.label2.Text = "Notes:";
			// 
			// btnDone
			// 
			this.btnDone.Location = new System.Drawing.Point(37, 196);
			this.btnDone.Name = "btnDone";
			this.btnDone.Size = new System.Drawing.Size(75, 23);
			this.btnDone.TabIndex = 8;
			this.btnDone.Text = "Done";
			this.btnDone.UseVisualStyleBackColor = true;
			this.btnDone.Click += new System.EventHandler(this.BtnDoneClick);
			// 
			// btnCancel
			// 
			this.btnCancel.Location = new System.Drawing.Point(173, 196);
			this.btnCancel.Name = "btnCancel";
			this.btnCancel.Size = new System.Drawing.Size(75, 23);
			this.btnCancel.TabIndex = 9;
			this.btnCancel.Text = "Cancel";
			this.btnCancel.UseVisualStyleBackColor = true;
			this.btnCancel.Click += new System.EventHandler(this.BtnCancelClick);
			// 
			// txtName
			// 
			this.txtName.Location = new System.Drawing.Point(97, 8);
			this.txtName.Name = "txtName";
			this.txtName.Size = new System.Drawing.Size(200, 20);
			this.txtName.TabIndex = 10;
			this.txtName.TextChanged += new System.EventHandler(this.TxtNameTextChanged);
			// 
			// dateTimePicker1
			// 
			this.dateTimePicker1.CustomFormat = "HH:MM:SS";
			this.dateTimePicker1.Location = new System.Drawing.Point(97, 34);
			this.dateTimePicker1.Name = "dateTimePicker1";
			this.dateTimePicker1.Size = new System.Drawing.Size(200, 20);
			this.dateTimePicker1.TabIndex = 11;
			this.dateTimePicker1.ValueChanged += new System.EventHandler(this.DateTimePicker1ValueChanged);
			// 
			// txtNotes
			// 
			this.txtNotes.Location = new System.Drawing.Point(94, 60);
			this.txtNotes.Name = "txtNotes";
			this.txtNotes.Size = new System.Drawing.Size(200, 126);
			this.txtNotes.TabIndex = 12;
			this.txtNotes.Text = "";
			this.txtNotes.TextChanged += new System.EventHandler(this.TxtNotesTextChanged);
			// 
			// DlgEditRecipe
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(304, 237);
			this.ControlBox = false;
			this.Controls.Add(this.txtNotes);
			this.Controls.Add(this.dateTimePicker1);
			this.Controls.Add(this.txtName);
			this.Controls.Add(this.btnCancel);
			this.Controls.Add(this.btnDone);
			this.Controls.Add(this.label2);
			this.Controls.Add(this.lblServeTime);
			this.Controls.Add(this.lblActionName);
			this.MaximizeBox = false;
			this.MaximumSize = new System.Drawing.Size(312, 264);
			this.MinimizeBox = false;
			this.MinimumSize = new System.Drawing.Size(312, 264);
			this.Name = "DlgEditRecipe";
			this.ShowInTaskbar = false;
			this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
			this.Text = "Recipe";
			this.Load += new System.EventHandler(this.DlgOnLoad);
			this.ResumeLayout(false);
			this.PerformLayout();
		}
		private System.Windows.Forms.Label lblServeTime;
		private System.Windows.Forms.RichTextBox txtNotes;
		private System.Windows.Forms.DateTimePicker dateTimePicker1;
		private System.Windows.Forms.Label lblActionName;
		private System.Windows.Forms.TextBox txtName;
		private System.Windows.Forms.Button btnCancel;
		private System.Windows.Forms.Button btnDone;
		private System.Windows.Forms.Label label2;
		#endregion


		void DlgOnLoad(object sender, EventArgs e)
		{
		}
		
		
		void BtnCancelClick(object sender, EventArgs e)
		{
			this.buttonSelected = uk.org.aspellclark.common.gui.Constants.CANCEL_BUTTON;
			this.Close();
		}
		
		void BtnDoneClick(object sender, EventArgs e)
		{
			this.buttonSelected = uk.org.aspellclark.common.gui.Constants.DONE_BUTTON;
			this.Close();
		}
		
		
		private void UpdateFields()
		{
			this.txtName.Text = this.recipe.Title;
			this.dateTimePicker1.Value = this.recipe.ServeTime;
			this.txtNotes.Text = this.recipe.Notes;
		}
		
		
		void TxtNameTextChanged(object sender, EventArgs e)
		{
			this.recipe.Title = this.txtName.Text;
		}
		
		void DateTimePicker1ValueChanged(object sender, EventArgs e)
		{
			this.recipe.ServeTime = this.dateTimePicker1.Value;
		}
		
		void TxtNotesTextChanged(object sender, EventArgs e)
		{
			this.recipe.Notes = this.txtNotes.Text;
		}
	}//class
}//namespace

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)

Share

About the Author

Andy Aspell-Clark
Software Developer (Senior) Airbus Defense and Space
United Kingdom United Kingdom
No Biography provided

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.150728.1 | Last Updated 21 Jan 2008
Article Copyright 2007 by Andy Aspell-Clark
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid