예제 #1
0
 private void Form_Topaz_FormClosed(object sender, FormClosedEventArgs e)
 {
     topaz.delete_sigplus();
     topaz = null;
 }
예제 #2
0
        //if mode == 0 mode : validation coté ordinateur
        //if mode == 1 mode : validation coté tablette
        public Form_Topaz(String _message, Uri _url, WebBrowser _WebBrowser, short mode, Topaz_Manager _topaz)
        {
            WebBrowser = _WebBrowser;
            urlapp     = _url;
            topaz      = _topaz;

            InitializeComponent();

            this.Text = WebBrowser.Document.Title;

            estconnecte = false;
            if (isConnected(sigPlusNET1))
            {
                estconnecte = true;
            }
            else
            {
                MessageBox.Show("La tablette a signature n'est pas connectée, connectez-la, et recommencez l'operation.");
                this.Close();
            }

            if (estconnecte)
            {
                if (mode == 0)
                {
                    messageTitre = _message;

                    Text = messageTitre;

                    //----------------------------------------------
                    //The following parameters are set in case the user's INI file is not correctly set up for an LCD 1X5 tablet
                    //Otherwise, if the INI is correctly set up, these parameters do not need to be set
                    sigPlusNET1.SetTabletXStart(400);
                    sigPlusNET1.SetTabletXStop(2400);
                    sigPlusNET1.SetTabletYStart(350);
                    sigPlusNET1.SetTabletYStop(1050);
                    sigPlusNET1.SetTabletLogicalXSize(2100);
                    sigPlusNET1.SetTabletLogicalYSize(700);
                    //******************************************************************'
                    //sigPlusNET1.LCDRefresh(0, 0, 0, 240, 64);
                    //sigPlusNET1.LCDSetWindow(0, 0, 240, 64);
                    //sigPlusNET1.SetSigWindow(1, 0, 0, 240, 64);
                    //sigPlusNET1.KeyPadClearHotSpotList();
                    //sigPlusNET1.SetLCDCaptureMode(1);
                    //sigPlusNET1.SetTabletState(0);

                    Font f = new System.Drawing.Font("Arial", 9.0F, System.Drawing.FontStyle.Regular);

                    sigPlusNET1.ClearTablet();
                    sigPlusNET1.SetTabletState(1); //Turns tablet on to collect signature
                    sigPlusNET1.LCDRefresh(0, 0, 0, 240, 64);
                    sigPlusNET1.LCDWriteString(0, 2, 0, 0, f, messageTitre);
                    sigPlusNET1.ClearSigWindow(1);
                    sigPlusNET1.LCDSetWindow(0, 22, 240, 40);
                    sigPlusNET1.SetSigWindow(1, 0, 22, 240, 40);
                    sigPlusNET1.SetLCDCaptureMode(2);
                    //
                    //-------------------------------------------------------------------------
                }

                if (mode == 1)
                {
                    this.cmdCapture.Visible = false;
                    this.cmdClear.Visible   = false;

                    //----------------------------------------------
                    //The following parameters are set in case the user's INI file is not correctly set up for an LCD 1X5 tablet
                    //Otherwise, if the INI is correctly set up, these parameters do not need to be set
                    sigPlusNET1.SetTabletXStart(400);
                    sigPlusNET1.SetTabletXStop(2400);
                    sigPlusNET1.SetTabletYStart(350);
                    sigPlusNET1.SetTabletYStop(1050);
                    sigPlusNET1.SetTabletLogicalXSize(2100);
                    sigPlusNET1.SetTabletLogicalYSize(700);
                    //******************************************************************'

                    //The following code will write BMP images out to the LCD 1X5 screen

                    /*sign = new System.Drawing.Bitmap(SandBox.Properties.Resources.Sign);
                     * ok = new System.Drawing.Bitmap(SandBox.Properties.Resources.OK);
                     * clear = new System.Drawing.Bitmap(SandBox.Properties.Resources.CLEAR);*/
                    please = new System.Drawing.Bitmap(SandBox.Properties.Resources.please);

                    sigPlusNET1.SetTabletState(1); //Turns tablet on to collect signature
                    sigPlusNET1.LCDRefresh(0, 0, 0, 240, 64);

                    //Demo text
                    Font f = new System.Drawing.Font("verdana", 10.0F, System.Drawing.FontStyle.Regular);

                    //Images sent to the background

                    /*sigPlusNET1.LCDSendGraphic(1, 2, 0, 20, sign);
                     * sigPlusNET1.LCDSendGraphic(1, 2, 207, 4, ok);
                     * sigPlusNET1.LCDSendGraphic(1, 2, 15, 4, clear);*/

                    sigPlusNET1.LCDWriteString(1, 2, 202, 4, f, "Ok");
                    sigPlusNET1.LCDWriteString(1, 2, 15, 4, f, "Clear");

                    /*sigPlusNET1.LCDWriteString(0, 2, 45, 0, f, "Tap Continue to try signing.");
                     * sigPlusNET1.LCDWriteString(0, 2, 15, 45, f, "Continue");
                     * sigPlusNET1.LCDWriteString(0, 2, 200, 45, f, "Exit");
                     *
                     * //Create the hot spots for the Continue and Exit buttons
                     * sigPlusNET1.KeyPadAddHotSpot(0, 1, 12, 40, 40, 15); //For Continue button
                     * sigPlusNET1.KeyPadAddHotSpot(1, 1, 195, 40, 20, 15); //For Exit button
                     */
                    sigPlusNET1.ClearTablet();

                    sigPlusNET1.LCDSetWindow(0, 0, 1, 1);
                    sigPlusNET1.SetSigWindow(1, 0, 0, 1, 1); //Sets the area where ink is permitted in the SigPlus object
                    sigPlusNET1.SetLCDCaptureMode(2);        //Sets mode so ink will not disappear after a few seconds
                    //-------------------------------------------------------------------------

                    sigPlusNET1.ClearSigWindow(1);
                    sigPlusNET1.LCDRefresh(1, 16, 45, 50, 15); //Refresh LCD at 'Continue' to indicate to user that this option has been sucessfully chosen
                    sigPlusNET1.LCDRefresh(2, 0, 0, 240, 64);  //Brings the background image already loaded into foreground
                    sigPlusNET1.ClearTablet();
                    sigPlusNET1.KeyPadClearHotSpotList();
                    sigPlusNET1.KeyPadAddHotSpot(2, 1, 10, 5, 53, 17);  //For CLEAR button
                    sigPlusNET1.KeyPadAddHotSpot(3, 1, 200, 4, 40, 17); //For OK button sigPlusNET1.KeyPadAddHotSpot(3, 1, 197, 5, 19, 17);
                    sigPlusNET1.LCDSetWindow(0, 22, 238, 40);
                    sigPlusNET1.SetSigWindow(1, 0, 22, 240, 40);        //Sets the area where ink is permitted in the SigPlus object
                    sigPlusNET1.SetLCDCaptureMode(2);                   //Sets mode so ink will not disappear after a few seconds
                    timer1.Enabled = true;
                }
            }
        }