Example #1
0
        private void testToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string tempFileName = Path.GetTempFileName();

            if (Compile(tempFileName))
            {
                KeyMagicDotNet.KeyMagicEngine engine = new KeyMagicDotNet.KeyMagicEngine();
                if (engine.LoadKeyboardFile(tempFileName) == false)
                {
                    MessageBox.Show("Cannot load keyboard file to test");
                    return;
                }

                KeyMagicDotNet.KeyMagicKeyboard keyboard = engine.GetKeyboard();
                Byte[] font = keyboard.getInfo("font");
                Font   f    = selectedFont;
                if (font != null)
                {
                    f = new Font(Encoding.UTF8.GetString(font), selectedFont.Size);
                }

                TesterForm tester = new TesterForm(engine, f);
                tester.Show();
                tester.FormClosed += new FormClosedEventHandler(
                    delegate(object xsender, FormClosedEventArgs xe)
                {
                    File.Delete(tempFileName);
                }
                    );
            }
            else
            {
                File.Delete(tempFileName);
            }
        }
Example #2
0
        public TesterForm(KeyMagicDotNet.KeyMagicEngine engine, Font f)
        {
            InitializeComponent();

            txtInput.Font   = f;
            txtInput.Engine = engine;
        }
Example #3
0
 public LayoutInfo(int i, KeyMagicDotNet.KeyMagicEngine e)
 {
     index  = i;
     engine = e;
 }
Example #4
0
 public LayoutInfo(int i, KeyMagicDotNet.KeyMagicEngine e)
 {
     index = i;
     engine = e;
 }