Esempio 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;
        }
Esempio 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;
        }
Esempio n. 3
0
 protected override void OnCollapseChanged(Control itemChanged)
 {
     this.DisplayContextHelp();
 }
Esempio n. 4
0
 protected override void OnDeactivated(Control control)
 {
     base.OnDeactivated(control);
     RecacheCompletion();
 }
Esempio n. 5
0
 void TreeViewNodeControl_CollapseChanged(Control itemChanged)
 {
     this.CollapseButton.Toggle();
 }
Esempio n. 6
0
 protected override void OnDeactivated(Control control)
 {
     base.OnDeactivated(control);
     if (Completion.HostBlock == this)
     {
         Completion.HideCompletionList();
     }
 }
Esempio n. 7
0
 private void UnsubscribeItem(Control childControl)
 {
     childControl.SizeChanged -= Child_SizeChanged;
 }
Esempio n. 8
0
 private void Children_ElementReplaced(Control oldControl, Control newControl)
 {
     UnsubscribeItem(oldControl);
     SubscribeItem(newControl);
     OnSizeChanged();
 }
Esempio n. 9
0
 private void Children_ElementRemoved(Control childControl)
 {
     UnsubscribeItem(childControl);
     OnSizeChanged();
 }
Esempio n. 10
0
 private void Children_ElementAdded(Control childControl)
 {
     SubscribeItem(childControl);
     OnSizeChanged();
 }
Esempio 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;
     }
 }
Esempio n. 12
0
 public void Prepend(Control newControl)
 {
     if (ChildrenCollection != null)
     {
         ChildrenCollection.Prepend(newControl);
         newControl.Parent = this;
         newControl.Root = this.Root;
     }
 }
Esempio n. 13
0
 public void ScrollTo(Control TopLeft)
 {
     RaiseScrollTo(TopLeft.Bounds);
 }
Esempio n. 14
0
 protected void RaiseControlDeactivated(Control control)
 {
     if (ControlDeactivated != null)
     {
         ControlDeactivated(control);
     }
 }
Esempio 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;
        }