示例#1
0
        protected void InternalConstruct(Control callingControl,
                                         Source source,
                                         Content c,
                                         WindowContent wc,
                                         FloatingForm ff,
                                         DockingManager dm,
                                         Point offset)
        {
            // Store the starting state
            _callingControl = callingControl;
            _source         = source;
            _content        = c;
            _windowContent  = wc;
            _dockingManager = dm;
            _container      = _dockingManager.Container;
            _floatingForm   = ff;
            _hotZones       = null;
            _currentHotZone = null;
            _insideRect     = new Rectangle();
            _outsideRect    = new Rectangle();
            _offset         = offset;

            // Begin tracking straight away
            EnterTrackingMode();
        }
示例#2
0
        public override void OnMouseMove(MouseEventArgs e)
        {
            if (_callingControl.Handle != IntPtr.Zero)
            {
                // Convert from Control coordinates to screen coordinates
                Point mousePos = _callingControl.PointToScreen(new Point(e.X, e.Y));

                // Find HotZone this position is inside
                HotZone hz = _hotZones.Contains(mousePos);

                if (hz != _currentHotZone)
                {
                    if (_currentHotZone != null)
                    {
                        _currentHotZone.RemoveIndicator(mousePos);
                    }

                    _currentHotZone = hz;

                    if (_currentHotZone != null)
                    {
                        _currentHotZone.DrawIndicator(mousePos);
                    }
                }
                else
                {
                    if (_currentHotZone != null)
                    {
                        _currentHotZone.UpdateForMousePosition(mousePos, this);
                    }
                }
            }

            base.OnMouseMove(e);
        }