Click here to Skip to main content
15,892,480 members
Articles / Programming Languages / C#

CooksMate

Rate me:
Please Sign up or sign in to vote.
3.32/5 (8 votes)
21 Jan 2008GPL32 min read 56.7K   1K   23  
A simple program to help get the timing of a roast dinner
/*
 * Created by SharpDevelop.
 * User: andy
 * Date: 21/12/2007
 * Time: 18:41
 * 
 * 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.common;

namespace uk.org.aspellclark.braille
{
    /// <summary>
    ///   <name>MainForm</name>
    ///   <namespace>uk.org.aspellclark.todolist</namespace>
    ///   <version>1.0</version>
    ///   <author>Andy Aspell-Clark</author>
    ///   <description>This is the main form of the todolist application
    ///   </description>
    ///   <history>
    ///     <historyitem> 1 Jan 2008  1.0 ARAC  Initial Version.</historyitem>
    ///   </history>
    /// </summary>
	public class MainForm : Form
	{
		#region members

		// Create a logger for use in this class
		private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
		
		private PreferencesXml prefs = null;

		private System.ComponentModel.IContainer components;
		private System.Windows.Forms.MenuItem mnuFile;
		private System.Windows.Forms.MenuItem mnuHelpAbout;
		private System.Windows.Forms.MenuItem mnuHelp;
		private System.Windows.Forms.MenuItem mnuFileExit;
		private System.Windows.Forms.MainMenu mainMenu1;
        
		private HabitList habitList = new HabitList();
		#endregion      
		
		
		/// <summary>
		/// main form constructor
		/// </summary>
		public MainForm(PreferencesXml prefs)
		{
			log.Info("Constructing");
			this.prefs = prefs;
			//
			// The InitializeComponent() call is required for Windows Forms designer support.
			//
			InitializeComponent();
			
			log.Info("Environment Os ["+SystemInfo.OsVersion+"]");
			log.Info("Environment Host ["+SystemInfo.OsHostname+"]");
			
			log.Info("Application Version Number ["+AppVersion.VersionString+"]");
		}
		
		
		#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.components = new System.ComponentModel.Container();
			this.mainMenu1 = new System.Windows.Forms.MainMenu(this.components);
			this.mnuFile = new System.Windows.Forms.MenuItem();
			this.mnuFileExit = new System.Windows.Forms.MenuItem();
			this.mnuHelp = new System.Windows.Forms.MenuItem();
			this.mnuHelpAbout = new System.Windows.Forms.MenuItem();
			this.statusStrip1 = new System.Windows.Forms.StatusStrip();
			this.SuspendLayout();
			// 
			// mainMenu1
			// 
			this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
									this.mnuFile,
									this.mnuHelp});
			// 
			// mnuFile
			// 
			this.mnuFile.Index = 0;
			this.mnuFile.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
									this.mnuFileExit});
			this.mnuFile.Text = "File";
			// 
			// mnuFileExit
			// 
			this.mnuFileExit.Index = 0;
			this.mnuFileExit.Text = "Exit";
			this.mnuFileExit.Click += new System.EventHandler(this.MnuFileExitClick);
			// 
			// mnuHelp
			// 
			this.mnuHelp.Index = 1;
			this.mnuHelp.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
									this.mnuHelpAbout});
			this.mnuHelp.Text = "Help";
			// 
			// mnuHelpAbout
			// 
			this.mnuHelpAbout.Index = 0;
			this.mnuHelpAbout.Text = "About";
			this.mnuHelpAbout.Click += new System.EventHandler(this.MnuHelpAboutClick);
			// 
			// statusStrip1
			// 
			this.statusStrip1.Location = new System.Drawing.Point(0, 249);
			this.statusStrip1.Name = "statusStrip1";
			this.statusStrip1.Size = new System.Drawing.Size(499, 22);
			this.statusStrip1.TabIndex = 3;
			this.statusStrip1.Text = "statusStrip1";
			// 
			// MainForm
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(499, 271);
			this.Controls.Add(this.statusStrip1);
			this.Menu = this.mainMenu1;
			this.MinimumSize = new System.Drawing.Size(507, 298);
			this.Name = "MainForm";
			this.Text = "habit Forming";
			this.ResumeLayout(false);
			this.PerformLayout();
		}
		private System.Windows.Forms.StatusStrip statusStrip1;
		#endregion
		
		#region File Menu Callbacks
		
		void MnuFileExitClick(object sender, System.EventArgs e)
		{
			log.Info("Shutting Down");
			Close();
		}
		#endregion
		
		#region Help Menu Callbacks
		void MnuHelpAboutClick(object sender, System.EventArgs e)
		{
			log.Info("Showing about box");
			common.gui.AboutBox about = new common.gui.AboutBox();
			about.ApplicationName = "HabitForming";
			about.ApplicationVersion = AppVersion.VersionString;
			about.ShowDialog();
		}
		#endregion
	
		
		
		
		void BntAddhabitClick(object sender, EventArgs e)
		{
			if (txtNewhabitName.Text.Length>0)
			{
				habitList.Add(new Habit(txtNewhabitName.Text));
				UpdatehabitList();
			}
			SaveHabitsToFile();
		}
		private void SaveHabitsToFile()
		{
			
		}

		
		private void UpdatehabitList()
		{
			//tablehabits.ro
		}
		
		
	}//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)


Written By
Software Developer (Senior) Airbus Defense and Space
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions