// Wizard script: private void startWizard() { print("startWizard"); bool success = WizCtl.PadConnect(); if (success) { ScriptIsRunning = true; print("Pad detected: " + WizCtl.PadWidth + " x " + WizCtl.PadHeight); switch (WizCtl.PadWidth) { case 396: Pad = new tPad("STU-300", 60, 200, 200, 8, 8, 16, 70); // 396 x 100 break; case 640: Pad = new tPad("STU-500", 300, 360, 390, 16, 22, 32, 110); // 640 x 800 break; case 800: Pad = new tPad("STU-520 or STU-530", 300, 360, 390, 16, 22, 32, 110); // 800 x 480 break; case 320: Pad = new tPad("STU-430 or ePad", 100, 130, 150, 10, 12, 16, 110); // 320 x 200 break; default: print("No compatible device found"); break; } print(Pad.Model); step1(); } else { print("Unable to connect to tablet"); } }
public WizCap(string user_name, string alipay_login_id) { this.Opacity = 0; InitializeComponent(); Callback = new WizardCallback(); Callback.EventHandler = null; WizCtl.SetEventHandler(Callback); confirmYn = ""; ScriptIsRunning = false; if (!ScriptIsRunning) { bool success = WizCtl.PadConnect(); if (success) { ScriptIsRunning = true; WizCtl.Reset(); WizCtl.Licence = "AgAkAEy2cKydAQVXYWNvbQ1TaWduYXR1cmUgU0RLAgKBAgJkAACIAwEDZQA"; WizCtl.AddObject(ObjectType.ObjectText, "txt", "left", 11, "Confirm Personal Information", null); // insert checkbox WizCtl.Font = new Font("Verdana", 10, FontStyle.Regular); WizCtl.AddObject(ObjectType.ObjectText, "txt", 10, 60, " User Name : " + user_name + "\n User Login ID : " + alipay_login_id + "\n", null); WizCtl.Font = new Font("Verdana", 10, FontStyle.Bold); WizCtl.AddObject(ObjectType.ObjectCheckbox, "Check", "centre", 120, "My information is correct", 2); // insert the buttons WizCtl.Font = new Font("Verdana", 10, FontStyle.Regular); WizCtl.AddObject(ObjectType.ObjectButton, "Cancel", "left", "bottom", "Cancel", 110); WizCtl.AddObject(ObjectType.ObjectButton, "OK", "right", "bottom", "OK", 110); // set callback when a button is pressed WizCtl.Display(); Callback.EventHandler = new WizardCallback.Handler(Step1_Handler); WizCtl.SetEventHandler(Callback); } else { MessageBox.Show(this, "not connect", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } else { MessageBox.Show(this, "Script is already running", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
// Separate routine for connecting to pad so that it can be controlled by a timer which allows a delay // between connection attempts private bool connectToPad() { bool success = false; ++connectionAttempt; // If connection has previously failed then we need to destroy and recreate the WizCtl if (connectionAttempt > 1) { recreateWizCtl(); } WizCtl.Licence = "<<license>>"; success = WizCtl.PadConnect(); print("Success " + success); if (success == true) { print("Pad detected: " + WizCtl.PadWidth + " x " + WizCtl.PadHeight); switch (WizCtl.PadWidth) { case 396: Pad = new tPad("STU-300", 60, 200, 200, 8, 8, 16, 70); // 396 x 100 break; case 640: Pad = new tPad("STU-500", 300, 360, 390, 16, 22, 32, 110); // 640 x 800 break; case 800: Pad = new tPad("STU-520 or STU-530", 300, 360, 390, 16, 22, 32, 110); // 800 x 480 break; case 320: Pad = new tPad("STU-430 or ePad", 100, 130, 150, 10, 12, 16, 110); // 320 x 200 break; default: print("No compatible device found"); break; } print(Pad.Model); step1(); } else { secondsWaited += 2; print("waiting to connect..." + secondsWaited); } return(success); }