Example #1
0
        private void OnMouseMove(object sender, MouseEventArgs e)
        {
            SplitterPanel panel1 = splitContHorizLeft.Panel1;

            panel1.Focus();
            try
            {
                if (e.Button == MouseButtons.Left)
                {
                    Point  ptDiff      = new Point(e.Location.X - _mousePositionPrev.X, e.Location.Y - _mousePositionPrev.Y);
                    double aspectRatio = 1.0;

                    Box2D box = _picGraphics.DrawingBox;
                    box.Center = new Vector2D(
                        box.Center.X - ptDiff.X * box.Width / (double)panel1.ClientSize.Width
                        , box.Center.Y + ptDiff.Y * box.Height / ((double)panel1.ClientSize.Height * aspectRatio));
                    _picGraphics.DrawingBox = box;

                    panel1.Invalidate();
                }
                _mousePositionPrev = e.Location;
            }
            catch (InvalidBoxException /*ex*/) { _computeBbox = true; }
            catch (Exception ex) { log.Debug(ex.ToString()); }
            finally { }
        }
Example #2
0
        private void OnMouseEnter(object sender, EventArgs e)
        {
            SplitterPanel panelLeft  = splitContainerVert.Panel1;
            SplitterPanel panelRight = splitContHorizRight.Panel1;

            if (panelLeft.Focused)
            {
                panelRight.Focus();
            }
        }