Example #1
0
        private void OnPhoneLabelMouseUp(NMouseButtonEventArgs arg)
        {
            string phone = ((NLabel)arg.CurrentTargetNode).Text;

            phone = phone.Replace("-", String.Empty);
            NApplication.OpenUrl("tel:" + phone);
        }
Example #2
0
        private void OnTreeViewItemMouseDown(NMouseButtonEventArgs arg)
        {
            if (arg.Cancel || arg.Button != ENMouseButtons.Right)
            {
                return;
            }

            // Mark the event as handled
            arg.Cancel = true;

            // Get the right clicked tree view item
            NTreeViewItem item = (NTreeViewItem)arg.CurrentTargetNode;

            // Create the context menu
            NMenu     contextMenu         = new NMenu();
            NMenuItem copyLinkToClipboard = new NMenuItem("Copy link to clipboard");

            copyLinkToClipboard.Click += OnCopyLinkToClipboardClick;
            copyLinkToClipboard.Tag    = item.Tag;
            contextMenu.Items.Add(copyLinkToClipboard);

            // Show the context menu
            NSplitter splitter = (NSplitter)m_TreeView.ParentNode.ParentNode;
            double    x        = splitter.X + m_TreeView.X + arg.CurrentTargetPosition.X;
            double    y        = splitter.Y + m_TreeView.Y + item.YInRootItems + arg.CurrentTargetPosition.Y;

            NPopupWindow.OpenInContext(new NPopupWindow(contextMenu), m_TreeView, new NPoint(x, y));
        }
Example #3
0
        private void OnLabelMouseUp(NMouseButtonEventArgs arg)
        {
            if (arg.Cancel || arg.EventPhase != ENEventPhase.AtTarget)
            {
                return;
            }

            NExamplesContent examplesContent = (NExamplesContent)GetFirstAncestor(NExamplesContent.NExamplesContentSchema);

            examplesContent.NavigateToExample((NXmlElement)ParentNode.Tag);
        }
Example #4
0
 public static void OnDataPointMouseDown(NMouseButtonEventArgs arg)
 {
     if (arg.TargetNode is NDataPoint)
     {
         ((NDataPoint)arg.TargetNode).Fill   = new NColorFill(NColor.Blue);
         ((NDataPoint)arg.TargetNode).Stroke = new NStroke(2, NColor.Blue);
     }
     else if (arg.TargetNode is NSeries)
     {
         ((NSeries)arg.TargetNode).Fill = new NColorFill(NColor.Blue);
     }
 }
        private void OnSourceMouseDown(NMouseButtonEventArgs args)
        {
            if (NDragDrop.CanRequestDragDrop())
            {
                NDataObject dataObject = (NDataObject)args.CurrentTargetNode.Tag;

                NDragDropSource dropSource = new NDragDropSource(ENDragDropEffects.All);
                dropSource.DragStarting    += new Function <NDragDropSourceEventArgs>(OnDropSourceDragStarting);
                dropSource.DragEnded       += new Function <NDragEndedEventArgs>(OnDropSourceDragEnded);
                dropSource.QueryDragAction += new Function <NQueryDragActionEventArgs>(OnDropSourceQueryDragAction);

                NDragDrop.RequestDragDrop(dropSource, dataObject);
            }
        }
Example #6
0
        private void OnTargetWidgetMouseDown(NMouseButtonEventArgs args)
        {
            if (args.Button != ENMouseButtons.Right)
            {
                return;
            }

            // Mark the event as handled
            args.Cancel = true;

            // Create and show the popup
            NWidget      popupContent = CreatePopupContent();
            NPopupWindow popupWindow  = new NPopupWindow(popupContent);

            NPopupWindow.OpenInContext(popupWindow, args.CurrentTargetNode, args.ScreenPosition);
        }
Example #7
0
        private void OnExampleCategoryMouseUp(NMouseButtonEventArgs arg)
        {
            NXmlElement element = (NXmlElement)arg.TargetNode.Tag;

            // Find the category correpsonding to the XML element of the clicked header
            int count = m_PagePanel.Count;

            for (int i = 0; i < count; i++)
            {
                if (m_PagePanel[i].Tag == element)
                {
                    m_PagePanel.VisibleIndex = i;
                    return;
                }
            }

            // No category selected, so make the Welcome Screen visible
            m_PagePanel.VisibleIndex = 0;
        }
        private void OnTargetWidgetMouseDown(NMouseButtonEventArgs args)
        {
            NGroupBox ownerGroupBox = (NGroupBox)args.CurrentTargetNode.GetFirstAncestor(NGroupBox.NGroupBoxSchema);
            string    groupBoxTitle = ((NLabel)ownerGroupBox.Header.Content).Text;

            if ((groupBoxTitle.StartsWith("Left") && args.Button != ENMouseButtons.Left) ||
                (groupBoxTitle.StartsWith("Right") && args.Button != ENMouseButtons.Right))
            {
                return;
            }

            // Mark the event as handled
            args.Cancel = true;

            // Create and show the popup
            CreateMenuDelegate createMenuDelegate = (CreateMenuDelegate)args.CurrentTargetNode.Tag;
            NMenu contextMenu = createMenuDelegate();

            NPopupWindow.OpenInContext(new NPopupWindow(contextMenu), args.CurrentTargetNode, args.ScreenPosition);
        }
Example #9
0
        protected override void OnMouseUp(NMouseButtonEventArgs args)
        {
            base.OnMouseUp(args);

            if (args.Cancel || args.Button != ENMouseButtons.Left)
            {
                return;
            }

            if (args.TargetNode is NImageBox && args.TargetNode.Tag is NXmlElement)
            {
                OnExampleCategoryMouseUp(args);
                return;
            }

            // Get the clicked example tile
            NExampleTile tile = args.TargetNode as NExampleTile;

            if (tile == null)
            {
                tile = (NExampleTile)args.TargetNode.GetFirstAncestor(NExampleTile.NExampleTileSchema);
            }

            if (tile == null)
            {
                return;
            }

            NItemInfo itemInfo = (NItemInfo)tile.Tag;

            if (TileSelected != null)
            {
                TileSelected(itemInfo.XmlElement);
            }

            // Mark the event as handled
            args.Cancel = true;
        }
Example #10
0
        protected override void OnMouseDown(NMouseButtonEventArgs args)
        {
            base.OnMouseDown(args);

            Border = NBorder.CreateFilledBorder(new NColor(32, 32, 32));
        }
Example #11
0
        protected override void OnMouseUp(NMouseButtonEventArgs args)
        {
            base.OnMouseUp(args);

            ClearLocalValue(BorderProperty);
        }
 void OnCanvasMouseDown(NMouseButtonEventArgs arg)
 {
     m_EventsLog.LogEvent("Mouse Down");
 }
 private void OnContentMouseDown(NMouseButtonEventArgs args)
 {
     (args.TargetNode as NLabel).Focus();
 }
Example #14
0
        private void OnEmailLabelMouseUp(NMouseButtonEventArgs arg)
        {
            string email = ((NLabel)arg.CurrentTargetNode).Text;

            NApplication.OpenUrl("mailto:" + email + "?subject=Nevron Open Vision Question");
        }
 private void OnTestSerializationButtonMouseDown(NMouseButtonEventArgs arg)
 {
     // Set Wait cursor
     this.OwnerWindow.Cursor = new NCursor(ENPredefinedCursor.Wait);
 }