コード例 #1
0
        public void handleMouseUp(Object sender, MouseEventArgs e)
        {
            Point mouse = new Point(e.X, e.Y);

            if (Utility.isInRect(mouse, getButtonBoundsLeft1()))
            {
                btnLeft_MouseUp(null, null);
            }
            else if (Utility.isInRect(mouse, getButtonBoundsRight1()))
            {
                btnLeft_MouseUp(null, null);
            }
            else if (Utility.isInRect(mouse, getButtonBoundsLeft2()))
            {
                btnRight_MouseUp(null, null);
            }
            else if (Utility.isInRect(mouse, getButtonBoundsRight2()))
            {
                btnRight_MouseUp(null, null);
            }
            mOverviewButtonLeft1MouseDowned  = false;
            mOverviewButtonLeft2MouseDowned  = false;
            mOverviewButtonRight1MouseDowned = false;
            mOverviewButtonRight2MouseDowned = false;
            mOverviewButtonZoomMouseDowned   = false;
            mOverviewButtonMoozMouseDowned   = false;
            if (mOverviewMouseDownMode == OverviewMouseDownMode.LEFT)
            {
                AppManager.mMainWindowController.setStartToDrawX(mMainForm.calculateStartToDrawX());
            }
            mOverviewMouseDownMode = OverviewMouseDownMode.NONE;
            mMainForm.refreshScreen();
        }
コード例 #2
0
 public void handleMouseDoubleClick(Object sender, MouseEventArgs e)
 {
     if (AppManager.keyWidth < e.X && e.X < this.Width - 19)
     {
         mOverviewMouseDownMode = OverviewMouseDownMode.NONE;
         int draft_stdx = getOverviewStartToDrawX(e.X - AppManager.keyWidth - AppManager.keyOffset);
         int draft      = (int)(draft_stdx * AppManager.mMainWindowController.getScaleXInv());
         if (draft < mMainForm.hScroll.Minimum)
         {
             draft = mMainForm.hScroll.Minimum;
         }
         else if (mMainForm.hScroll.Maximum < draft)
         {
             draft = mMainForm.hScroll.Maximum;
         }
         mMainForm.hScroll.Value = draft;
         mMainForm.refreshScreen();
     }
 }
コード例 #3
0
        public void handleMouseDown(Object sender, MouseEventArgs e)
        {
            MouseButtons btn = e.Button;

            if (mMainForm.isMouseMiddleButtonDowned(e.Button))
            {
                btn = MouseButtons.Middle;
            }
            if (btn == MouseButtons.Middle)
            {
                mOverviewMouseDownMode                = OverviewMouseDownMode.MIDDLE;
                mOverviewMouseDownedLocationX         = e.X;
                mOverviewStartToDrawClockInitialValue = mOverviewStartToDrawClock;
            }
            else if (e.Button == MouseButtons.Left)
            {
                if (e.X <= AppManager.keyWidth || this.Width - 19 <= e.X)
                {
                    Point mouse = new Point(e.X, e.Y);
                    if (Utility.isInRect(mouse, getButtonBoundsLeft1()))
                    {
                        btnLeft_MouseDown(null, null);
                        mOverviewButtonLeft1MouseDowned = true;
                    }
                    else if (Utility.isInRect(mouse, getButtonBoundsRight1()))
                    {
                        btnLeft_MouseDown(null, null);
                        mOverviewButtonRight1MouseDowned = true;
                    }
                    else if (Utility.isInRect(mouse, getButtonBoundsLeft2()))
                    {
                        btnRight_MouseDown(null, null);
                        mOverviewButtonLeft2MouseDowned = true;
                    }
                    else if (Utility.isInRect(mouse, getButtonBoundsRight2()))
                    {
                        btnRight_MouseDown(null, null);
                        mOverviewButtonRight2MouseDowned = true;
                    }
                    else if (Utility.isInRect(mouse, getButtonBoundsZoom()))
                    {
                        btnZoom_Click(null, null);
                        mOverviewButtonZoomMouseDowned = true;
                    }
                    else if (Utility.isInRect(mouse, getButtonBoundsMooz()))
                    {
                        btnMooz_Click(null, null);
                        mOverviewButtonMoozMouseDowned = true;
                    }
                    mMainForm.refreshScreen();
                }
                else
                {
                    if (e.Clicks == 1)
                    {
                        mOverviewMouseDownMode = OverviewMouseDownMode.LEFT;
                        int draft = getOverviewStartToDrawX(e.X - AppManager.keyWidth - AppManager.keyOffset);
                        if (draft < 0)
                        {
                            draft = 0;
                        }
                        AppManager.mMainWindowController.setStartToDrawX(draft);
                        mMainForm.refreshScreen();
                        return;
                    }
                }
            }
        }