333 lines
11 KiB
C#
333 lines
11 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
|
|
namespace TmatrixCodeGenerator
|
|
{
|
|
public partial class GenerateCode_Form : Form
|
|
{
|
|
string[] gsPreDataType = new string[4];
|
|
|
|
public GenerateCode_Form()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void Generate_button_Click(object sender, EventArgs e)
|
|
{
|
|
if (BGWithVImage_checkBox.Checked) GlobalClass.gbGenerateBGWithVImage = true;
|
|
else GlobalClass.gbGenerateBGWithVImage = false;
|
|
if (VImage_checkBox.Checked) GlobalClass.gbGenerateVImage = true;
|
|
else GlobalClass.gbGenerateVImage = false;
|
|
if (BGWOVImage_checkBox.Checked) GlobalClass.gbGenerateBGWithoutVImage = true;
|
|
else GlobalClass.gbGenerateBGWithoutVImage = false;
|
|
if (BGWithImage_checkBox.Checked) GlobalClass.gbGenerateBGWithImage = true;
|
|
else GlobalClass.gbGenerateBGWithImage = false;
|
|
GlobalClass.gbGenPageSet = true;
|
|
Close();
|
|
}
|
|
|
|
private void GenerateCode_Form_Load(object sender, EventArgs e)
|
|
{
|
|
GlobalClass.gbGenPageSet = false;
|
|
int i;
|
|
for (i = 0; i < 4; i++)
|
|
{
|
|
GlobalClass.gPointType[i] = 1;
|
|
GlobalClass.gPointDPI[i] = 1;
|
|
}
|
|
}
|
|
|
|
private void Exit_button_Click(object sender, EventArgs e)
|
|
{
|
|
GlobalClass.gbGenPageSet = false;
|
|
Close();
|
|
}
|
|
|
|
private void BGWithVImage_checkBox_CheckedChanged(object sender, EventArgs e)
|
|
{
|
|
if (BGWithVImage_checkBox.Checked == true)
|
|
{
|
|
BGWithVImage_Type_comboBox.Enabled = true;
|
|
BGWithVImage_DPI_comboBox.Enabled = true;
|
|
}
|
|
else
|
|
{
|
|
BGWithVImage_Type_comboBox.Enabled = false;
|
|
BGWithVImage_DPI_comboBox.Enabled = false;
|
|
}
|
|
}
|
|
|
|
private void VImage_checkBox_CheckedChanged(object sender, EventArgs e)
|
|
{
|
|
if (VImage_checkBox.Checked == true)
|
|
{
|
|
VImage_Type_comboBox.Enabled = true;
|
|
VImage_DPI_comboBox.Enabled = true;
|
|
}
|
|
else
|
|
{
|
|
VImage_Type_comboBox.Enabled = false;
|
|
VImage_DPI_comboBox.Enabled = false;
|
|
}
|
|
}
|
|
|
|
private void BGWOVImage_checkBox_CheckedChanged(object sender, EventArgs e)
|
|
{
|
|
if (BGWOVImage_checkBox.Checked == true)
|
|
{
|
|
BGWOVImage_Type_comboBox.Enabled = true;
|
|
BGWOVImage_DPI_comboBox.Enabled = true;
|
|
}
|
|
else
|
|
{
|
|
BGWOVImage_Type_comboBox.Enabled = false;
|
|
BGWOVImage_DPI_comboBox.Enabled = false;
|
|
}
|
|
}
|
|
|
|
private void BGWithImage_checkBox_CheckedChanged(object sender, EventArgs e)
|
|
{
|
|
if (BGWithImage_checkBox.Checked == true)
|
|
{
|
|
BGWithImage_Type_comboBox.Enabled = true;
|
|
BGWithImage_DPI_comboBox.Enabled = true;
|
|
}
|
|
else
|
|
{
|
|
BGWithImage_Type_comboBox.Enabled = false;
|
|
BGWithImage_DPI_comboBox.Enabled = false;
|
|
}
|
|
}
|
|
|
|
private void BGWithVImage_Type_comboBox_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
switch (BGWithVImage_Type_comboBox.Text)
|
|
{
|
|
case "2x2":
|
|
GlobalClass.gPointType[0] = 0;
|
|
break;
|
|
case "3x3":
|
|
GlobalClass.gPointType[0] = 1;
|
|
break;
|
|
case "4x4":
|
|
GlobalClass.gPointType[0] = 2;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
|
|
private void VImage_Type_comboBox_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
switch (VImage_Type_comboBox.Text)
|
|
{
|
|
case "2x2":
|
|
GlobalClass.gPointType[1] = 0;
|
|
break;
|
|
case "3x3":
|
|
GlobalClass.gPointType[1] = 1;
|
|
break;
|
|
case "4x4":
|
|
GlobalClass.gPointType[1] = 2;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
|
|
private void BGWOVImage_Type_comboBox_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
switch (BGWOVImage_Type_comboBox.Text)
|
|
{
|
|
case "2x2":
|
|
GlobalClass.gPointType[2] = 0;
|
|
break;
|
|
case "3x3":
|
|
GlobalClass.gPointType[2] = 1;
|
|
break;
|
|
case "4x4":
|
|
GlobalClass.gPointType[2] = 2;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
|
|
private void BGWithImage_Type_comboBox_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
switch (BGWithImage_Type_comboBox.Text)
|
|
{
|
|
case "2x2":
|
|
GlobalClass.gPointType[3] = 0;
|
|
break;
|
|
case "3x3":
|
|
GlobalClass.gPointType[3] = 1;
|
|
break;
|
|
case "4x4":
|
|
GlobalClass.gPointType[3] = 2;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
|
|
private void BGWithVImage_DPI_comboBox_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
switch (BGWithVImage_DPI_comboBox.Text)
|
|
{
|
|
case "600":
|
|
GlobalClass.gPointDPI[0] = 0;
|
|
gsPreDataType[0] = BGWithVImage_Type_comboBox.Text;
|
|
BGWithVImage_Type_comboBox.Text = "2x2";
|
|
BGWithVImage_Type_comboBox.Enabled = false;
|
|
break;
|
|
case "1200":
|
|
GlobalClass.gPointDPI[0] = 1;
|
|
BGWithVImage_Type_comboBox.Enabled = true;
|
|
BGWithVImage_Type_comboBox.Text = gsPreDataType[0];
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
|
|
private void VImage_DPI_comboBox_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
switch (VImage_DPI_comboBox.Text)
|
|
{
|
|
case "600":
|
|
GlobalClass.gPointDPI[1] = 0;
|
|
gsPreDataType[1] = VImage_Type_comboBox.Text;
|
|
VImage_Type_comboBox.Text = "2x2";
|
|
VImage_Type_comboBox.Enabled = false;
|
|
break;
|
|
case "1200":
|
|
GlobalClass.gPointDPI[1] = 1;
|
|
VImage_Type_comboBox.Enabled = true;
|
|
VImage_Type_comboBox.Text = gsPreDataType[1];
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
|
|
private void BGWOVImage_DPI_comboBox_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
switch (BGWOVImage_DPI_comboBox.Text)
|
|
{
|
|
case "600":
|
|
GlobalClass.gPointDPI[2] = 0;
|
|
gsPreDataType[2] = BGWOVImage_Type_comboBox.Text;
|
|
BGWOVImage_Type_comboBox.Text = "2x2";
|
|
BGWOVImage_Type_comboBox.Enabled = false;
|
|
break;
|
|
case "1200":
|
|
GlobalClass.gPointDPI[2] = 1;
|
|
BGWOVImage_Type_comboBox.Enabled = true;
|
|
BGWOVImage_Type_comboBox.Text = gsPreDataType[2];
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
|
|
private void BGWithImage_DPI_comboBox_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
switch (BGWithImage_DPI_comboBox.Text)
|
|
{
|
|
case "600":
|
|
GlobalClass.gPointDPI[3] = 0;
|
|
gsPreDataType[3] = BGWithImage_Type_comboBox.Text;
|
|
BGWithImage_Type_comboBox.Text = "2x2";
|
|
BGWithImage_Type_comboBox.Enabled = false;
|
|
break;
|
|
case "1200":
|
|
GlobalClass.gPointDPI[3] = 1;
|
|
BGWithImage_Type_comboBox.Enabled = true;
|
|
BGWithImage_Type_comboBox.Text = gsPreDataType[3];
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
|
|
private void BGWithVImage_Type_comboBox_TextChanged(object sender, EventArgs e)
|
|
{
|
|
switch (BGWithVImage_Type_comboBox.Text)
|
|
{
|
|
case "2x2":
|
|
GlobalClass.gPointType[0] = 0;
|
|
break;
|
|
case "3x3":
|
|
GlobalClass.gPointType[0] = 1;
|
|
break;
|
|
case "4x4":
|
|
GlobalClass.gPointType[0] = 2;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
|
|
private void VImage_Type_comboBox_TextChanged(object sender, EventArgs e)
|
|
{
|
|
switch (VImage_Type_comboBox.Text)
|
|
{
|
|
case "2x2":
|
|
GlobalClass.gPointType[1] = 0;
|
|
break;
|
|
case "3x3":
|
|
GlobalClass.gPointType[1] = 1;
|
|
break;
|
|
case "4x4":
|
|
GlobalClass.gPointType[1] = 2;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
|
|
private void BGWOVImage_Type_comboBox_TextChanged(object sender, EventArgs e)
|
|
{
|
|
switch (BGWOVImage_Type_comboBox.Text)
|
|
{
|
|
case "2x2":
|
|
GlobalClass.gPointType[2] = 0;
|
|
break;
|
|
case "3x3":
|
|
GlobalClass.gPointType[2] = 1;
|
|
break;
|
|
case "4x4":
|
|
GlobalClass.gPointType[2] = 2;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
|
|
private void BGWithImage_Type_comboBox_TextChanged(object sender, EventArgs e)
|
|
{
|
|
switch (BGWithImage_Type_comboBox.Text)
|
|
{
|
|
case "2x2":
|
|
GlobalClass.gPointType[3] = 0;
|
|
break;
|
|
case "3x3":
|
|
GlobalClass.gPointType[3] = 1;
|
|
break;
|
|
case "4x4":
|
|
GlobalClass.gPointType[3] = 2;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|