CustomContextMenu GetCurrentContextMenu(Point p)
 {
     if (AgControlBase.GetSLBounds(this).Contains(p))
     {
         return(ContextMenu);
     }
     return(null);
 }
コード例 #2
0
        void ContentMenu_EventHandler(object sender, HtmlEventArgs e)
        {
            e.PreventDefault();
            e.StopPropagation();
            Point point = new Point(e.OffsetX, e.OffsetY);

            if (AgControlBase.GetSLBounds(this).Contains(point))
            {
                OnShowContextMenu(point);
            }
        }
        bool IsActive()
        {
            if (ElementToAddMouseWheelSupportTo != null)
            {
                if (ScrollAlways || AgControlBase.GetSLBounds(ElementToAddMouseWheelSupportTo).Contains(browserListener.MousePosition))
                {
                    return(true);
                }
            }

            return(false);
        }
コード例 #4
0
 bool CanDropToExpression(Point point)
 {
     if (IsEnabled)
     {
         Rect expression_Bounds = AgControlBase.GetSLBounds(txtExpression);
         if (expression_Bounds.Contains(point))
         {
             return(true);
         }
     }
     return(false);
 }
コード例 #5
0
 bool CanDropToName(Point point)
 {
     if (IsEnabled)
     {
         Rect name_Bounds = AgControlBase.GetSLBounds(txtName);
         if (name_Bounds.Contains(point))
         {
             return(true);
         }
     }
     return(false);
 }
        void ShowSubmenu(ContextMenuItem item)
        {
            if (item != null && item.HasSubMenu)
            {
                Rect p = AgControlBase.GetSLBounds(item);
                item.SubMenu.SetLocation(new Point(p.Right, p.Top + 6));
                item.SubMenu.Opened      -= new EventHandler(SubMenu_Opened);
                item.SubMenu.Opened      += new EventHandler(SubMenu_Opened);
                item.SubMenu.Closed      -= new EventHandler(SubMenu_Closed);
                item.SubMenu.Closed      += new EventHandler(SubMenu_Closed);
                item.SubMenu.MouseEnter  -= new MouseEventHandler(SubMenu_MouseEnter);
                item.SubMenu.MouseEnter  += new MouseEventHandler(SubMenu_MouseEnter);
                item.SubMenu.Collapsed   -= new EventHandler(SubMenu_Collapsed);
                item.SubMenu.Collapsed   += new EventHandler(SubMenu_Collapsed);
                item.SubMenu.ItemClicked -= new EventHandler(SubMenu_ItemClicked);
                item.SubMenu.ItemClicked += new EventHandler(SubMenu_ItemClicked);

                item.SubMenu.IsDropDownOpen = true;
                return;
            }
        }
コード例 #7
0
        public void HighlightDrop(Point point)
        {
            if (IsEnabled)
            {
                Rect expression_Bounds = AgControlBase.GetSLBounds(txtExpression);
                if (expression_Bounds.Contains(point))
                {
                    txtExpression.Effect = new System.Windows.Media.Effects.DropShadowEffect()
                    {
                        ShadowDepth = 1, Opacity = 0.8, Color = Colors.Blue
                    };
                }
                else
                {
                    txtExpression.Effect = null;
                }

                Rect name_Bounds = AgControlBase.GetSLBounds(txtName);
                if (name_Bounds.Contains(point))
                {
                    txtName.Effect = new System.Windows.Media.Effects.DropShadowEffect()
                    {
                        ShadowDepth = 1, Opacity = 0.8, Color = Colors.Blue
                    };
                }
                else
                {
                    txtName.Effect = null;
                }
            }
            else
            {
                txtName.Effect       = null;
                txtExpression.Effect = null;
            }
        }