// 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 TestWizSigCapt() { InitializeComponent(); // initialise Wizard script support Callback = new WizardCallback(); // Callback provided via InteropAXFlWizCOM Callback.EventHandler = null; WizCtl.SetEventHandler(Callback); ScriptIsRunning = false; }
private void closeWizard() { print("closeWizard()"); ScriptIsRunning = false; WizCtl.Reset(); WizCtl.Display(); WizCtl.PadDisconnect(); Callback.EventHandler = null; // remove handler WizCtl.SetEventHandler(Callback); }
private void closeWizard() { print("closeWizard()"); connectTimer.Enabled = false; ScriptIsRunning = false; WizCtl.Reset(); WizCtl.PadDisconnect(); Callback.EventHandler = null; // remove handler WizCtl.SetEventHandler(Callback); connectionAttempt = 0; }
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); } }
private void step2() { WizCtl.Reset(); // insert message WizCtl.Font = Pad.TextFont; WizCtl.AddObject(ObjectType.ObjectText, "txt", "centre", "top", "Please sign below...", null); // insert a signature line WizCtl.Font = Pad.SigLineFont; if (Pad.Model == "STU-300") { WizCtl.AddObject(ObjectType.ObjectText, "txt", "left", Pad.signatureLineY, "X..............................", null); } else { WizCtl.AddObject(ObjectType.ObjectText, "txt", "centre", Pad.signatureLineY, "X..............................", null); } // insert the signature control WizCtl.Font = Pad.TextFont; WizCtl.AddObject(ObjectType.ObjectSignature, "Sig", 0, 0, SigCtl.Signature, null); // provide who and why for sig capture WizCtl.AddObject(ObjectType.ObjectText, "who", "right", Pad.whoY, "J Smith", null); WizCtl.AddObject(ObjectType.ObjectText, "why", "right", Pad.whyY, "I certify that the information is correct", null); // insert the buttons WizCtl.Font = Pad.ButtonFont; if (Pad.Model == "STU-300") { WizCtl.AddObject(ObjectType.ObjectButton, "Cancel", "right", "top", "Cancel", Pad.buttonWith); WizCtl.AddObject(ObjectType.ObjectButton, "Clear", "right", "middle", "Clear", Pad.buttonWith); WizCtl.AddObject(ObjectType.ObjectButton, "OK", "right", "bottom", "OK", Pad.buttonWith); } else { WizCtl.AddObject(ObjectType.ObjectButton, "Cancel", "left", "bottom", "Cancel", Pad.buttonWith); WizCtl.AddObject(ObjectType.ObjectButton, "Clear", "center", "bottom", "Clear", Pad.buttonWith); WizCtl.AddObject(ObjectType.ObjectButton, "OK", "right", "bottom", "OK", Pad.buttonWith); } // set callback when a button is pressed Callback.EventHandler = new WizardCallback.Handler(Step2_Handler); WizCtl.SetEventHandler(Callback); WizCtl.Display(); }
// 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); }
private void closeWizard() { print("closeWizard()"); ScriptIsRunning = false; WizCtl.Reset(); WizCtl.Display(); WizCtl.AddObject(ObjectType.ObjectText, "txt1", "centre", "middle", "WACOM STU Signature Pad", null); WizCtl.AddObject(ObjectType.ObjectDisplayAtShutdown, "txt", 0, 0, null, null); WizCtl.Display(); print("Added shutdown text"); WizCtl.PadDisconnect(); Callback.EventHandler = null; // remove handler WizCtl.SetEventHandler(Callback); }
private void step1() { WizCtl.Reset(); // insert checkbox WizCtl.Font = Pad.TextFont; WizCtl.AddObject(ObjectType.ObjectCheckbox, "Check", "centre", "middle", "I have read and I accept the terms and conditions", 2); // insert the buttons WizCtl.Font = Pad.ButtonFont; WizCtl.AddObject(ObjectType.ObjectButton, "Cancel", "left", "bottom", "Cancel", Pad.buttonWith); WizCtl.AddObject(ObjectType.ObjectButton, "Next", "right", "bottom", "Next", Pad.buttonWith); // set callback when a button is pressed Callback.EventHandler = new WizardCallback.Handler(Step1_Handler); WizCtl.SetEventHandler(Callback); WizCtl.Display(); }
// Function to destroy existing WizCtl and recreate it. // This is needed because WizCtl attempts to find, and connect to, a pad during construction // (so that it can initialize itself based on size of pad screen and also potentially resize its window to match). // If it fails to connect to a pad at that point it assumes there isn't one and any subsequent attempt to connect with PadConnect will fail. private void recreateWizCtl() { // Destroy the existing WizCtl WizCtl.Dispose(); // Now recreate it this.WizCtl = new Florentis.AxWizCtl(); this.WizCtl.Licence = "<<license>>"; System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TestWizSigCapt)); ((System.ComponentModel.ISupportInitialize)(this.WizCtl)).BeginInit(); this.WizCtl.Enabled = true; this.WizCtl.Location = new System.Drawing.Point(340, 173); this.WizCtl.Name = "WizCtl"; this.WizCtl.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("WizCtl.OcxState"))); this.WizCtl.Size = new System.Drawing.Size(402, 242); this.WizCtl.TabIndex = 4; this.Controls.Add(this.WizCtl); // Make sure it's invisible so it doesn't appear on the monitor //this.WizCtl.Visible = false; }
private void step1() { int x, y; int keyWidth = 60; String txtPrompt; pinLength = 0; y = 10; x = 30; WizCtl.Reset(); WizCtl.Font = Pad.TextFont; // Display prompt. On the STU-300 this must be shorter and on the left in the middle. // Also the starting vertical position for the PIN numbers must be higher and the keys themselves narrower if (Pad.Model == "STU-300") { txtPrompt = "Enter a 4 digit PIN"; WizCtl.AddObject(ObjectType.ObjectText, "txt", "left", "middle", txtPrompt, null); y = 20; keyWidth = 20; } else { txtPrompt = "Enter a 4 digit PIN code below"; WizCtl.AddObject(ObjectType.ObjectText, "txt", x, y, txtPrompt, null); if (Pad.Model == "STU-430 or ePad") { y = 50; keyWidth = 30; } else { y = 10 + 7 * 28; } } x = WizCtl.PadWidth / 2 - keyWidth / 2 - 2 * keyWidth; WizCtl.AddObject(ObjectType.ObjectButton, "1", x, y, "1", keyWidth); x = WizCtl.PadWidth / 2 - keyWidth / 2; WizCtl.AddObject(ObjectType.ObjectButton, "2", x, y, "2", keyWidth); x += 2 * keyWidth; WizCtl.AddObject(ObjectType.ObjectButton, "3", x, y, "3", keyWidth); x = WizCtl.PadWidth / 2 - keyWidth / 2 - 2 * keyWidth; y += keyWidth; WizCtl.AddObject(ObjectType.ObjectButton, "4", x, y, "4", keyWidth); x = WizCtl.PadWidth / 2 - keyWidth / 2; WizCtl.AddObject(ObjectType.ObjectButton, "5", x, y, "5", keyWidth); x += 2 * keyWidth; WizCtl.AddObject(ObjectType.ObjectButton, "6", x, y, "6", keyWidth); x = WizCtl.PadWidth / 2 - keyWidth / 2 - 2 * keyWidth; y += keyWidth; WizCtl.AddObject(ObjectType.ObjectButton, "7", x, y, "7", keyWidth); x = WizCtl.PadWidth / 2 - keyWidth / 2; WizCtl.AddObject(ObjectType.ObjectButton, "8", x, y, "8", keyWidth); x += 2 * keyWidth; WizCtl.AddObject(ObjectType.ObjectButton, "9", x, y, "9", keyWidth); x = WizCtl.PadWidth / 2 - keyWidth / 2 - 2 * keyWidth; y += keyWidth; WizCtl.AddObject(ObjectType.ObjectButton, "delete", x, y, "<< Delete", 3 * keyWidth); x = WizCtl.PadWidth / 2 - keyWidth / 2 + 2 * keyWidth; WizCtl.AddObject(ObjectType.ObjectButton, "0", x, y, "0", keyWidth); testInput.MinLength = 1; testInput.MaxLength = 4; WizCtl.AddObject(ObjectType.ObjectInput, "Input", 0, 0, testInput, null); WizCtl.Font = Pad.TextFont; // For the STU 300 the echo object must be near the top if (Pad.Model == "STU-300") { x = WizCtl.PadWidth / 2 - keyWidth / 2 - 2 * keyWidth + 15; WizCtl.AddObject(ObjectType.ObjectInputEcho, "", x, "top", null, 8); } else { if (Pad.Model == "STU-430 or ePad") { y = 25; } else { y = 10 + 4 * 28; } WizCtl.AddObject(ObjectType.ObjectInputEcho, "", "center", y, null, 8); } // Add buttons for Cancel and Next WizCtl.Font = Pad.ButtonFont; // The STU 300 is very shallow so the buttons must be down the right-hand side instead of along the bottom and they must be narrower if (Pad.Model == "STU-300") { WizCtl.AddObject(ObjectType.ObjectButton, "Cancel", "right", "top", "Cancel", 50); WizCtl.AddObject(ObjectType.ObjectButton, "Clear", "right", "middle", "Clear", 50); WizCtl.AddObject(ObjectType.ObjectButton, "OK", "right", "bottom", "OK", 50); } else { if (Pad.Model == "STU-430 or ePad") { WizCtl.AddObject(ObjectType.ObjectButton, "Cancel", "left", "bottom", "Cancel", 70); WizCtl.AddObject(ObjectType.ObjectButton, "Clear", "center", "bottom", "Clear", 70); WizCtl.AddObject(ObjectType.ObjectButton, "OK", "right", "bottom", "OK", 70); } else { WizCtl.AddObject(ObjectType.ObjectButton, "Cancel", "left", "bottom", "Cancel", 200); WizCtl.AddObject(ObjectType.ObjectButton, "Clear", "center", "bottom", "Clear", 200); WizCtl.AddObject(ObjectType.ObjectButton, "OK", "right", "bottom", "OK", 200); } } WizCtl.Display(); Callback.EventHandler = new WizardCallback.Handler(Step1_Handler); WizCtl.SetEventHandler(Callback); }