2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these libraries and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: SearchDlg.c /main/4 1996/08/28 16:51:52 drk $ */
24 /**********************************<+>*************************************
25 ***************************************************************************
29 ** Project: Editor widget
31 ** Description: Routines which manipulate the dialogs associated with
32 ** find/change functions.
35 *******************************************************************
36 * (c) Copyright 1993, 1994 Hewlett-Packard Company
37 * (c) Copyright 1993, 1994 International Business Machines Corp.
38 * (c) Copyright 1993, 1994 Sun Microsystems, Inc.
39 * (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of Novell, Inc.
40 ********************************************************************
43 **************************************************************************
44 **********************************<+>*************************************/
46 #include <Xm/DialogS.h>
47 #include <Xm/PushBG.h>
48 #include <Xm/Separator.h>
50 #include <Xm/ScrollBar.h>
52 #include <Xm/LabelG.h>
54 #include <Xm/MwmUtil.h>
55 #include <Dt/DtMsgsP.h>
57 static void ManageFind(
58 DtEditorWidget pPriv);
59 static void UnmanageFind(
60 DtEditorWidget pPriv);
61 static void CreateSearchDialog(
62 DtEditorWidget pPriv);
72 XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
73 XtSetArg(al[ac], XmNtopWidget, M_findText(pPriv)); ac++;
74 XtSetArg(al[ac], XmNtopOffset, 10); ac++;
75 XtSetValues(M_search_replaceLbl(pPriv), al, ac);
77 XtManageChild(M_search_findLbl(pPriv));
78 XtManageChild(M_findText(pPriv));
88 XtUnmanageChild(M_search_findLbl(pPriv));
89 XtUnmanageChild(M_findText(pPriv));
92 XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
93 XtSetArg(al[ac], XmNtopWidget, M_search_spellList(pPriv)); ac++;
94 XtSetArg(al[ac], XmNtopOffset, 10); ac++;
95 XtSetValues(M_search_replaceLbl(pPriv), al, ac);
99 /************************************************************************
101 * _DtEditorSearch - Post a dialog asking for search string
103 ************************************************************************/
107 DtEditorWidget pPriv,
111 Arg al[10]; /* arg list */
112 int ac; /* arg count */
114 /* create the dialog if it is the first time */
115 if ( !M_search_dialog(pPriv) )
116 CreateSearchDialog(pPriv);
120 /* Prepare to display the dialog */
121 XtUnmanageChild(M_search_dialog(pPriv));
123 * Turn off the Find, Change, and Change All buttons.
124 * They will be turned on by the appropriate callback.
126 _DtEditorSetFindSensitivity(pPriv, False);
127 _DtEditorSetReplaceSensitivity(pPriv, False);
128 _DtEditorSetReplaceAllSensitivity(pPriv, False);
131 * Clear the Change To field. If in Find/Change mode it will
132 * be seeded with the last replace string, in Spell mode it will
135 XmTextFieldSetString( M_replaceText(pPriv), (char *)NULL );
140 * Set it up as a Spell dialog
144 Dimension height, formHeight;
146 M_search_dialogMode(pPriv) = SPELL;
149 * Set the dialog title.
150 * If DtNdialogTitle has been set then prepend it.
152 if ( E_dialogTitle(pPriv) != (XmString)NULL) {
154 XmString titleStr = XmStringConcat( E_dialogTitle(pPriv),
155 M_spellTitle(pPriv) );
157 XtSetArg(al[0],XmNdialogTitle,titleStr);
158 XtSetValues(M_search_dialog(pPriv), al, 1);
160 XmStringFree( titleStr );
163 XtSetArg(al[0],XmNdialogTitle,M_spellTitle(pPriv));
164 XtSetValues(M_search_dialog(pPriv), al, 1);
168 XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
169 XtSetValues(XtParent(M_search_spellList(pPriv)), al, ac);
170 XtManageChild(M_search_listLbl(pPriv));
171 XtManageChild(XtParent(M_search_spellList(pPriv)));
174 * Select first item in list which will cause its selectCB
175 * to sensitize the Find button and clear the Change To field.
177 XmListSelectPos(M_search_spellList(pPriv), 1, True);
180 * Hide the Find field & label
185 XtSetArg(al[ac], XmNy, &y); ac++;
186 XtSetArg(al[ac], XmNheight, &height); ac++;
187 XtGetValues(XtParent(M_search_spellList(pPriv)), al, ac);
189 XtSetArg(al[ac], XmNheight, &formHeight); ac++;
190 XtGetValues(M_search_dialog(pPriv), al, ac);
192 XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
193 XtSetArg(al[ac], XmNbottomOffset, formHeight - (y + height)); ac++;
194 XtSetValues(XtParent(M_search_spellList(pPriv)), al, ac);
199 * Set it up as a Find/Change dialog
204 M_search_dialogMode(pPriv) = REPLACE;
207 * Set the dialog title.
208 * If DtNdialogTitle has been set then prepend it.
211 if ( E_dialogTitle(pPriv) != (XmString)NULL) {
212 XmString titleStr = XmStringConcat( E_dialogTitle(pPriv),
213 M_fndChngTitle(pPriv) );
215 XtSetArg(al[0], XmNdialogTitle, titleStr);
216 XtSetValues(M_search_dialog(pPriv), al, 1);
218 XmStringFree( titleStr );
221 XtSetArg( al[0], XmNdialogTitle,M_fndChngTitle(pPriv) );
222 XtSetValues(M_search_dialog(pPriv), al, 1);
226 * Show the Find field & label
231 * Seed the Find field with the last string we searched for
232 * and select it. This will cause _DtEditorFindTextChangedCB
233 * to enable the Find & Change All buttons.
236 if ( M_search_string(pPriv) ) {
237 XmTextFieldSetString(M_findText(pPriv),M_search_string(pPriv));
238 event.xkey.time = XtLastTimestampProcessed(M_display(pPriv));
239 XtCallActionProc( (Widget) M_findText(pPriv), "select-all",
240 &event, (String *)NULL, 0 );
243 XmTextFieldSetString( M_findText(pPriv), (char *)NULL );
246 * Seed the Change To field with the last replacement string.
249 if ( M_replace_string(pPriv) )
250 XmTextFieldSetString( M_replaceText(pPriv),
251 M_replace_string(pPriv) );
254 * Hide the list of misspelled words
256 XtUnmanageChild(M_search_listLbl(pPriv));
257 XtUnmanageChild(XtParent(M_search_spellList(pPriv)));
263 XtManageChild(M_search_dialog(pPriv));
266 if (M_search_dialogMode(pPriv) == SPELL)
267 XmProcessTraversal(M_replaceText(pPriv), XmTRAVERSE_CURRENT);
269 XmProcessTraversal(M_findText(pPriv), XmTRAVERSE_CURRENT);
274 DtEditorWidget pPriv)
276 Arg al[10]; /* arg list */
277 int ac; /* arg count */
278 Pixel textBackground, textForeground;
282 * The Find/Change & the Spell dialogs are the same dialog with
283 * various components unmanaged depending upon the mode of the
284 * dialog. There is no reason why these could not be separate
285 * dialogs if they need to be. All of the callbacks and routines
286 * which manipulate these dialogs are aware of the dialog's mode and
287 * could be split into two separate callbacks/routines.
291 * Match the background & foreground colors of the edit window
292 * Don't use DtNtextBackground/Foreground directly because they
293 * will be DtUNSPECIFIED.
296 XtSetArg(al[ac], XmNforeground, &textForeground); ac++;
297 XtSetArg(al[ac], XmNbackground, &textBackground); ac++;
298 XtGetValues(M_text(pPriv), al, ac);
301 * Create the form dialog.
304 M_search_dialog(pPriv) = XmCreateFormDialog(M_topLevelShell(pPriv),
307 XtSetArg(al[ac], XmNautoUnmanage, False); ac++;
308 XtSetValues(M_search_dialog(pPriv), al, ac);
311 * When creating the fields & buttons use the appropriate label
312 * resource (e.g. DtNchangeButtonLabel), if it has been set, then
313 * clear the resource to save space. The field or button widget
314 * will contain the actual value & it can be gotten from there,
317 * If the appropriate resource has not been set, use its default
318 * value from the message catalog.
322 * Create the list of misspelled words
325 if (E_misspelledListLabel(pPriv) != (XmString) DtUNSPECIFIED) {
327 * Use the resource value & clear it (to save space).
330 tmpStr1 = XmStringCopy(E_misspelledListLabel(pPriv));
331 E_misspelledListLabel(pPriv) = (XmString) DtUNSPECIFIED;
335 * The resource has not been set so use its default value
337 tmpStr1 = XmStringCreateLocalized(MISSPELLED);
339 XtSetArg(al[ac], XmNlabelString, tmpStr1); ac++;
340 XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
341 XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
342 XtSetArg(al[ac], XmNfontList, E_labelFontList(pPriv)); ac++;
343 M_search_listLbl(pPriv) = XmCreateLabelGadget(M_search_dialog(pPriv),
345 XmStringFree(tmpStr1);
346 XtManageChild(M_search_listLbl(pPriv));
349 XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
350 XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
351 XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
352 XtSetArg(al[ac], XmNtopWidget, M_search_listLbl(pPriv)); ac++;
353 XtSetArg(al[ac], XmNscrollingPolicy, XmAUTOMATIC); ac++;
354 XtSetArg(al[ac], XmNfontList, E_textFontList(pPriv)); ac++;
355 M_search_spellList(pPriv) = XmCreateScrolledList(M_search_dialog(pPriv),
356 "spellList", al, ac);
357 XtManageChild(M_search_spellList(pPriv));
358 XtManageChild(XtParent(M_search_spellList(pPriv)));
360 XtAddCallback( M_search_spellList(pPriv), XmNhelpCallback,
361 (XtCallbackProc)_DtEditorHelpSearchSpellCB,
365 * Create the find field & its label
368 if (E_findFieldLabel(pPriv) != (XmString) DtUNSPECIFIED) {
370 * Use the resource value & clear it (to save space).
373 tmpStr1 = XmStringCopy(E_findFieldLabel(pPriv));
374 E_findFieldLabel(pPriv) = (XmString) DtUNSPECIFIED;
378 * The resource has not been set so use its default value
380 tmpStr1 = XmStringCreateLocalized(FIND_LABEL);
382 XtSetArg(al[ac], XmNlabelString, tmpStr1); ac++;
383 XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
384 XtSetArg(al[ac], XmNtopOffset, 10); ac++;
385 XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
386 XtSetArg(al[ac], XmNfontList, E_labelFontList(pPriv)); ac++;
387 M_search_findLbl(pPriv) = XmCreateLabelGadget(M_search_dialog(pPriv),
389 XmStringFree(tmpStr1);
392 XtSetArg (al[ac], XmNbackground, textBackground); ac++;
393 XtSetArg (al[ac], XmNforeground, textForeground); ac++;
394 XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
395 XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
396 XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
397 XtSetArg(al[ac], XmNtopWidget, M_search_findLbl(pPriv)); ac++;
398 XtSetArg(al[ac], XmNtopOffset, 5); ac++;
399 XtSetArg(al[ac], XmNfontList, E_textFontList(pPriv)); ac++;
400 M_findText(pPriv) = XmCreateTextField(M_search_dialog(pPriv), "findTxt",
403 XtAddCallback( M_findText(pPriv), XmNhelpCallback,
404 (XtCallbackProc)_DtEditorHelpSearchFindCB,
408 * Create the Change To field & its label
411 if (E_changeFieldLabel(pPriv) != (XmString) DtUNSPECIFIED) {
413 * Use the resource value & clear it (to save space).
416 tmpStr1 = XmStringCopy(E_changeFieldLabel(pPriv));
417 E_changeFieldLabel(pPriv) = (XmString) DtUNSPECIFIED;
421 * The resource has not been set so use its default value
423 tmpStr1 = XmStringCreateLocalized(CHANGE_LABEL);
425 XtSetArg(al[ac], XmNlabelString, tmpStr1); ac++;
426 XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
427 XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
428 XtSetArg(al[ac], XmNtopWidget, M_findText(pPriv)); ac++;
429 XtSetArg(al[ac], XmNtopOffset, 10); ac++;
430 XtSetArg(al[ac], XmNfontList, E_labelFontList(pPriv)); ac++;
431 M_search_replaceLbl(pPriv) = XmCreateLabelGadget(M_search_dialog(pPriv),
433 XmStringFree(tmpStr1);
434 XtManageChild(M_search_replaceLbl(pPriv));
437 XtSetArg (al[ac], XmNbackground, textBackground); ac++;
438 XtSetArg (al[ac], XmNforeground, textForeground); ac++;
439 XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
440 XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
441 XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
442 XtSetArg(al[ac], XmNtopWidget, M_search_replaceLbl(pPriv)); ac++;
443 XtSetArg(al[ac], XmNtopOffset, 5); ac++;
444 XtSetArg(al[ac], XmNfontList, E_textFontList(pPriv)); ac++;
445 M_replaceText(pPriv) = XmCreateTextField(M_search_dialog(pPriv), "repTxt",
447 XtManageChild(M_replaceText(pPriv));
449 XtAddCallback( M_replaceText(pPriv), XmNhelpCallback,
450 (XtCallbackProc)_DtEditorHelpSearchChangeCB,
453 * Only enable Change To field if the widget is editable
455 XtSetSensitive(M_search_replaceLbl(pPriv), M_editable(pPriv));
456 XtSetSensitive(M_replaceText(pPriv), M_editable(pPriv));
459 XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
460 XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
461 XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
462 XtSetArg(al[ac], XmNtopWidget, M_replaceText(pPriv)); ac++;
463 XtSetArg(al[ac], XmNtopOffset, 5); ac++;
464 M_search_separator(pPriv) =
465 XmCreateSeparator(M_search_dialog(pPriv), "separator",
467 XtManageChild(M_search_separator(pPriv));
470 * Create the buttons & their labels
475 if (E_findButtonLabel(pPriv) != (XmString) DtUNSPECIFIED) {
477 * Use the resource value & clear it (to save space).
480 tmpStr1 = XmStringCopy(E_findButtonLabel(pPriv));
481 E_findButtonLabel(pPriv) = (XmString) DtUNSPECIFIED;
485 * The resource has not been set so use its default value
487 tmpStr1 = XmStringCreateLocalized(FIND_BUTTON);
489 XtSetArg(al[ac], XmNlabelString, tmpStr1); ac++;
490 XtSetArg(al[ac], XmNleftAttachment, XmATTACH_POSITION); ac++;
491 XtSetArg(al[ac], XmNleftPosition, 2); ac++;
492 XtSetArg(al[ac], XmNrightAttachment, XmATTACH_POSITION); ac++;
493 XtSetArg(al[ac], XmNrightPosition, 33); ac++;
494 XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
495 XtSetArg(al[ac], XmNtopWidget, M_search_separator(pPriv)); ac++;
496 XtSetArg(al[ac], XmNtopOffset, 7); ac++;
497 XtSetArg(al[ac], XmNfontList, E_buttonFontList(pPriv)); ac++;
498 M_search_findBtn(pPriv) = XmCreatePushButtonGadget(M_search_dialog(pPriv),
500 XmStringFree(tmpStr1);
501 XtManageChild(M_search_findBtn(pPriv));
505 if (E_changeButtonLabel(pPriv) != (XmString) DtUNSPECIFIED) {
507 * Use the resource value & clear it (to save space).
510 tmpStr1 = XmStringCopy(E_changeButtonLabel(pPriv));
511 E_changeButtonLabel(pPriv) = (XmString) DtUNSPECIFIED;
515 * The resource has not been set so use its default value
517 tmpStr1 = XmStringCreateLocalized(CHANGE_BUTTON);
519 XtSetArg(al[ac], XmNlabelString, tmpStr1); ac++;
520 XtSetArg(al[ac], XmNleftAttachment, XmATTACH_POSITION); ac++;
521 XtSetArg(al[ac], XmNleftPosition, 35); ac++;
522 XtSetArg(al[ac], XmNrightAttachment, XmATTACH_POSITION); ac++;
523 XtSetArg(al[ac], XmNrightPosition, 66); ac++;
524 XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
525 XtSetArg(al[ac], XmNtopWidget, M_search_separator(pPriv)); ac++;
526 XtSetArg(al[ac], XmNtopOffset, 7); ac++;
527 XtSetArg(al[ac], XmNfontList, E_buttonFontList(pPriv)); ac++;
528 M_search_replaceBtn(pPriv) = XmCreatePushButtonGadget(
529 M_search_dialog(pPriv),
531 XmStringFree(tmpStr1);
532 XtManageChild(M_search_replaceBtn(pPriv));
534 /* Change All button */
536 if (E_changeAllButtonLabel(pPriv) != (XmString) DtUNSPECIFIED) {
538 * Use the resource value & clear it (to save space).
541 tmpStr1 = XmStringCopy(E_changeAllButtonLabel(pPriv));
542 E_changeAllButtonLabel(pPriv) = (XmString) DtUNSPECIFIED;
546 * The resource has not been set so use its default value
548 tmpStr1 = XmStringCreateLocalized(CHNG_ALL_BUTTON);
550 XtSetArg(al[ac], XmNlabelString, tmpStr1); ac++;
551 XtSetArg(al[ac], XmNleftAttachment, XmATTACH_POSITION); ac++;
552 XtSetArg(al[ac], XmNleftPosition, 68); ac++;
553 XtSetArg(al[ac], XmNrightAttachment, XmATTACH_POSITION); ac++;
554 XtSetArg(al[ac], XmNrightPosition, 98); ac++;
555 XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
556 XtSetArg(al[ac], XmNtopWidget, M_search_separator(pPriv)); ac++;
557 XtSetArg(al[ac], XmNtopOffset, 7); ac++;
558 XtSetArg(al[ac], XmNfontList, E_buttonFontList(pPriv)); ac++;
559 M_search_replaceAllBtn(pPriv) = XmCreatePushButtonGadget(
560 M_search_dialog(pPriv),
561 "replAllBtn", al, ac);
562 XmStringFree(tmpStr1);
563 XtManageChild(M_search_replaceAllBtn(pPriv));
567 tmpStr1 = XmStringCreateLocalized(CLOSE_BUTTON);
568 XtSetArg(al[ac], XmNlabelString, tmpStr1); ac++;
569 XtSetArg(al[ac], XmNleftAttachment, XmATTACH_POSITION); ac++;
570 XtSetArg(al[ac], XmNleftPosition, 13); ac++;
571 XtSetArg(al[ac], XmNrightAttachment, XmATTACH_POSITION); ac++;
572 XtSetArg(al[ac], XmNrightPosition, 43); ac++;
573 XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
574 XtSetArg(al[ac], XmNtopWidget, M_search_findBtn(pPriv)); ac++;
575 XtSetArg(al[ac], XmNtopOffset, 2); ac++;
576 XtSetArg(al[ac], XmNfontList, E_buttonFontList(pPriv)); ac++;
577 M_search_closeBtn(pPriv) = XmCreatePushButtonGadget(M_search_dialog(pPriv),
579 XmStringFree(tmpStr1);
580 XtManageChild(M_search_closeBtn(pPriv));
583 tmpStr1 = XmStringCreateLocalized(HELP_BUTTON);
584 XtSetArg (al[ac], XmNlabelString, tmpStr1); ac++;
585 XtSetArg(al[ac], XmNleftAttachment, XmATTACH_POSITION); ac++;
586 XtSetArg(al[ac], XmNleftPosition, 56); ac++;
587 XtSetArg(al[ac], XmNrightAttachment, XmATTACH_POSITION); ac++;
588 XtSetArg(al[ac], XmNrightPosition, 86); ac++;
589 XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
590 XtSetArg(al[ac], XmNtopWidget, M_search_findBtn(pPriv)); ac++;
591 XtSetArg(al[ac], XmNtopOffset, 2); ac++;
592 XtSetArg(al[ac], XmNfontList, E_buttonFontList(pPriv)); ac++;
593 M_search_helpBtn(pPriv) = XmCreatePushButtonGadget(M_search_dialog(pPriv),
595 XmStringFree(tmpStr1);
596 XtManageChild(M_search_helpBtn(pPriv));
599 XtRemoveAllCallbacks(M_search_spellList(pPriv), XmNbrowseSelectionCallback);
600 XtAddCallback(M_search_spellList(pPriv), XmNbrowseSelectionCallback,
601 (XtCallbackProc) _DtEditorMisspelledSelectCB, pPriv);
602 XtAddCallback(M_search_spellList(pPriv), XmNdefaultActionCallback,
603 (XtCallbackProc) _DtEditorMisspelledDblClickCB, pPriv);
606 XtSetArg(al[ac], XmNvisibleItemCount, 4); ac++;
607 XtSetValues(M_search_spellList(pPriv), al, ac);
610 XtSetArg(al[ac], XmNheight, &M_search_buttonHeight(pPriv)); ac++;
611 XtGetValues(M_search_helpBtn(pPriv), al, ac);
614 XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
615 XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
616 XtSetArg(al[ac], XmNtopWidget, M_replaceText(pPriv)); ac++;
617 XtSetArg(al[ac], XmNtopOffset, 5); ac++;
618 XtSetArg(al[ac], XmNbottomOffset, 2 * M_search_buttonHeight(pPriv) + 35);
620 XtSetValues(M_search_separator(pPriv), al, ac);
622 XtAddCallback(M_search_findBtn(pPriv), XmNactivateCallback,
623 (XtCallbackProc) _DtEditorDialogSearchCB,
625 XtAddCallback(M_search_replaceBtn(pPriv), XmNactivateCallback,
626 (XtCallbackProc) _DtEditorDialogReplaceCB,
628 XtAddCallback(M_search_replaceAllBtn(pPriv), XmNactivateCallback,
629 (XtCallbackProc) _DtEditorDialogReplaceAllCB,
631 XtAddCallback(M_search_closeBtn(pPriv), XmNactivateCallback,
632 (XtCallbackProc) _DtEditorDialogFindCancelCB,
634 XtAddCallback(M_search_helpBtn(pPriv), XmNactivateCallback,
635 (XtCallbackProc) _DtEditorHelpSearchCB,
637 XtAddCallback(M_search_dialog(pPriv), XmNmapCallback,
638 (XtCallbackProc) _DtEditorSearchMapCB, pPriv);
639 XtAddCallback(M_findText(pPriv), XmNvalueChangedCallback,
640 (XtCallbackProc)_DtEditorFindTextChangedCB, pPriv);
641 XtAddCallback(M_replaceText(pPriv), XmNvalueChangedCallback,
642 (XtCallbackProc)_DtEditorReplaceTextChangedCB, pPriv);
643 XtAddCallback(M_search_dialog(pPriv), XmNhelpCallback,
644 (XtCallbackProc) _DtEditorHelpSearchCB, (XtPointer)pPriv);
646 XtSetArg(al[0], XmNdefaultButton, M_search_closeBtn(pPriv));
647 XtSetValues(M_search_dialog(pPriv), al, 1);
649 XtRealizeWidget(M_search_dialog(pPriv));
650 } /* end CreateSearchDialog */