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 Jig_Replicator
{
	public partial class Form2 : Form
	{
		byte page = 0x01;
		byte totalPages = 0x03;
		public byte psptype;
		public byte fsmtype;
		public Form2()
		{

			InitializeComponent();
			NextState(false);
			BackState(false);
			userControl31.Hide();
			userControl41.Hide();
			label2.Text = "Step 1. Determining your PSP model";
		}


		private void Form2_FormClosing(object sender, FormClosingEventArgs e)
		{
			Program.frm1.Show();
		}

		private void button1_Click(object sender, EventArgs e)
		{
			if (page < totalPages)
			{
				page += 0x01;
				RefreshPages();
			}
		}

		private void button2_Click(object sender, EventArgs e)
		{
			if (page > 0x01)
			{
				page -= 0x01;
				RefreshPages();
			}
		}
		private void RefreshPages()
		{
			if (page == 0x01)
			{   
				button2.Enabled = false;
				userControl31.Hide();
				userControl22.Show();
				label2.Text = "Step 1. Determining your PSP model";
				NextState(true);
			}
			else if (page == 0x02)
			{
				button2.Enabled = true;
				userControl31.SummRev(psptype);
				userControl22.Hide();
				userControl31.Show();
				userControl41.Hide();
				label2.Text = "Step 2. Estimating requirements";
				if ((psptype == 4) || (psptype == 5)) NextState(false);
				else NextState(true);
			}
			else if (page == 0x03)
			{
				button2.Enabled = true;
				userControl31.Hide();
				userControl41.revdependent_uc4(psptype);
				userControl41.Show();
				label2.Text = "Step 3. Creating your servicemode hardware";
			}

		}
		public void NextState(bool state)
		{
			button1.Enabled = state;
		}
		public void BackState(bool state)
		{
			button2.Enabled = state;
		}
	}
} 
