예제 #1
0
 private void InitQuickHistoryList() {
     _quickHistoryListForm = new QuickListForm();
     _quickHistoryListForm.OnSelectPattern += new RegexPatternEventHandler(_quickHistoryListForm_OnSelectPattern);
     _quickHistoryListForm.OnShow += new RegexExplorerEventHandler(UnBindRegexPatternOnArrowDown); 
     _quickHistoryListForm.OnHide += new RegexExplorerEventHandler(BindRegexPatternOnArrowDown);
 }
예제 #2
0
 private void CheckQuickListSelection(QuickListForm quickListForm, RegexPattern regexPattern, bool replacePattern) {
     quickListForm.Hide();
     if(replacePattern) {
         Value = regexPattern;
         if(txtRegexPattern.Text.Length == 0)
             return;
         txtRegexPattern.Select(txtRegexPattern.Text.Length - 1, 0);
     }
     else {
         EditionHelper.Insert(txtRegexPattern, regexPattern.Value);
         RegexPatternEx regexPatternEx = regexPattern as RegexPatternEx;
         if(regexPatternEx == null || regexPatternEx.ShiftCursorLeft == 0)
             return;
         txtRegexPattern.Select(txtRegexPattern.SelectionStart - regexPatternEx.ShiftCursorLeft, regexPatternEx.SelectionLength);
     }
 }
예제 #3
0
 private void InitRegexPatternsTipsList() {
     _quickRegexPatternsTipsListForm = new QuickListForm(true);
     _quickRegexPatternsTipsListForm.OnSelectPattern += new RegexPatternEventHandler(QuickRegexPatternsTipsListForm_OnSelectPattern);
     _quickRegexPatternsTipsListForm.OnShow += new RegexExplorerEventHandler(UnBindRegexPatternOnArrowUp); 
     _quickRegexPatternsTipsListForm.OnHide += new RegexExplorerEventHandler(BindRegexPatternOnArrowUp);
 }
예제 #4
0
 private void ShowQuickListFor(ArrayList patternsList, QuickListForm quickListForm, bool showDescription) {
     Control form = txtRegexPattern.TopLevelControl;
     Point location = form.Location;
     Control parent = txtRegexPattern.Parent;
     int x = txtRegexPattern.Location.X + (form.Bounds.Width - form.ClientRectangle.Width) / 2 ;
     int y = txtRegexPattern.Location.Y + (form.Bounds.Height - form.ClientRectangle.Height) / 2;
     while(parent != form) {
         x += parent.Location.X;
         y += parent.Location.Y;
         parent = parent.Parent;
     }
     location.X = location.X + x;
     location.Y = location.Y + y + 23 + txtRegexPattern.Height;
     quickListForm.Location = location;
     quickListForm.Width = txtRegexPattern.Width;
     quickListForm.SetDataList(patternsList, showDescription);
     quickListForm.Show();
 }