using AR; 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 Project.Dialog { public partial class fZPLEditor : Form { string fn = string.Empty; public fZPLEditor(string fn_) { InitializeComponent(); this.fn = fn_; this.FormClosed += FZPLEditor_FormClosed; this.logTextBox1.ColorList = new arCtl.sLogMessageColor[] { new arCtl.sLogMessageColor("NORM",Color.White), new arCtl.sLogMessageColor("ERR", Color.Red), new arCtl.sLogMessageColor("WARN",Color.Tomato), new arCtl.sLogMessageColor("INFO",Color.SkyBlue), new arCtl.sLogMessageColor("BCD", Color.Yellow) }; this.logTextBox1.EnableDisplayTimer = false; this.logTextBox1.DateFormat = "HH:mm:ss"; this.logTextBox1.ForeColor = Color.White; toolStripStatusLabel1.Text = fn_; } private void FZPLEditor_FormClosed(object sender, FormClosedEventArgs e) { PUB.log.RaiseMsg -= Log_RaiseMsg; } private void fZPLEditor_Load(object sender, EventArgs e) { if (System.IO.File.Exists(this.fn)) this.richTextBox1.Text = System.IO.File.ReadAllText(this.fn, System.Text.Encoding.Default); PUB.log.RaiseMsg += Log_RaiseMsg; } private void Log_RaiseMsg(DateTime LogTime, string TypeStr, string Message) { this.logTextBox1.AddMsg(LogTime, TypeStr, Message); } private void toolStripButton1_Click(object sender, EventArgs e) { //load if (UTIL.MsgQ("다시 불러 올까요?") == DialogResult.Yes) this.richTextBox1.Text = System.IO.File.ReadAllText(this.fn, System.Text.Encoding.Default); } private void toolStripButton2_Click(object sender, EventArgs e) { //save if (UTIL.MsgQ("저장 할까요?") == DialogResult.Yes) System.IO.File.WriteAllText(this.fn, this.richTextBox1.Text.Trim(), System.Text.Encoding.Default); } private void toolStripButton4_Click(object sender, EventArgs e) { //right if (PUB.PrinterR.IsOpen) PUB.PrinterR.Print(this.richTextBox1.Text); else PUB.log.AddAT("프린터R연결 안됨"); } private void toolStripButton3_Click(object sender, EventArgs e) { //left if (PUB.PrinterL.IsOpen) PUB.PrinterL.Print(this.richTextBox1.Text); else PUB.log.AddAT("프린터L 연결 안됨"); } } }