Exemple #1
0
        private void MatrixPanelMouseMove(object sender, MouseEventArgs e)
        {
            try

            {
                // TODO review null values etc

                if (Controller.Enabled)
                {
                    NodePanel hCurrent = _hLayout.LocatePanel(e.Location);
                    NodePanel vCurrent = _vLayout.LocatePanel(e.Location);

                    //if ( HasMouseMovedCell( e.Location, hCurrent, vCurrent ) )

                    //if ( Controller.RowNode != hCurrent.TreeNode || Controller.ColNode != vCurrent.TreeNode )
                    if ((hCurrent?.TreeNode != null && Controller.ProviderTreeNode != hCurrent.TreeNode) ||
                        (vCurrent?.TreeNode != null && Controller.ConsumerTreeNode != vCurrent.TreeNode))
                    {
                        //_vPanel = vCurrent;
                        //_hPanel = hCurrent;

                        // change in position
                        //Controller.ProviderModule = (hCurrent == null ) ? null : hCurrent.TreeNode.NodeValue;
                        //Controller.ConsumerModule = (vCurrent == null ) ? null : vCurrent.TreeNode.NodeValue;

                        Controller.SetCurrentModules(
                            hCurrent?.TreeNode,
                            vCurrent?.TreeNode);

                        DoTooltipAfterMouseMove(hCurrent, vCurrent);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.StackTrace);
            }
        }
Exemple #2
0
        void DoTooltipAfterMouseMove(Point p)
        {
            NodePanel current = _layout.LocatePanel(p);

            if (LayoutHelper.MovedTest(_nodePanel, current, p))
            {
                _ttTimer.Stop();

                if (current == null)
                {
                    return;
                }

                Controller.SetCurrentModules(current.TreeNode, Controller.ConsumerTreeNode);

                _nodePanel = current;
                _tooltip.SetToolTip(this, TooltipString(current.TreeNode.NodeValue));
                _tooltip.Active = true;
                _ttTimer.Start();
            }
        }