view FrmFileType.cs @ 0:b586cccc3d59 default tip

First commit under GPLv3!
author IBBoard <dev@ibboard.co.uk>
date Sat, 06 Oct 2018 20:15:02 +0100
parents
children
line wrap: on
line source

// This file is a part of the SGA Explorer app and is copyright 2006-2018 IBBoard.
//
// The file and the library/program it is in are licensed under the GNU GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license.
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using IBBoard.Relic.RelicTools;

namespace IBBoard.Relic.SGAExplorer
{
	/// <summary>
	/// Summary description for FrmFileType.
	/// </summary>
	public class FrmFileType : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Button bttnCancel;
		private System.Windows.Forms.Button bttnOkay;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.ComboBox cbFileTypes;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		public FrmFileType()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			cbFileTypes.Items.AddRange(Enum.GetNames(typeof(SgaFile.FileFormat)));
			cbFileTypes.Items.Remove(SgaFile.FileFormat.Unknown.ToString());
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.cbFileTypes = new System.Windows.Forms.ComboBox();
			this.bttnCancel = new System.Windows.Forms.Button();
			this.bttnOkay = new System.Windows.Forms.Button();
			this.label1 = new System.Windows.Forms.Label();
			this.SuspendLayout();
			// 
			// cbFileTypes
			// 
			this.cbFileTypes.Location = new System.Drawing.Point(88, 8);
			this.cbFileTypes.Name = "cbFileTypes";
			this.cbFileTypes.Size = new System.Drawing.Size(200, 21);
			this.cbFileTypes.Sorted = true;
			this.cbFileTypes.TabIndex = 0;
			// 
			// bttnCancel
			// 
			this.bttnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
			this.bttnCancel.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.bttnCancel.Location = new System.Drawing.Point(224, 40);
			this.bttnCancel.Name = "bttnCancel";
			this.bttnCancel.Size = new System.Drawing.Size(64, 24);
			this.bttnCancel.TabIndex = 1;
			this.bttnCancel.Text = "Cancel";
			this.bttnCancel.Click += new System.EventHandler(this.bttnCancel_Click);
			// 
			// bttnOkay
			// 
			this.bttnOkay.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.bttnOkay.Location = new System.Drawing.Point(152, 40);
			this.bttnOkay.Name = "bttnOkay";
			this.bttnOkay.Size = new System.Drawing.Size(64, 24);
			this.bttnOkay.TabIndex = 2;
			this.bttnOkay.Text = "OK";
			this.bttnOkay.Click += new System.EventHandler(this.bttnOkay_Click);
			// 
			// label1
			// 
			this.label1.Location = new System.Drawing.Point(8, 8);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(72, 24);
			this.label1.TabIndex = 3;
			this.label1.Text = "File type:";
			this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
			// 
			// FrmFileType
			// 
			this.AcceptButton = this.bttnOkay;
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.CancelButton = this.bttnCancel;
			this.ClientSize = new System.Drawing.Size(292, 66);
			this.ControlBox = false;
			this.Controls.Add(this.label1);
			this.Controls.Add(this.bttnOkay);
			this.Controls.Add(this.bttnCancel);
			this.Controls.Add(this.cbFileTypes);
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
			this.Name = "FrmFileType";
			this.Text = "File type to extract";
			this.ResumeLayout(false);

		}
		#endregion

		private void bttnCancel_Click(object sender, System.EventArgs e)
		{
			this.DialogResult = DialogResult.Cancel;
			this.Close();
		}

		private void bttnOkay_Click(object sender, System.EventArgs e)
		{
			this.DialogResult = DialogResult.OK;
			this.Close();
		}

		public string SelectedExtension
		{
			get{ return cbFileTypes.SelectedItem.ToString(); }
		}
	}
}