private void txtSearch_TextChanged(object sender, EventArgs e)
        {
            if (txtSearch.TextLength == 0)
            {
                SetClearImage(null);
                ResultsPopup.Hide();
                return;
            }

            if (txtSearch.TextLength > 0 && !ResultsPopup.Visible)
            {
                Point pt = new Point(frmSearch.Width, frmSearch.Height);
                Win32.ClientToScreen(frmSearch.Handle, ref pt);
                //Win32.ScreenToClient(Win32.GetParent(ResultsPopup.Handle), ref pt);

                pt.X -= ResultsPopup.Width;
                //if(pt.X < 0)
                //	pt.X = 0;
                ResultsPopup.Location = pt;

                EventHandler activated = null;
                activated = (object _sender, EventArgs _e) =>
                {
                    Win32.SetFocus(txtSearch.Handle);

                    ResultsPopup.Activated -= activated;
                };
                ResultsPopup.Activated += activated;
                ResultsPopup.Show();

                SetClearImage(Properties.Resources.ClearNormal);
            }
        }
Beispiel #2
0
        public FlyingSearchForm()
        {
            InitializeComponent();

            ResultsPopup = new ResultsPopup();
            ResultsPopup.OwnerTextBox = txtSearch;
            components.Add(ResultsPopup);
        }
 public void SelectSearchField()
 {
     if (ResultsPopup.Visible)
     {
         ResultsPopup.ShowMoreResults();
     }
     else
     {
         txtSearch.SelectAll();
         txtSearch.Focus();
         txtSearch_TextChanged(null, null);
     }
 }
Beispiel #4
0
        public FlyingSearchForm()
        {
            InitializeComponent();

            ResultsPopup = new ResultsPopup();
            ResultsPopup.OwnerTextBox = txtSearch;

            if (components == null)
            {
                components = new Container();
            }
            components.Add(ResultsPopup);
        }
Beispiel #5
0
        public ToolbarSearchForm()
        {
            InitializeComponent();
            ResultsPopup = new ResultsPopup();
            ResultsPopup.OwnerTextBox = txtSearch;
            components.Add(ResultsPopup);

            Main.NppListener.AfterHideShowToolbar += new NppListener.HideShowEventHandler(NppListener_AfterHideShowToolbar);

            frmSearch.Height = txtSearch.Height;
            frmSearch.Top    = (Height - frmSearch.Height) / 2;
            picClear.Top     = (frmSearch.Height - picClear.Height) / 2;

            picClear.Visible = false;
            //uint margins = (uint)Win32.SendMessage(txtSearch.Handle, (NppMsg)Win32.EM_GETMARGINS, 0, 0);
            //uint rightMargin = margins >> 16;
            //rightMargin+= 16;
            //Win32.SendMessage(txtSearch.Handle, (NppMsg)Win32.EM_SETMARGINS, Win32.EC_RIGHTMARGIN, (int)(rightMargin << 16));
        }
        private void txtSearch_KeyDown(object sender, KeyEventArgs e)
        {
            suppressKeyPress = false;

            switch (e.KeyCode)
            {
            case Keys.Escape:
                e.Handled        = true;
                suppressKeyPress = true;
                //txtSearch.Text     = "";
                ResultsPopup.Hide();
                Win32.SetFocus(PluginBase.GetCurrentScintilla());
                break;

            case Keys.Enter:
            case Keys.Tab:
                e.Handled        = true;
                suppressKeyPress = true;
                break;
            }
        }