Lines Matching defs:search

363  * the search dialog box uses.
369 * Text Widget that will search for a string in the main
376 * If the search was sucessful and the argument popdown is passed to
378 * search widget.
396 if (DoSearch(tw->text.search) && popdown)
397 PopdownSearch(w, (caddr_t) tw->text.search, NULL);
402 * Text Widget that will popdown the search widget.
417 PopdownSearch(w, (caddr_t) tw->text.search, NULL);
421 * Description: Pops down the search widget and resets it.
423 * closure - a pointer to the search structure.
435 struct SearchAndReplace * search = (struct SearchAndReplace *) closure;
437 XtPopdown( search->search_popup );
438 SetSearchLabels(search, SEARCH_LABEL_1, SEARCH_LABEL_2, FALSE);
442 * Description: Performs a search when the button is clicked.
444 * closure - a pointer to the search info.
461 * it will popup the search dialog box.
471 * First Entry: The first entry is the direction to search by default.
476 * string to search for.
529 if (ctx->text.search== NULL) {
530 ctx->text.search = XtNew(struct SearchAndReplace);
531 ctx->text.search->search_popup = CreateDialog(w, ptr, "search",
533 XtRealizeWidget(ctx->text.search->search_popup);
539 InitializeSearchWidget(ctx->text.search, dir, (edit_mode == XawtextEdit));
541 CenterWidgetOnPoint(ctx->text.search->search_popup, event);
542 XtPopup(ctx->text.search->search_popup, XtGrabNone);
546 * Description: This function initializes the search widget and
547 * is called each time the search widget is poped up.
548 * Arguments: search - the search widget structure.
549 * dir - direction to search.
556 InitializeSearchWidget(search, dir, replace_active)
557 struct SearchAndReplace * search;
561 SetResource(search->rep_one, XtNsensitive, (XtArgVal) replace_active);
562 SetResource(search->rep_all, XtNsensitive, (XtArgVal) replace_active);
563 SetResource(search->rep_label, XtNsensitive, (XtArgVal) replace_active);
564 SetResource(search->rep_text, XtNsensitive, (XtArgVal) replace_active);
568 SetResource(search->left_toggle, XtNstate, (XtArgVal) TRUE);
571 SetResource(search->right_toggle, XtNstate, (XtArgVal) TRUE);
580 * Arguments: form - the form widget for the search widget.
595 struct SearchAndReplace * search = ((TextWidget) tw)->text.search;
602 search->label1 = XtCreateManagedWidget("label1", labelWidgetClass,
606 XtSetArg(args[num_args], XtNfromVert, search->label1); num_args++;
611 search->label2 = XtCreateManagedWidget("label2", labelWidgetClass,
621 XtSetArg(args[num_args], XtNfromVert, search->label2); num_args++;
626 search->left_toggle = XtCreateManagedWidget("backwards", toggleWidgetClass,
631 XtSetArg(args[num_args], XtNfromVert, search->label2); num_args++;
632 XtSetArg(args[num_args], XtNfromHoriz, search->left_toggle); num_args++;
635 XtSetArg(args[num_args], XtNradioGroup, search->left_toggle); num_args++;
638 search->right_toggle = XtCreateManagedWidget("forwards", toggleWidgetClass,
645 XtOverrideTranslations(search->left_toggle, radio_translations);
646 XtOverrideTranslations(search->right_toggle, radio_translations);
650 XtSetArg(args[num_args], XtNfromVert, search->left_toggle); num_args++;
659 XtSetArg(args[num_args], XtNfromVert, search->left_toggle); num_args++;
669 search->search_text = s_text;
677 search->rep_label = XtCreateManagedWidget("replaceLabel", labelWidgetClass,
691 search->rep_text = r_text;
698 search_button = XtCreateManagedWidget("search", commandWidgetClass, form,
707 search->rep_one = XtCreateManagedWidget("replaceOne", commandWidgetClass,
713 XtSetArg(args[num_args], XtNfromHoriz, search->rep_one); num_args++;
716 search->rep_all = XtCreateManagedWidget("replaceAll", commandWidgetClass,
722 XtSetArg(args[num_args], XtNfromHoriz, search->rep_all); num_args++;
729 (caddr_t) search);
730 XtAddCallback(search->rep_one, XtNcallback, (XtCallbackProc)DoReplaceOne,
731 (caddr_t) search);
732 XtAddCallback(search->rep_all, XtNcallback, (XtCallbackProc)DoReplaceAll,
733 (caddr_t) search);
735 (caddr_t) search);
745 XtGetValues(search->rep_text, args, num_args);
748 XtSetValues(search->rep_text, args, num_args);
749 XtSetKeyboardFocus(form, search->search_text);
752 SetSearchLabels(search, SEARCH_LABEL_1, SEARCH_LABEL_2, FALSE);
759 XtOverrideTranslations(search->search_text, trans);
762 XtOverrideTranslations(search->rep_text, trans);
766 * Description: Performs a search.
767 * Arguments: search - the serach structure.
773 DoSearch(search)
774 struct SearchAndReplace * search;
777 Widget tw = XtParent(search->search_popup);
782 text.ptr = GetString(search->search_text);
787 dir = (XawTextScanDirection) (XawToggleGetCurrent(search->left_toggle) -
801 search->selection_changed = FALSE; /* selection is good. */
806 SetSearchLabels(search, msg, "", TRUE);
840 if (Replace( ctx->text.search, TRUE, popdown) && popdown)
841 PopdownSearch(w, (caddr_t) ctx->text.search, (caddr_t)NULL);
846 * in the search dialog's text widget
849 * closure - a pointer to the search structure.
866 * in the search dialog's text widget
869 * closure - a pointer to the search structure.
897 Replace(search, once_only, show_current)
898 struct SearchAndReplace * search;
904 Widget tw = XtParent(search->search_popup);
907 find.ptr = GetString( search->search_text);
912 replace.ptr = GetString(search->rep_text);
917 dir = (XawTextScanDirection) (XawToggleGetCurrent(search->left_toggle) -
930 SetSearchLabels(search, msg, "", TRUE);
942 if (search->selection_changed) {
943 SetSearchLabels(search, "Selection has been modified, aborting.",
955 SetSearchLabels(search, "*** Error while replacing", msg, TRUE);
968 DoSearch(search);
983 * Description: Sets both the search labels, and also rings the bell
984 * Arguments: search - the search structure.
985 * msg1, msg2 - message to put in each search label.
991 SetSearchLabels(search, msg1, msg2, bell)
992 struct SearchAndReplace * search;
996 (void) SetResource( search->label1, XtNlabel, (XtArgVal) msg1);
997 (void) SetResource( search->label2, XtNlabel, (XtArgVal) msg2);
999 XBell(XtDisplay(search->search_popup), 0);
1025 struct SearchAndReplace * search;
1028 search = ((TextWidget) XtParent(XtParent(XtParent(w))))->text.search;
1031 SetSearchLabels(search, "*** Error: SetField Action must have",
1038 new = search->search_text;
1039 old = search->rep_text;
1043 old = search->search_text;
1044 new = search->rep_text;
1047 SetSearchLabels(search, "*** Error: SetField Action's first Argument must",