Example #1
0
        protected override void OnKeyDown(KeyEventArgs e)
        {
            #region Show Intellisense
            if (e.KeyData == mp_IntellisenseKey)
            {
                m_IntellisenseManager.ShowIntellisenseBox();
                e.Handled = true;
                this.Focus();
                return;
            }
            #endregion

            if (mp_IntellisenseBox.Visible)
            {
                #region ESCAPE - Hide Intellisense
                if (e.KeyCode == Keys.Escape)
                {
                    m_IntellisenseManager.HideIntellisenseBox();
                    e.Handled = true;
                }
                #endregion

                #region Navigation - Up, Down, PageUp, PageDown, Home, End
                else if (e.KeyCode == Keys.Up)
                {
                    m_IntellisenseManager.NavigateUp(1);
                    e.Handled = true;
                }
                else if (e.KeyCode == Keys.Down)
                {
                    m_IntellisenseManager.NavigateDown(1);
                    e.Handled = true;
                }
                else if (e.KeyCode == Keys.PageUp)
                {
                    m_IntellisenseManager.NavigateUp(10);
                    e.Handled = true;
                }
                else if (e.KeyCode == Keys.PageDown)
                {
                    m_IntellisenseManager.NavigateDown(10);
                    e.Handled = true;
                }
                else if (e.KeyCode == Keys.Home)
                {
                    m_IntellisenseManager.NavigateHome();
                    e.Handled = true;
                }
                else if (e.KeyCode == Keys.End)
                {
                    m_IntellisenseManager.NavigateEnd();
                    e.Handled = true;
                }
                #endregion

                #region Typing - Back
                else if (e.KeyCode == Keys.Back)
                {
                    m_IntellisenseManager.TypeBackspace();
                }
                #endregion

                #region Typing - Brackets
                else if (e.KeyCode == Keys.D9)
                {
                    // Trap the open bracket key, displaying a cheap and
                    // cheerful tooltip if the word just typed is in our tree
                    // (the parameters are stored in the tag property of the node)
                }
                else if (e.KeyCode == Keys.D8)
                {
                    // Close bracket key, hide the tooltip textbox
                }
                #endregion

                #region Typing - TAB and Enter
                else if (e.KeyCode == Keys.Tab)
                {
                    m_IntellisenseManager.ConfirmIntellisense();
                    e.Handled = true;
                }
                else if (e.KeyCode == Keys.Enter)
                {
                    m_IntellisenseManager.ConfirmIntellisense();
                    e.Handled = true;
                }
                #endregion
            }

            this.Focus();
            base.OnKeyDown(e);
        }
Example #2
0
 protected override void OnMouseClick(MouseEventArgs e)
 {
     m_IntellisenseManager.HideIntellisenseBox();
     base.OnMouseClick(e);
 }