Exemplo n.º 1
0
        private void form_TransfEvent(object holder, HNStruct.HNEkey value)
        {
            int index = 1;

            if (holder == this.btnAbove)
            {
                index = 2;
            }
            Fixer4TabletPen.savePenButtonValue(index, value);
            if (index == 2)
            {
                this.btnAbove.Text = value.ToString();
            }
            else
            {
                if (index != 1)
                {
                    return;
                }
                this.btnBelow.Text = value.ToString();
            }
        }
Exemplo n.º 2
0
        private void FormTabletPen_Load(object sender, EventArgs e)
        {
            this.pictureBoxDrawLine.Size  = new Size(this.Width, this.Height);
            this.pictureBoxDrawTest.Image =
                (Image) new Bitmap(this.pictureBoxDrawTest.Width, this.pictureBoxDrawTest.Height);
            this.pictureBoxDrawLine.Paint   += new PaintEventHandler(this.PictureBoxDrawLine_Paint);
            this.btnAbove.Parent             = (Control)this.pictureBoxDrawLine;
            this.btnBelow.Parent             = (Control)this.pictureBoxDrawLine;
            this.btnAbove.UseMnemonic        = false;
            this.btnBelow.UseMnemonic        = false;
            this.pictureBoxPressCurve.Parent = (Control)this.pictureBoxDrawLine;
            this.buttonClear.Parent          = (Control)this.pictureBoxDrawLine;
            this.buttonTest.Parent           = (Control)this.pictureBoxDrawLine;
            this.touchPressBar1.Parent       = (Control)this.pictureBoxDrawLine;
            this.labelSetPress.Parent        = (Control)this.pictureBoxDrawLine;
            this.checkInk.Parent             = (Control)this.pictureBoxDrawLine;
            this.checkTab.Parent             = (Control)this.pictureBoxDrawLine;
            this.pictureBoxDrawTest.Parent   = (Control)this.pictureBoxDrawLine;
            this.checkTab.Visible            = false;
            this.drawLineHelper = new Fixer4DrawLine((Control)this.pictureBoxDrawTest, this.pictureBoxDrawTest.Image);
            this.drawLineHelper.onPressValueChangedListener += new PressValueChanged(this.onPressValueChanged);
            this.touchPressBar1.MaxValue = (int)HNStruct.globalInfo.tabletInfo.maxP;
            this.setViewText8Locale();
            this.imgPen.Image = Fixer4TabletPen.getPenImage();
            int num = (this.Height - this.buttonClear.Height * 2 - this.imgPen.Image.Size.Height) / 2;

            this.imgPen.Location = new Point(this.imgPen.Location.X, num < 0 ? 0 : num);
            this.pictureBoxDrawLine.setPictureInfo(this.imgPen);
            this.imgPen.Visible = false;
            int length = HNStruct.globalInfo.penLayouts.Length;

            this.penLayouts = new HuionKeyLayout[length];
            for (int index = 0; index < length; ++index)
            {
                this.penLayouts[index] = Utils.swapLayout(this.imgPen.Image.Size, HNStruct.globalInfo.layoutPen.size,
                                                          HNStruct.globalInfo.penLayouts[index]);
                this.penLayouts[index].Rect.X += this.imgPen.Left;
                this.penLayouts[index].Rect.Y += this.imgPen.Top;
                this.penLayouts[index].KeyType = HuionKeyType.PENKEY;
            }

            if (Convert.ToBoolean(HNStruct.globalInfo.tabletInfo.bMonitor))
            {
                // this.checkBoxMouseMode.Checked = true;
                this.checkBoxMouseMode.Hide();
            }

            this.trackBar1.Top               = this.pictureBoxPressCurve.Top - 5;
            this.trackBar1.Height            = this.pictureBoxPressCurve.Height + 10;
            this.labelMaxPressValue.Text     = string.Concat((object)this.trackBar1.Maximum);
            this.labelMinPressValue.Text     = string.Concat((object)this.trackBar1.Minimum);
            this.btnAbove.Text               = HNStruct.globalInfo.pbtns[2].ToString();
            this.btnBelow.Text               = HNStruct.globalInfo.pbtns[1].ToString();
            this.trackBar1.Value             = TabletConfigUtils.config.pressFactor;
            this.checkInk.Checked            = Convert.ToBoolean(TabletConfigUtils.config.bTabletpc);
            this.checkTab.Checked            = Convert.ToBoolean(TabletConfigUtils.config.bImproveLinearity);
            this.checkBoxMouseMode.Checked   = TabletConfigUtils.config.bAbsoluteMode == (byte)0;
            this.checkBgame.Checked          = TabletConfigUtils.config.bGame == (byte)1;
            this.labelMaxPressValue.Location =
                new Point(this.trackBar1.Right - this.labelMaxPressValue.Width, this.trackBar1.Top);
            this.label1.Location = new Point(this.labelMaxPressValue.Left,
                                             this.trackBar1.Top + (this.trackBar1.Height - this.label1.Height) / 2);
            this.labelMinPressValue.Location = new Point(this.labelMaxPressValue.Left,
                                                         this.trackBar1.Bottom - this.labelMinPressValue.Height);
            this.pictureBoxDrawTest.Enabled     = true;
            this.pictureBoxDrawTest.MouseEnter += new EventHandler(this.PictureBoxDrawTest_MouseEnter);
            this.pictureBoxDrawTest.MouseLeave += new EventHandler(this.PictureBoxDrawTest_MouseLeave);
            if (DeployConfig.isNewUI)
            {
                this.buttonTest_Click((object)null, (EventArgs)null);
            }
            else
            {
                this.label2.Visible          = false;
                this.buttonTest.Visible      = true;
                this.buttonTest.Enabled      = true;
                this.buttonTest.TabStop      = true;
                this.pictureBoxDrawTest.Top += 5;
                this.touchPressBar1.Top     += 5;
                this.buttonClear.Left        = this.buttonTest.Right + 10;
                this.buttonClear.Top         = this.buttonTest.Top;
            }
        }