Exemplo n.º 1
0
        private void GetPmcValue(Glass.GlassButton button)
        {
            int tag = 0;

            Int32.TryParse(button.Tag.ToString(), out tag);
            int tag_r  = tag / 10;
            int result = 0;


            int r = 0;


//             switch (tag_r)
//             {
//                 case (10): // CTC_PIO
//                     r = tag - 100;
//                     result = instance.GetPIO((CTC_PIO)r);//0== 논셋           1== 셋        음수값 == 에러;
//                     break;
//                 case (110): // CTC_VTM_ROBOT
//                     r = tag - 1100;
//                     result = instance.GetVTMRobot((CTC_VTM_ROBOT)r);
//                     break;
//                 case (12): // CTC_MANUAL
//                     r = tag - 120;
//                     result = instance.GetManualCmd((CTC_MANUAL)r);
//                     break;
//
//                 case (20): // PMC_PIO
//                     r = tag - 200;
//                     result = instance.GetPIO((PMC_PIO)r);//0== 논셋           1== 셋        음수값 == 에러;
//                     break;
//                 case (21)://PMC_MOTOR
//                     r = tag - 210;
//                     result = instance.GetMotor((PMC_MOTOR)r);
//                     break;
//                 case (22)://PMC_MANUAL
//                     r = tag - 220;
//                     result = instance.GetManualCmd((PMC_MANUAL)r);
//                     break;
//                 case (23)://PMC_MANUAL
//                     r = tag - 220;
//                     result = instance.GetManualCmd((PMC_MANUAL)r);
//                     break;
//
//             }
//             if (result == 1)
//             {
//                 button.BackColor = System.Drawing.Color.Lime;
//             }
//             if (result == 0)
//             {
//                 button.BackColor = System.Drawing.Color.DimGray;
//             }
//             if(result < 0)//통신오류
//             {
//                 //MessageBox.Show("통신오류 통신확인");
//             }
        }
Exemplo n.º 2
0
        private void VKeyPress(object sender, MouseEventArgs e)
        {
            Glass.GlassButton btn = (Glass.GlassButton)sender;
            if (btn.Enabled == false)
            {
                return;
            }
            if (btn.Text == "SHIFT")
            {
                shift = !shift;
                UpdateVisual();
            }
            else if (btn.Text == "ALT")
            {
                alt = !alt;
                UpdateVisual();
            }
            else if (btn.Text == "bspace")
            {
                iop.Income("delete");
                if (shift || alt)
                {
                    shift = false;
                    alt   = false;
                    UpdateVisual();
                }
            }
            else if (btn.Text.StartsWith("\u25cc\t\t"))
            {
                string dk = btn.Text.Substring(2).Trim();
                dk      = dk.Replace("[", "").Replace("]", "");
                dkstate = dk;
                UpdateVisual();
            }
            else
            {
                string chr = btn.Text.Replace("◌", "").Trim();
                foreach (string s in iop.CompatibilityDecompose(chr))
                {
                    iop.Income(s);
                }
                if (shift || alt || (dkstate != "none"))
                {
                    shift   = false;
                    alt     = false;
                    dkstate = "none";
                    UpdateVisual();
                }
            }
            Log l = new Log();

            l.write("VKPRESS: " + btn.Text);
            eventInitiated = true;
            //MyInput.Keyboard_Classes.Buffer bf = new MyInput.Keyboard_Classes.Buffer();
            //glassButton40.Text = bf.getBuffer();
        }
Exemplo n.º 3
0
        internal void UpdateVisual()
        {
            string font     = kl.getFont();
            double fonssize = Convert.ToDouble(kl.getFontSize());

            foreach (Object b in this.Controls)
            {
                if (typeof(Glass.GlassButton) == b.GetType())
                {
                    Glass.GlassButton g = (Glass.GlassButton)b;
                    g.Font = new Font(font, (float)fonssize);
                    if (g.VKCode != null)
                    {
                        Key k = new Key();
                        k.shift  = shift;
                        k.alt    = alt;
                        k.vkCode = Convert.ToInt32(g.VKCode, 16);
                        if (dkstate != "none")
                        {
                            k = kl.ProcessKey(k, dkstate);
                        }
                        else
                        {
                            k = kl.ProcessKey(k);
                        }
                        if (k.ch.StartsWith("[") && k.ch.EndsWith("]"))
                        {
                            g.Text = "\u25cc\t\t" + k.ch;
                        }
                        else
                        {
                            g.Text = k.ch;
                        }
                    }
                    else
                    {
                        if (shift)
                        {
                            if (g.Text == "SHIFT")
                            {
                                g.InnerBorderColor = Color.LightSkyBlue;
                            }
                        }
                        else
                        {
                            if (g.Text == "SHIFT")
                            {
                                g.InnerBorderColor = Color.FromArgb(64, 64, 64, 20);
                            }
                        }

                        if (alt)
                        {
                            if (g.Text == "ALT")
                            {
                                g.InnerBorderColor = Color.LightSkyBlue;
                            }
                        }
                        else
                        {
                            if (g.Text == "ALT")
                            {
                                g.InnerBorderColor = Color.FromArgb(64, 64, 64, 20);
                            }
                        }
                    }
                }
            }
        }
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmBcode));
     this.label1 = new System.Windows.Forms.Label();
     this.txtBCode = new System.Windows.Forms.TextBox();
     this.pictureBox1 = new System.Windows.Forms.PictureBox();
     this.txtItemName = new System.Windows.Forms.TextBox();
     this.label2 = new System.Windows.Forms.Label();
     this.label3 = new System.Windows.Forms.Label();
     this.glassButton1 = new Glass.GlassButton();
     this.glassButton2 = new Glass.GlassButton();
     ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
     this.SuspendLayout();
     //
     // label1
     //
     this.label1.AutoSize = true;
     this.label1.Location = new System.Drawing.Point(11, 103);
     this.label1.Name = "label1";
     this.label1.Size = new System.Drawing.Size(66, 18);
     this.label1.TabIndex = 1;
     this.label1.Text = "Barcode:";
     //
     // txtBCode
     //
     this.txtBCode.Location = new System.Drawing.Point(98, 98);
     this.txtBCode.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
     this.txtBCode.Name = "txtBCode";
     this.txtBCode.Size = new System.Drawing.Size(320, 25);
     this.txtBCode.TabIndex = 2;
     this.txtBCode.TextChanged += new System.EventHandler(this.txtBCode_TextChanged);
     //
     // pictureBox1
     //
     this.pictureBox1.BackColor = System.Drawing.SystemColors.ActiveCaption;
     this.pictureBox1.Location = new System.Drawing.Point(228, 153);
     this.pictureBox1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
     this.pictureBox1.Name = "pictureBox1";
     this.pictureBox1.Size = new System.Drawing.Size(18, 19);
     this.pictureBox1.TabIndex = 3;
     this.pictureBox1.TabStop = false;
     this.pictureBox1.Visible = false;
     //
     // txtItemName
     //
     this.txtItemName.Location = new System.Drawing.Point(98, 62);
     this.txtItemName.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
     this.txtItemName.Name = "txtItemName";
     this.txtItemName.Size = new System.Drawing.Size(320, 25);
     this.txtItemName.TabIndex = 5;
     this.txtItemName.TextChanged += new System.EventHandler(this.txtItemName_TextChanged);
     //
     // label2
     //
     this.label2.AutoSize = true;
     this.label2.Location = new System.Drawing.Point(11, 67);
     this.label2.Name = "label2";
     this.label2.Size = new System.Drawing.Size(87, 18);
     this.label2.TabIndex = 4;
     this.label2.Text = "Item name:";
     //
     // label3
     //
     this.label3.AutoSize = true;
     this.label3.Font = new System.Drawing.Font("Tahoma", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.label3.Location = new System.Drawing.Point(12, 18);
     this.label3.Name = "label3";
     this.label3.Size = new System.Drawing.Size(188, 25);
     this.label3.TabIndex = 7;
     this.label3.Text = "Barcode Generator";
     //
     // glassButton1
     //
     this.glassButton1.GlowColor = System.Drawing.Color.Gray;
     this.glassButton1.Location = new System.Drawing.Point(126, 232);
     this.glassButton1.Name = "glassButton1";
     this.glassButton1.OuterBorderColor = System.Drawing.Color.Transparent;
     this.glassButton1.Size = new System.Drawing.Size(111, 34);
     this.glassButton1.TabIndex = 8;
     this.glassButton1.Text = "SAVE";
     this.glassButton1.Click += new System.EventHandler(this.glassButton1_Click);
     //
     // glassButton2
     //
     this.glassButton2.GlowColor = System.Drawing.Color.Gray;
     this.glassButton2.Location = new System.Drawing.Point(258, 232);
     this.glassButton2.Name = "glassButton2";
     this.glassButton2.OuterBorderColor = System.Drawing.Color.Transparent;
     this.glassButton2.Size = new System.Drawing.Size(111, 34);
     this.glassButton2.TabIndex = 9;
     this.glassButton2.Text = "EXIT";
     this.glassButton2.Click += new System.EventHandler(this.glassButton2_Click);
     //
     // FrmBcode
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 18F);
     this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     this.BackColor = System.Drawing.SystemColors.InactiveCaptionText;
     this.ClientSize = new System.Drawing.Size(478, 288);
     this.Controls.Add(this.glassButton2);
     this.Controls.Add(this.glassButton1);
     this.Controls.Add(this.label3);
     this.Controls.Add(this.txtItemName);
     this.Controls.Add(this.label2);
     this.Controls.Add(this.pictureBox1);
     this.Controls.Add(this.txtBCode);
     this.Controls.Add(this.label1);
     this.Font = new System.Drawing.Font("Tahoma", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.ForeColor = System.Drawing.SystemColors.GradientInactiveCaption;
     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
     this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
     this.Name = "FrmBcode";
     this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
     this.Text = "Blue and Silver Barcode Generator";
     this.Load += new System.EventHandler(this.FrmBcode_Load);
     ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
     this.ResumeLayout(false);
     this.PerformLayout();
 }
Exemplo n.º 5
0
 private void glassButton4_Click(object sender, EventArgs e)
 {
     Activate();
     Glass.GlassButton gl = (Glass.GlassButton)sender;
     mainmenu.Show(gl, new Point(0, 0), ToolStripDropDownDirection.Left);
 }