// ******************************************************************* private void NameChk() { string s0 = WizString.CodeToString(m_scn, m_nameOrg.ToArray()); string s1 = WizString.CodeToString(m_scn, m_name.ToArray()); this.Text = s0 + "/" + s1; bool ret = ((m_name.Count > 0) && (s0 != s1)); if (ret) { ret = CanSetName(s1); } btnOK.Enabled = ret; }
private void button7_Click(object sender, EventArgs e) { byte[] a = WizString.StringToCode(WIZSCN.GBC1, WizString.NoneName); string s = ""; for (int i = 0; i < a.Length; i++) { if (s != "") { s += ","; } s += String.Format("0x{0:X2}", a[i]); } s = "static public readonly byte[] WizGBCNoneName = new byte[] {" + s + "};//-- NONE --"; textBox1.Text = s; }
// ******************************************************************* protected override void OnPaint(PaintEventArgs e) { //base.OnPaint(e); Graphics g = e.Graphics; SolidBrush sb = new SolidBrush(this.BackColor); Pen pn = new Pen(this.ForeColor); StringFormat sf = new StringFormat(); sf.LineAlignment = StringAlignment.Center; sf.Alignment = StringAlignment.Near; try { sb.Color = Color.Black; g.FillRectangle(sb, new Rectangle(0, 0, this.Width, this.Height)); int x = 20; int y = 20; sb.Color = Color.White; g.DrawString(WizString.CodeToString(m_scn, m_nameOrg.ToArray()), this.Font, sb, x, y); y += 25; g.DrawString(WizString.CodeToString(m_scn, m_name.ToArray()), this.Font, sb, x, y); sb.Color = Color.White; Rectangle rct = new Rectangle(0, 0, 0, 0); sf.Alignment = StringAlignment.Center; int target = 0; if (m_scn == WIZSCN.FC1) { target = WizString.Wiz1FCStringStart; y = m_TopM; for (int j = 0; j < 0x10; j++) { x = m_LeftM; for (int i = 0; i < 0x10; i++) { rct = new Rectangle(x, y, m_MWidth, m_MHeight); g.DrawString(WizString.Wiz1FCStrings[target], this.Font, sb, rct, sf); target++; if (target >= WizString.Wiz1FCStringSize) { break; } x += m_MWidth; } if (target >= WizString.Wiz1FCStringSize) { break; } y += m_MHeight; } } else { target = WizString.Wiz2FCStringStart; y = m_TopM; for (int j = 0; j < 0x10; j++) { x = m_LeftM; for (int i = 0; i < 0x10; i++) { rct = new Rectangle(x, y, m_MWidth, m_MHeight); g.DrawString(WizString.Wiz2FCStrings[target], this.Font, sb, rct, sf); target++; if (target >= WizString.Wiz2FCStringSize) { break; } x += m_MWidth; } if (target >= WizString.Wiz2FCStringSize) { break; } y += m_MHeight; } } } finally { sb.Dispose(); pn.Dispose(); } }