Lines Matching +defs:replace +defs:text
77 static _Xconst char* TEXT_NAME = "text";
185 * w - text widget
191 * Action routine that can be bound to the text widget
211 XtGetValues(ctx->text.source, args, 1);
223 if (!ctx->text.file_insert) {
224 ctx->text.file_insert = CreateDialog(w, ptr, "insertFile",
226 XtRealizeWidget(ctx->text.file_insert);
227 SetWMProtocolTranslations(ctx->text.file_insert);
230 CenterWidgetOnPoint(ctx->text.file_insert, event);
231 XtPopup(ctx->text.file_insert, XtGrabNone);
240 * closure - pointer to the main text widget that popped up this dialog
252 XtPopdown(ctx->text.file_insert);
253 (void)SetResourceByName(ctx->text.file_insert, LABEL_NAME,
263 * closure - pointer to the text widget to insert the file into
266 * Actually insert the file named in the text widget of the file dialog
277 if ((temp_widget = XtNameToWidget(ctx->text.file_insert, buf)) == NULL) {
279 "Error: Could not get text widget from file insert popup");
288 (void)SetResourceByName(ctx->text.file_insert,
298 * tw - text widget to insert this file into
302 * Inserts a file into the text widget.
311 XawTextBlock text;
322 text.firstPos = 0;
323 text.length = (int)ftell(file);
324 text.ptr = XtMalloc((Cardinal)(text.length + 1));
325 text.format = XawFmt8Bit;
328 if (fread(text.ptr, 1, (size_t)text.length, file) != (size_t)text.length)
332 if (XawTextReplace(tw, pos, pos, &text) != XawEditDone) {
333 XtFree(text.ptr);
337 pos += text.length;
338 XtFree(text.ptr);
353 * tw - main text widget
363 Widget label, text, cancel, insert;
382 text = XtCreateManagedWidget(TEXT_NAME, asciiTextWidgetClass, form,
387 XtSetArg(args[num_args], XtNfromVert, text); num_args++;
395 XtSetArg(args[num_args], XtNfromVert, text); num_args++;
405 XtSetKeyboardFocus(form, text);
411 XtOverrideTranslations(text, trans);
442 if (DoSearch(tw->text.search) && popdown)
443 PopdownSearch(w, (XtPointer)tw->text.search, NULL);
461 PopdownSearch(w, (XtPointer)tw->text.search, NULL);
510 * w - text widget
516 * Action routine that can be bound to the text widget
581 if (ctx->text.search== NULL) {
582 ctx->text.search = XtNew(struct SearchAndReplace);
583 ctx->text.search->search_popup = CreateDialog(w, ptr, "search",
585 XtRealizeWidget(ctx->text.search->search_popup);
586 SetWMProtocolTranslations(ctx->text.search->search_popup);
589 XtVaSetValues(ctx->text.search->search_text, XtNstring, ptr, NULL);
592 XtGetValues(ctx->text.source, args, 1);
594 InitializeSearchWidget(ctx->text.search, dir, (edit_mode == XawtextEdit));
596 CenterWidgetOnPoint(ctx->text.search->search_popup, event);
597 XtPopup(ctx->text.search->search_popup, XtGrabNone);
607 * replace_active - state of the sensitivity for the replace button
639 * tw - main text widget
651 struct SearchAndReplace *search = ((TextWidget)tw)->text.search;
803 * Initialize the text entry fields
850 XawTextBlock text;
853 text.firstPos = 0;
854 text.ptr = GetStringRaw(search->search_text);
855 if ((text.format = (unsigned long)_XawTextFormat(ctx)) == XawFmtWide)
856 text.length = (int)wcslen((wchar_t*)text.ptr);
858 text.length = (int)strlen(text.ptr);
862 /* text.firstPos isn't useful here, so I'll use it as an
870 text.firstPos = !case_sensitive;
878 pos = XawTextSearch(tw, dir, &text);
909 XawTextSetSelection(tw, pos, pos + text.length);
913 XawTextSetInsertionPoint(tw, pos + text.length);
924 * the replace dialog box uses
932 * Text Widget that will replace a string in the main Text Widget.
945 if (Replace( ctx->text.search, True, popdown) && popdown)
946 PopdownSearch(w, (XtPointer)ctx->text.search, NULL);
960 * dialog's text widget with the one in the replace dialog's text widget.
980 * text widget with the one in the replace dialog's text widget.
995 * once_only - if True then only replace the first one found,
996 * else replace all of them
1003 * replacing strings in the main text widget.
1010 XawTextBlock find, replace;
1023 replace.ptr = GetStringRaw(search->rep_text);
1024 replace.firstPos = 0;
1025 if ((replace.format = (unsigned long)_XawTextFormat(ctx)) == XawFmtWide)
1026 replace.length = (int)wcslen((wchar_t*)replace.ptr);
1028 replace.length = (int)strlen(replace.ptr);
1102 if (XawTextReplace(tw, pos, end_pos, &replace) != XawEditDone) {
1113 ipos = pos + replace.length;
1128 ctx->text.insertPos = ipos;
1132 if (replace.length == 0)
1135 XawTextSetSelection(tw, pos, pos + replace.length);
1186 search = ((TextWidget)XtParent(XtParent(XtParent(w))))->text.search;
1218 * cnew - new and old text fields
1222 * Sets the current text field.
1309 * text - text widget whose string we will get
1319 GetString(Widget text)
1325 XtGetValues(text, args, 1);
1336 last = XawTextSourceScan(ctx->text.source, 0, XawstAll, XawsdRight,
1337 ctx->text.mult, True);
1414 * parent - parent of the dialog - the main text widget
1425 * ptr - initial string for the dialog's text widget
1426 * parent - parent of the dialog - the main text widget