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;
 }
Esempio n. 4
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();
        }
        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();
        }
        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);
        }