コード例 #1
0
        private void EventSinkService_NodeMouseDown(NNodeMouseEventArgs args)
        {
            if (args.Button != MouseButtons.Left || !(args.Node is NTableShape || args.Node is NGroupSampleUC))
            {
                pEmployee.Visible = false;
                return;
            }

            INNode node = args.Node;

            while (!(node is NTableShape))
            {
                node = node.ParentNode;
            }

            NEmployee employee = m_Dict[(NTableShape)node];

            pbPhoto.Image     = employee.Photo;
            lblName.Text      = employee.Name;
            lblPosition.Text  = employee.Position;
            lblBirthDate.Text = string.Format(CULTURE, "Birth Date: {0:MMMM dd, yyyy}", employee.BirthDate);
            lblSalary.Text    = "Salary: " + employee.Salary.ToString("C", CULTURE);
            lblBiography.Text = employee.Biography;

            pEmployee.Visible = true;
            args.Handled      = !(args.Node is NGroupSampleUC);
        }
コード例 #2
0
            public override void OnMouseMove(object sender, NMouseEventArgs e)
            {
                m_SelectedSeries = null;

                NHitTestCacheService hitTestService = GetView().GetServiceOfType(typeof(NHitTestCacheService)) as NHitTestCacheService;

                if (hitTestService == null)
                {
                    return;
                }

                INNode node = hitTestService.HitTest(new NPointF(e.X, e.Y));

                if (node == null)
                {
                    return;
                }

                NDataPoint dataPoint = node as NDataPoint;

                if (dataPoint != null)
                {
                    m_SelectedSeries = dataPoint.ParentNode as NSeries;
                }
            }
コード例 #3
0
        private void OnNodeMouseDown(NNodeMouseEventArgs args)
        {
            INNode node = args.Node;

            while (node != null && node is NShape == false)
            {
                node = node.ParentNode;
            }

            NShape shape = (NShape)node;

            args.Handled = true;

            if (document.Tag == null)
            {
                if (shape == null)
                {
                    return;
                }

                // The user has clicked a state
                document.Tag = shape;
                LoadStateMap(shape.Name);
                document.SizeToContent();
            }
            else
            {
                if (shape == null)
                {
                    // Return to the States map
                    document.Tag = null;
                    LoadUsaMap();
                    document.SizeToContent();
                }
                else
                {
                    if (shape.StyleSheetName == "ClickedCounty")
                    {
                        // The user has clicked a selected county - unselect it
                        shape.StyleSheetName = String.Empty;
                        shape.Text           = String.Empty;
                    }
                    else
                    {
                        // The user has clicked a non selected county - select it (make it red)
                        shape.StyleSheetName = "ClickedCounty";
                        shape.Text           = shape.Name;
                    }
                }
            }
        }
コード例 #4
0
        protected bool document_IsInputKey(INNode node, Keys keyData)
        {
            // the document wants to process the TAB key
            if (node is NDrawingDocument)
            {
                return((keyData & Keys.Tab) == Keys.Tab);
            }

            // focused shapes want to process the ARROW Keys
            if (node is NShape)
            {
                if (keyData == Keys.Left ||
                    keyData == Keys.Right ||
                    keyData == Keys.Up ||
                    keyData == Keys.Down)
                {
                    return(true);
                }
            }

            return(false);
        }
コード例 #5
0
 protected bool document_IsInputChar(INNode node, char inputChar)
 {
     // in this example we have no special characters we want to process
     return(false);
 }