Example #1
0
        private void btnSettings_Click(object sender, EventArgs e)
        {
            if (SetupForm == null || SetupForm.IsDisposed)
            {
                SetupForm = new KeyboardSetup(this);
            }

            SetupForm.Show();
        }
Example #2
0
 public Keyboard(CWExpert form)
 {
     try
     {
         this.AutoScaleMode = AutoScaleMode.Inherit;
         InitializeComponent();
         float  dpi                   = this.CreateGraphics().DpiX;
         float  ratio                 = dpi / 96.0f;
         string font_name             = this.Font.Name;
         float  size                  = 8.25f / ratio;
         System.Drawing.Font new_font = new System.Drawing.Font(font_name, size);
         this.Font = new_font;
         MainForm  = form;
         GetOptions();
         SetWindowPos(this.Handle.ToInt32(), -1, this.Left, this.Top,
                      this.Width, this.Height, 0); // on top others
         SetupForm = new KeyboardSetup(this);
         UpdateButtons();
     }
     catch (Exception ex)
     {
         Debug.Write(ex.ToString());
     }
 }
Example #3
0
        private void Keyboard_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                switch (e.KeyCode)
                {
                    case Keys.F1:
                        string msg = CMD1;
                        msg = MacroHandler(msg);
                        rtbKeyboardText.AppendText(msg);
                        break;

                    case Keys.F2:
                        msg = CMD2;
                        msg = MacroHandler(msg);
                        rtbKeyboardText.AppendText(msg);
                        break;

                    case Keys.F3:
                        msg = CMD3;
                        msg = MacroHandler(msg);
                        rtbKeyboardText.AppendText(msg);
                        break;

                    case Keys.F4:
                        msg = CMD4;
                        msg = MacroHandler(msg);
                        rtbKeyboardText.AppendText(msg);
                        break;

                    case Keys.F5:
                        msg = CMD5;
                        msg = MacroHandler(msg);
                        rtbKeyboardText.AppendText(msg);
                        break;

                    case Keys.F6:
                        msg = CMD6;
                        msg = MacroHandler(msg);
                        rtbKeyboardText.AppendText(msg);
                        break;

                    case Keys.F7:
                        msg = CMD7;
                        msg = MacroHandler(msg);
                        rtbKeyboardText.AppendText(msg);
                        break;

                    case Keys.F8:
                        msg = CMD8;
                        msg = MacroHandler(msg);
                        rtbKeyboardText.AppendText(msg);
                        break;

                    case Keys.F9:
                        rtbKeyboardText.Clear();
                        break;

                    case Keys.F10:
                        btnSend_Click(this, EventArgs.Empty);
                        break;

                    case Keys.F11:
                        this.Hide();
                        break;

                    case Keys.F12:
                        if (SetupForm == null || SetupForm.IsDisposed)
                            SetupForm = new KeyboardSetup(this);

                        SetupForm.Show();
                        break;
                }

            }
            catch (Exception ex)
            {
                Debug.Write(ex.ToString());
            }
        }
Example #4
0
 public Keyboard(CWExpert form)
 {
     try
     {
         this.AutoScaleMode = AutoScaleMode.Inherit;
         InitializeComponent();
         float dpi = this.CreateGraphics().DpiX;
         float ratio = dpi / 96.0f;
         string font_name = this.Font.Name;
         float size = 8.25f / ratio;
         System.Drawing.Font new_font = new System.Drawing.Font(font_name, size);
         this.Font = new_font;
         MainForm = form;
         GetOptions();
         SetWindowPos(this.Handle.ToInt32(), -1, this.Left, this.Top,
                 this.Width, this.Height, 0);  // on top others
         SetupForm = new KeyboardSetup(this);
         UpdateButtons();
     }
     catch (Exception ex)
     {
         Debug.Write(ex.ToString());
     }
 }
Example #5
0
        private void btnSettings_Click(object sender, EventArgs e)
        {
            if (SetupForm == null || SetupForm.IsDisposed)
                SetupForm = new KeyboardSetup(this);

            SetupForm.Show();
        }
Example #6
0
        private void Keyboard_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                switch (e.KeyCode)
                {
                case Keys.F1:
                    string msg = CMD1;
                    msg = MacroHandler(msg);
                    rtbKeyboardText.AppendText(msg);
                    break;

                case Keys.F2:
                    msg = CMD2;
                    msg = MacroHandler(msg);
                    rtbKeyboardText.AppendText(msg);
                    break;

                case Keys.F3:
                    msg = CMD3;
                    msg = MacroHandler(msg);
                    rtbKeyboardText.AppendText(msg);
                    break;

                case Keys.F4:
                    msg = CMD4;
                    msg = MacroHandler(msg);
                    rtbKeyboardText.AppendText(msg);
                    break;

                case Keys.F5:
                    msg = CMD5;
                    msg = MacroHandler(msg);
                    rtbKeyboardText.AppendText(msg);
                    break;

                case Keys.F6:
                    msg = CMD6;
                    msg = MacroHandler(msg);
                    rtbKeyboardText.AppendText(msg);
                    break;

                case Keys.F7:
                    msg = CMD7;
                    msg = MacroHandler(msg);
                    rtbKeyboardText.AppendText(msg);
                    break;

                case Keys.F8:
                    msg = CMD8;
                    msg = MacroHandler(msg);
                    rtbKeyboardText.AppendText(msg);
                    break;

                case Keys.F9:
                    rtbKeyboardText.Clear();
                    break;

                case Keys.F10:
                    btnSend_Click(this, EventArgs.Empty);
                    break;

                case Keys.F11:
                    this.Hide();
                    break;

                case Keys.F12:
                    if (SetupForm == null || SetupForm.IsDisposed)
                    {
                        SetupForm = new KeyboardSetup(this);
                    }

                    SetupForm.Show();
                    break;
                }
            }
            catch (Exception ex)
            {
                Debug.Write(ex.ToString());
            }
        }
Example #7
0
        public Keyboard(CWExpert form)
        {
            try
            {
                this.AutoScaleMode = AutoScaleMode.Inherit;
                InitializeComponent();
                rtbKeyboardText.Clear();
                rtbSentText.Clear();
                float dpi = this.CreateGraphics().DpiX;
                float ratio = dpi / 96.0f;
                string font_name = this.Font.Name;
                float size = 8.25f / ratio;
                System.Drawing.Font new_font = new System.Drawing.Font(font_name, size);
                this.Font = new_font;
                MainForm = form;
                GetOptions();
                SetWindowPos(this.Handle.ToInt32(), -1, this.Left, this.Top,
                        this.Width, this.Height, 0);  // on top others
                SetupForm = new KeyboardSetup(this);
                UpdateButtons();

                string msg = CMD1;
                msg = MacroHandler(msg);
                toolTip1.SetToolTip(btn1, msg);
                msg = CMD2;
                msg = MacroHandler(msg);
                toolTip1.SetToolTip(btn2, msg);
                msg = CMD3;
                msg = MacroHandler(msg);
                toolTip1.SetToolTip(btn3, msg);
                msg = CMD4;
                msg = MacroHandler(msg);
                toolTip1.SetToolTip(btn4, msg);
                msg = CMD5;
                msg = MacroHandler(msg);
                toolTip1.SetToolTip(btn5, msg);
                msg = CMD6;
                msg = MacroHandler(msg);
                toolTip1.SetToolTip(btn6, msg);
                msg = CMD7;
                msg = MacroHandler(msg);
                toolTip1.SetToolTip(btn7, msg);
                msg = CMD8;
                msg = MacroHandler(msg);
                toolTip1.SetToolTip(btn8, msg);
            }
            catch (Exception ex)
            {
                Debug.Write(ex.ToString());
            }
        }