Example #1
0
        //protected override void OnKeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
        //{
        //    if (this.MyControl.IsFocused && !char.IsControl(e.KeyChar))
        //    {
        //        Completion.ShowCompletionList(this);
        //    }
        //}

        //protected override void OnTextHasChanged(ITextProvider changedControl, string oldText, string newText)
        //{
        //    base.OnTextHasChanged(changedControl, oldText, newText);
        //    if (Text.Length > 0)
        //    {
        //        Completion.ShowCompletionList(this, Text);
        //    }
        //    else
        //    {
        //        Completion.HideCompletionList();
        //    }
        //}

        protected override void OnMouseUpRight(GuiLabs.Canvas.Events.MouseWithKeysEventArgs e)
        {
            using (Redrawer r = new Redrawer(Root))
            {
                SetFocus();
                Completion.ShowCompletionList(this);
            }
            e.Handled = true;
        }
Example #2
0
 protected override void OnKeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
 {
     foreach (CompletionListItem item in this.Completion.Items)
     {
         if (item.Text.ToLower().StartsWith(e.KeyChar.ToString().ToLower()))
         {
             Completion.ShowCompletionList(this, e.KeyChar.ToString());
             return;
         }
     }
 }
Example #3
0
        /// <summary>
        /// Trigger intellisense
        /// </summary>
        protected override void OnKeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
        {
            if (e.KeyChar == '.' || e.KeyChar == ' ')
            {
                Completion.ShowCompletionList(this);
                e.Handled = true;
            }

            if (!e.Handled)
            {
                base.OnKeyPress(sender, e);
            }
        }
Example #4
0
 protected override void OnTextHasChanged(GuiLabs.Canvas.Controls.ITextProvider changedControl, string oldText, string newText)
 {
     if (Completion.Visible)
     {
         if (!Completion.ExistingItemsHavePrefix(this.Text))
         {
             Completion.HideCompletionList();
         }
         else
         {
             Completion.ShowCompletionList(this, this.Text);
         }
     }
     base.OnTextHasChanged(changedControl, oldText, newText);
 }
Example #5
0
 protected override void OnKeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
 {
     if (this.Text == e.KeyChar.ToString() && Strings.CanBeStartOfVariableName(e.KeyChar))
     {
         FillCompletionWithNamespaces(GetNamespaces(""));
         Completion.ShowCompletionList(this, this.Text);
     }
     else if (e.KeyChar == '.')
     {
         FillNamespaceCompletion();
         Completion.ShowCompletionList(this);
     }
     else if (Strings.CanBePartOfVariableName(e.KeyChar))
     {
         if (CompletionIsShown)
         {
             Completion.ShowCompletionList(this, this.GetWordBeforeCaret());
         }
     }
 }
Example #6
0
        protected override void OnKeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
        {
            if ((e.KeyCode == System.Windows.Forms.Keys.Return ||
                 e.KeyCode == System.Windows.Forms.Keys.Apps ||
                 e.KeyCode == System.Windows.Forms.Keys.Tab) &&
                !e.Control &&
                !e.Shift &&
                !e.Alt)
            {
                Completion.ShowCompletionList(this);
                e.Handled = true;
            }

            if (e.KeyCode == Keys.Return &&
                e.Control)
            {
                CtrlEnter();
            }

            if (!e.Handled)
            {
                base.OnKeyDown(sender, e);
            }
        }
Example #7
0
 public void ShouldShowCompletion()
 {
     Completion.ShowCompletionList(this, Text);
 }