// 2008.11.12 YZ Modify splash screen
// 2008.11.12 YZ Modify draw logo point & draw timing
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace freetrain.framework
{
	/// <summary>
	/// Splash screen that reports the progress of initialization.
	/// </summary>
	public class Splash : Form
	{
		bool exflag = true;
		public Splash() {
			InitializeComponent();
		}

		public void updateMessage( string msg, float progress ) {
			status.Text = msg;
			progressBar.Value = (int)(100*progress);
			Application.DoEvents();
#region YZ_20081112_MODIFIED
//			if(progress>0.4 && exflag){
			if(progress>0 && exflag){
#endregion
				Graphics g = pictureBox1.CreateGraphics();
#region YZ_20081112_MODIFIED
//				imageList.Draw(g,232,128,0);
				imageList.Draw(g,190,128,0);
#endregion
				exflag = false;
			}
		}

		protected override void Dispose( bool disposing ) {
			if( disposing && components != null)
				components.Dispose();
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		private System.Windows.Forms.PictureBox pictureBox1;
		private System.Windows.Forms.Label status;
		private System.Windows.Forms.ImageList imageList;
		private System.Windows.Forms.ProgressBar progressBar;
		private System.ComponentModel.IContainer components;

		/// <summary>
		/// デザイナ サポートに必要なメソッドです。このメソッドの内容を
		/// コード エディタで変更しないでください。
		/// </summary>
		private void InitializeComponent()
		{
        this.components = new System.ComponentModel.Container();
        System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Splash));
        this.pictureBox1 = new System.Windows.Forms.PictureBox();
        this.status = new System.Windows.Forms.Label();
        this.imageList = new System.Windows.Forms.ImageList(this.components);
        this.progressBar = new System.Windows.Forms.ProgressBar();
        ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
        this.SuspendLayout();
        // 
        // pictureBox1
        // 
        this.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
        this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
        this.pictureBox1.Location = new System.Drawing.Point(0,0);
        this.pictureBox1.Name = "pictureBox1";
        this.pictureBox1.Size = new System.Drawing.Size(324,244);
        this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
        this.pictureBox1.TabIndex = 0;
        this.pictureBox1.TabStop = false;
        // 
        // status
        // 
        this.status.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
        this.status.Location = new System.Drawing.Point(0,255);
        this.status.Name = "status";
        this.status.Size = new System.Drawing.Size(324,30);
        this.status.TabIndex = 1;
        // 
        // imageList
        // 
        this.imageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList.ImageStream")));
        this.imageList.TransparentColor = System.Drawing.Color.Transparent;
        this.imageList.Images.SetKeyName(0,"exav.gif");
        // 
        // progressBar
        // 
        this.progressBar.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
            | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
        this.progressBar.Location = new System.Drawing.Point(1,245);
        this.progressBar.Name = "progressBar";
        this.progressBar.Size = new System.Drawing.Size(322,9);
        this.progressBar.TabIndex = 2;
        // 
        // Splash
        // 
        this.AutoScaleBaseSize = new System.Drawing.Size(6,15);
        this.ClientSize = new System.Drawing.Size(324,285);
        this.Controls.Add(this.progressBar);
        this.Controls.Add(this.status);
        this.Controls.Add(this.pictureBox1);
        this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
        this.Name = "Splash";
        this.ShowInTaskbar = false;
        this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
        this.Text = "Splash";
        ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
        this.ResumeLayout(false);
        this.PerformLayout();

		}
		#endregion
	}
}
