Beispiel #1
0
        void TypePanelMouseClick(object sender, MouseEventArgs e)
        {
            if (Controller.Enabled)
            {
                NodePanel nodePanel = _layout.LocatePanel(e.Location);

                if (nodePanel != null)
                {
                    Controller.SelectNode(nodePanel.TreeNode);

                    if (e.Button == MouseButtons.Right)
                    {
                        if (Controller.ContextMenuIsVisible)
                        {
                            Controller.HideContextMenu();
                            Invalidate();
                        }
                        else
                        {
                            Controller.ShowContextMenu(PointToScreen(e.Location));
                        }
                    }
                }
            }
        }
Beispiel #2
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);
            }
        }