Exemplo n.º 1
0
        ///<summary>
        /// Determines if the block or any of its children has focus.
        ///</summary>
        /// <remarks>
        /// Reverse iteration: from deepest block (Focus) ---> root
        /// on the way to the root iterator is being compared with "this"
        /// </remarks>
        ///<returns>
        /// true if the subtree starting with this block has focus
        ///</returns>
        public bool IsFocusInsideControl(Control toCheck)
        {
            Control Current = FocusControl;

            while (Current != null)
            {
                if (Current == toCheck) return true;
                Current = Current.Parent;
            }

            return false;
        }
Exemplo n.º 2
0
        public bool SetFocus(Control newFocus)
        {
            bool result = false;

            //using (RedrawAccumulator r = new RedrawAccumulator(this, false))
            {
                result = SetFocusButDontScroll(newFocus);
                if (result)
                {
                    ScrollTo(mFocusControl);
                    //r.ShouldRedrawAtTheEnd = true;
                }
            }

            return result;
        }
Exemplo n.º 3
0
 protected override void OnCollapseChanged(Control itemChanged)
 {
     this.DisplayContextHelp();
 }
Exemplo n.º 4
0
 protected override void OnDeactivated(Control control)
 {
     base.OnDeactivated(control);
     RecacheCompletion();
 }
Exemplo n.º 5
0
 void TreeViewNodeControl_CollapseChanged(Control itemChanged)
 {
     this.CollapseButton.Toggle();
 }
Exemplo n.º 6
0
 protected override void OnDeactivated(Control control)
 {
     base.OnDeactivated(control);
     if (Completion.HostBlock == this)
     {
         Completion.HideCompletionList();
     }
 }
Exemplo n.º 7
0
 private void UnsubscribeItem(Control childControl)
 {
     childControl.SizeChanged -= Child_SizeChanged;
 }
Exemplo n.º 8
0
 private void Children_ElementReplaced(Control oldControl, Control newControl)
 {
     UnsubscribeItem(oldControl);
     SubscribeItem(newControl);
     OnSizeChanged();
 }
Exemplo n.º 9
0
 private void Children_ElementRemoved(Control childControl)
 {
     UnsubscribeItem(childControl);
     OnSizeChanged();
 }
Exemplo n.º 10
0
 private void Children_ElementAdded(Control childControl)
 {
     SubscribeItem(childControl);
     OnSizeChanged();
 }
Exemplo n.º 11
0
 /// <summary>
 /// Removes an existing control from this CompositeControl.
 /// </summary>
 /// <remarks>
 /// CompositeControl isn't resized if SuspendLayout == true.
 /// </remarks>
 /// <param name="newShape">Control to add to this collection.</param>
 public void Remove(Control controlToRemove)
 {
     if (ChildrenCollection != null)
     {
         ChildrenCollection.Remove(controlToRemove);
         controlToRemove.Root = null;
         controlToRemove.Parent = null;
     }
 }
Exemplo n.º 12
0
 public void Prepend(Control newControl)
 {
     if (ChildrenCollection != null)
     {
         ChildrenCollection.Prepend(newControl);
         newControl.Parent = this;
         newControl.Root = this.Root;
     }
 }
Exemplo n.º 13
0
 public void ScrollTo(Control TopLeft)
 {
     RaiseScrollTo(TopLeft.Bounds);
 }
Exemplo n.º 14
0
 protected void RaiseControlDeactivated(Control control)
 {
     if (ControlDeactivated != null)
     {
         ControlDeactivated(control);
     }
 }
Exemplo n.º 15
0
        private bool SetFocusButDontScroll(Control newFocus)
        {
            if (newFocus == null
                || !newFocus.CanGetFocus
                || newFocus == mFocusControl
            )
            {
                return false;
            }

            if (mFocusControl != null)
            {
                mFocusControl.OnDeactivate();
            }
            mFocusControl = newFocus;
            mFocusControl.OnActivate();
            DefaultKeyHandler = mFocusControl;

            return true;
        }