Пример #1
0
 public override GH_ObjectResponse RespondToMouseDown(GH_Canvas sender, GH_CanvasMouseEvent e)
 {
     if (base.CanvasBounds.Contains(e.CanvasLocation))
     {
         foreach (GH_Attr_Widget control in _controls)
         {
             if (control.Contains(e.CanvasLocation) && control.Enabled)
             {
                 GH_ObjectResponse val = control.RespondToMouseDown(sender, e);
                 if ((int)val != 0)
                 {
                     _activeControl = control;
                     return(val);
                 }
             }
         }
     }
     else if (_activeControl != null)
     {
         _activeControl.RespondToMouseDown(sender, e);
         _activeControl = null;
         return(GH_ObjectResponse.Handled);
     }
     return(0);
 }
Пример #2
0
        public GH_ObjectResponse RespondToMouseDown(GH_Canvas sender, GH_CanvasMouseEvent e)
        {
            if (_activeWidget != null)
            {
                return(_activeWidget.RespondToMouseDown(sender, e));
            }
            int count = _menus.Count;

            for (int i = 0; i < count; i++)
            {
                GH_ObjectResponse val = _menus[i].RespondToMouseDown(sender, e);
                if ((int)val != 0)
                {
                    return(val);
                }
            }
            return(0);
        }
Пример #3
0
        public override GH_ObjectResponse RespondToMouseDown(GH_Canvas sender, GH_CanvasMouseEvent e)
        {
            if (_headBounds.Contains(e.CanvasLocation))
            {
                if (Expanded)
                {
                    _activeControl = null;
                }
                _expanded = !_expanded;

                Layout();  //daq =)

                return(GH_ObjectResponse.Handled);
            }
            if (_expanded)
            {
                if (_contentBounds.Contains(e.CanvasLocation))
                {
                    for (int i = 0; i < inputs.Count; i++)
                    {
                        if (inputs[i].Parameter.Attributes.Bounds.Contains(e.CanvasLocation))
                        {
                            return(inputs[i].Parameter.Attributes.RespondToMouseDown(sender, e));
                        }
                    }
                    for (int j = 0; j < _controls.Count; j++)
                    {
                        if (_controls[j].Contains(e.CanvasLocation))
                        {
                            _activeControl = _controls[j];
                            return(_controls[j].RespondToMouseDown(sender, e));
                        }
                    }
                }
                else if (_activeControl != null)
                {
                    _activeControl.RespondToMouseDown(sender, e);
                    _activeControl = null;
                    return(GH_ObjectResponse.Handled);
                }
            }
            return(0);
        }