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 /* cpyx.c 1.29 - Fujitsu source for CDEnext 96/10/30 13:13:45 */
24 /* $XConsortium: cpyx.c /main/8 1996/11/08 01:52:55 cde-fuj $ */
26 * (c) Copyright 1995 FUJITSU LIMITED
27 * This is source code modified by FUJITSU LIMITED under the Joint
28 * Development Agreement for the CDEnext PST.
29 * This is unpublished proprietary source code of FUJITSU LIMITED
45 * There is no public header file for this function (only an
46 * internal header XmStringI.h).
48 extern XtPointer _XmStringUngenerate (XmString string,
51 XmTextType output_type);
54 #include "selectxlfd.h"
55 #include "xoakufont.h"
59 #define ReadXpm XpmCreatePixmapFromData
61 #define ReadXpm _DtXpmCreatePixmapFromData
63 #include "pixmaps/arrow.pm"
65 static Widget CreateCopyXLFD(Widget Top);
66 static void CpyXLFDCB(Widget w, caddr_t client_data, caddr_t *call_data);
68 extern int CreateOtherLabelAndText(int num,
75 extern Widget xlfdCreateScrolledList(Widget owner,
79 extern int GetItemsToDisplay(int num, int *itemcnt, XmString **xms_list);
81 extern void xlfdPopupDialog(Widget w);
83 extern void InitCpyPtn(void);
84 extern void _unmap(void);
85 extern void CpyCB(Widget w, XtPointer cdata);
86 extern void PopdownCpyPtn(void);
87 extern void AddPopupProc(Widget w, void(*popupcb)());
89 extern FalFontData fullFontData;
95 FalFontData copyFontData;
97 extern Widget toplevel ;
98 Widget cpyDialog=NULL;
99 static Widget codeLabel[COPYLABELS];
100 static Widget codeText[COPYLABELS+1];
102 extern TextField SrcTf;
103 extern TextField DestTf;
105 extern char AreaStr[160];
110 extern Resource resource ;
112 #define CS0 "Codeset 0"
113 #define CS1 "Codeset 1"
114 #define CS2 "Codeset 2"
115 #define CS3 "Codeset 3"
117 #define FAL_ERROR_STR resource.falerrmsg[((fal_utyerrno & 0xff) > 25) ? 0 : (fal_utyerrno & 0xff)]
119 static Widget pull1, pull2, pull3, pull4, scrolllist;
120 static int xlf_count = 0;
121 static XmString *xlf=NULL;
122 static int udc_count = 0;
123 static Boolean udc_flag = False;
124 static int *udc=NULL;
126 static int sty_count = 0;
127 static Boolean sty_flag = False;
128 static char **sty=NULL;
129 static char *sty_val=NULL;
130 static int wls_count = 0;
131 static Boolean wls_flag = False;
132 static int *wls=NULL;
134 static int hls_count = 0;
135 static Boolean hls_flag = False;
136 static int *hls=NULL;
138 static Widget *button1=NULL;
139 static Widget *button2=NULL;
140 static Widget *button3=NULL;
141 static Widget *button4=NULL;
142 static Widget focus_widget=NULL;
144 /****************************************************************
146 ***************************************************************/
151 CpyXLFDCB(Widget w, caddr_t client_data, caddr_t *call_data)
155 /* get font file name (str: XLFD name) */
156 /* get font file name (str: XLFD name) */
157 XtVaGetValues(scrolllist, XmNselectedItems, &st, NULL);
159 copyFontData.xlfdname = NULL;
162 str = _XmStringUngenerate(st[0], NULL, XmMULTIBYTE_TEXT, XmMULTIBYTE_TEXT);
163 copyFontData.xlfdname = str;
165 copyFontData.cd_set = udc_val;
167 copyFontData.cd_set = -1;
174 if( cpyDialog == NULL )
176 CreateCopyXLFD( toplevel ) ;
181 XtAddCallback(cpyDialog, XmNokCallback, (XtCallbackProc)_unmap, NULL);
182 XtAddCallback(cpyDialog, XmNokCallback,
183 (XtCallbackProc)CpyXLFDCB, NULL);
184 XtAddCallback(cpyDialog, XmNokCallback, (XtCallbackProc)CpyCB, NULL);
186 XtAddCallback(cpyDialog, XmNcancelCallback,
187 (XtCallbackProc)_unmap, (XtPointer)1);
188 XtAddCallback(cpyDialog, XmNcancelCallback,
189 (XtCallbackProc)CpyXLFDCB, (XtPointer)1);
190 XtAddCallback(cpyDialog, XmNcancelCallback,
191 (XtCallbackProc)CpyCB, (XtPointer)1);
192 XtAddCallback(cpyDialog, XmNhelpCallback, (XtCallbackProc)_unmap, NULL);
193 XtAddCallback(cpyDialog, XmNhelpCallback,
194 (XtCallbackProc)PopdownCpyPtn, NULL);
196 AddPopupProc( cpyDialog, InitCpyPtn ) ;
198 SrcTf.w1 = codeText[0] ;
199 SrcTf.w2 = codeText[1] ;
200 DestTf.w1 = codeText[2] ;
204 xlfdPopupDialog( cpyDialog );
211 int mask = FAL_FONT_MASK_DEFINED | FAL_FONT_MASK_UNDEFINED;
213 FalFontDataList *fontlist;
217 if (udc_flag == True) {
218 key.cd_set = udc_val;
219 mask |= FAL_FONT_MASK_CODE_SET;
221 if (sty_flag == True) {
222 key.style.name = sty_val;
223 mask |= FAL_FONT_MASK_STYLE_NAME;
225 if (wls_flag == True) {
226 key.size.w = wls_val;
227 mask |= FAL_FONT_MASK_SIZE_W;
229 if (hls_flag == True) {
230 key.size.h = hls_val;
231 mask |= FAL_FONT_MASK_SIZE_H;
234 if (FalGetFontList(&key, mask, &fontlist) == FAL_ERROR) {
237 if(fontlist->num == 0) {
238 FalFreeFontList(fontlist);
241 xlf = (XmString *)XtMalloc(sizeof(XmString) * fontlist->num);
242 for (i=0, f=fontlist->list; i < fontlist->num; i++, f++) {
243 xlf[xlf_count++] = XmStringCreateLocalized(f->xlfdname);
245 FalFreeFontList(fontlist);
253 XtVaGetValues(w, XmNlabelString, &label, NULL);
254 moji = _XmStringUngenerate(label, NULL, XmMULTIBYTE_TEXT, XmMULTIBYTE_TEXT);
255 if(strncmp(moji, "*", 1) == 0) {
257 } else if(strcmp(moji, CS0) == 0) {
258 udc_val = FAL_FONT_CS0;
260 } else if(strcmp(moji, CS1) == 0) {
261 udc_val = FAL_FONT_CS1;
263 } else if(strcmp(moji, CS2) == 0) {
264 udc_val = FAL_FONT_CS2;
266 } else if(strcmp(moji, CS3) == 0) {
267 udc_val = FAL_FONT_CS3;
274 XtVaSetValues(scrolllist, XmNitems, xlf, XmNitemCount, xlf_count, NULL);
286 XtVaGetValues(w, XmNlabelString, &label, NULL);
287 moji = _XmStringUngenerate(label, NULL, XmMULTIBYTE_TEXT, XmMULTIBYTE_TEXT);
288 if(strncmp(moji, "*", 1) == 0) {
292 sty_val = XtMalloc(sizeof(char) * (strlen(moji) + 1));
293 strcpy(sty_val, moji);
298 XtVaSetValues(scrolllist, XmNitems, xlf, XmNitemCount, xlf_count, NULL);
306 XtVaGetValues(w, XmNlabelString, &label, NULL);
307 moji = _XmStringUngenerate(label, NULL, XmMULTIBYTE_TEXT, XmMULTIBYTE_TEXT);
308 if(strncmp(moji, "*", 1) == 0) {
312 wls_val = atoi(moji);
318 XtVaSetValues(scrolllist, XmNitems, xlf, XmNitemCount, xlf_count, NULL);
326 XtVaGetValues(w, XmNlabelString, &label, NULL);
327 moji = _XmStringUngenerate(label, NULL, XmMULTIBYTE_TEXT, XmMULTIBYTE_TEXT);
328 if(strncmp(moji, "*", 1) == 0) {
332 hls_val = atoi(moji);
338 XtVaSetValues(scrolllist, XmNitems, xlf, XmNitemCount, xlf_count, NULL);
345 int mask = FAL_FONT_MASK_DEFINED | FAL_FONT_MASK_UNDEFINED;
347 FalFontDataList *fontlist;
351 if (sty_flag == True) {
352 key.style.name = sty_val;
353 mask |= FAL_FONT_MASK_STYLE_NAME;
355 if (wls_flag == True) {
356 key.size.w = wls_val;
357 mask |= FAL_FONT_MASK_SIZE_W;
359 if (hls_flag == True) {
360 key.size.h = hls_val;
361 mask |= FAL_FONT_MASK_SIZE_H;
363 if (FalGetFontList(&key, mask, &fontlist) == FAL_ERROR) {
364 for (j=0; j<udc_count; j++)
365 XtSetSensitive(button1[j], False);
368 if(fontlist->num == 0) {
369 FalFreeFontList(fontlist);
370 for (j=0; j<udc_count; j++)
371 XtSetSensitive(button1[j], False);
375 for (j=0; j<udc_count; j++) {
376 for (i=0, f=fontlist->list, found=False; i < fontlist->num; i++, f++) {
377 if(udc[j] == f->cd_set) {
383 XtSetSensitive(button1[j], False);
385 XtSetSensitive(button1[j], True);
387 FalFreeFontList(fontlist);
394 int mask = FAL_FONT_MASK_DEFINED | FAL_FONT_MASK_UNDEFINED;
396 FalFontDataList *fontlist;
400 if (udc_flag == True) {
401 key.cd_set = udc_val;
402 mask |= FAL_FONT_MASK_CODE_SET;
404 if (wls_flag == True) {
405 key.size.w = wls_val;
406 mask |= FAL_FONT_MASK_SIZE_W;
408 if (hls_flag == True) {
409 key.size.h = hls_val;
410 mask |= FAL_FONT_MASK_SIZE_H;
412 if (FalGetFontList(&key, mask, &fontlist) == FAL_ERROR) {
413 for (j=0; j<sty_count; j++)
414 XtSetSensitive(button2[j], False);
417 if(fontlist->num == 0) {
418 for (j=0; j<sty_count; j++)
419 XtSetSensitive(button2[j], False);
420 FalFreeFontList(fontlist);
424 for (j=0; j<sty_count; j++) {
425 for (i=0, f=fontlist->list, found=False; i < fontlist->num; i++, f++) {
426 if(strcmp(sty[j], f->style.name) == 0) {
432 XtSetSensitive(button2[j], False);
434 XtSetSensitive(button2[j], True);
436 FalFreeFontList(fontlist);
443 int mask = FAL_FONT_MASK_DEFINED | FAL_FONT_MASK_UNDEFINED;
445 FalFontDataList *fontlist;
449 if (udc_flag == True) {
450 key.cd_set = udc_val;
451 mask |= FAL_FONT_MASK_CODE_SET;
453 if (sty_flag == True) {
454 key.style.name = sty_val;
455 mask |= FAL_FONT_MASK_STYLE_NAME;
457 if (hls_flag == True) {
458 key.size.h = hls_val;
459 mask |= FAL_FONT_MASK_SIZE_H;
461 if (FalGetFontList(&key, mask, &fontlist) == FAL_ERROR) {
462 for (j=0; j<wls_count; j++)
463 XtSetSensitive(button3[j], False);
466 if(fontlist->num == 0) {
467 for (j=0; j<wls_count; j++)
468 XtSetSensitive(button3[j], False);
469 FalFreeFontList(fontlist);
473 for (j=0; j<wls_count; j++) {
474 for (i=0, f=fontlist->list, found=False; i < fontlist->num; i++, f++) {
475 if(wls[j] == f->size.w) {
481 XtSetSensitive(button3[j], False);
483 XtSetSensitive(button3[j], True);
485 FalFreeFontList(fontlist);
492 int mask = FAL_FONT_MASK_DEFINED | FAL_FONT_MASK_UNDEFINED;
494 FalFontDataList *fontlist;
498 if (udc_flag == True) {
499 key.cd_set = udc_val;
500 mask |= FAL_FONT_MASK_CODE_SET;
502 if (sty_flag == True) {
503 key.style.name = sty_val;
504 mask |= FAL_FONT_MASK_STYLE_NAME;
506 if (wls_flag == True) {
507 key.size.w = wls_val;
508 mask |= FAL_FONT_MASK_SIZE_W;
510 if (FalGetFontList(&key, mask, &fontlist) == FAL_ERROR) {
511 for (j=0; j<hls_count; j++)
512 XtSetSensitive(button4[j], False);
515 if(fontlist->num == 0) {
516 for (j=0; j<hls_count; j++)
517 XtSetSensitive(button4[j], False);
518 FalFreeFontList(fontlist);
522 for (j=0; j<hls_count; j++) {
523 for (i=0, f=fontlist->list, found=False; i < fontlist->num; i++, f++) {
524 if(hls[j] == f->size.h) {
530 XtSetSensitive(button4[j], False);
532 XtSetSensitive(button4[j], True);
534 FalFreeFontList(fontlist);
541 FalFontDataList *fontlist;
548 extern void data_sort();
549 extern void Error_message();
551 xlf_count = udc_count = sty_count = wls_count = hls_count = 0;
552 if (FalGetFontList(NULL, FAL_FONT_MASK_DEFINED |
553 FAL_FONT_MASK_UNDEFINED, &fontlist) == FAL_ERROR) {
554 snprintf(err, sizeof(err), "%s", FAL_ERROR_STR);
555 Error_message((Widget)NULL, err);
558 if(fontlist->num == 0) {
559 FalFreeFontList(fontlist);
560 snprintf(err, sizeof(err), "%s", resource.mn_no_font);
561 Error_message((Widget)NULL, err);
564 xlf = (XmString *)XtMalloc(sizeof(XmString) * fontlist->num);
565 udc = (int *)XtMalloc(sizeof(int) * fontlist->num);
566 sty = (char **)XtMalloc(sizeof(char *) * fontlist->num);
567 wls = (int *)XtMalloc(sizeof(int) * fontlist->num);
568 hls = (int *)XtMalloc(sizeof(int) * fontlist->num);
569 for (i=0, f=fontlist->list; i < fontlist->num; i++, f++) {
570 xlf[xlf_count++] = XmStringCreateLocalized(f->xlfdname);
571 for (j=0,found=False; j<udc_count; j++) {
572 if(udc[j] == f->cd_set) {
577 if (found == False) {
578 udc[udc_count++] = f->cd_set;
580 for (j=0,found=False; j<sty_count; j++) {
581 if(strcmp(sty[j], f->style.name) == 0) {
586 if (found == False) {
587 sty[sty_count] = XtMalloc(sizeof(char) * (strlen(f->style.name) + 1));
588 strcpy(sty[sty_count++], f->style.name);
590 if (f->size.w != -1) {
591 for (j=0,found=False; j<wls_count; j++) {
592 if(wls[j] == f->size.w) {
597 if (found == False) {
598 wls[wls_count++] = f->size.w;
601 for (j=0,found=False; j<hls_count; j++) {
602 if(hls[j] == f->size.h) {
607 if (found == False) {
608 hls[hls_count++] = f->size.h;
611 FalFreeFontList(fontlist);
613 data_sort(udc, udc_count);
614 data_sort(wls, wls_count);
615 data_sort(hls, hls_count);
617 button1 = (Widget *) XtMalloc(sizeof(Widget) * udc_count);
618 button2 = (Widget *) XtMalloc(sizeof(Widget) * sty_count);
619 button3 = (Widget *) XtMalloc(sizeof(Widget) * wls_count);
620 button4 = (Widget *) XtMalloc(sizeof(Widget) * hls_count);
622 button = XmCreatePushButton(pull1, "*", NULL, 0);
623 XtManageChild(button);
624 XtAddCallback(button, XmNactivateCallback,
625 (XtCallbackProc)udc_call, NULL);
626 for (i=0; i < udc_count; i++) {
627 if(udc[i] == FAL_FONT_CS0)
628 snprintf(tmp, sizeof(tmp), "%s", CS0);
629 else if(udc[i] == FAL_FONT_CS1)
630 snprintf(tmp, sizeof(tmp), "%s", CS1);
631 else if(udc[i] == FAL_FONT_CS2)
632 snprintf(tmp, sizeof(tmp), "%s", CS2);
633 else if(udc[i] == FAL_FONT_CS3)
634 snprintf(tmp, sizeof(tmp), "%s", CS3);
636 snprintf(tmp, sizeof(tmp), "Codeset %x?", udc[i]);
637 button1[i] = XmCreatePushButton(pull1, tmp, NULL, 0);
638 XtManageChild(button1[i]);
639 XtAddCallback(button1[i], XmNactivateCallback,
640 (XtCallbackProc)udc_call, NULL);
643 button = XmCreatePushButton(pull2, "*", NULL, 0);
644 XtManageChild(button);
645 XtAddCallback(button, XmNactivateCallback,
646 (XtCallbackProc)sty_call, NULL);
647 for (i=0; i < sty_count; i++) {
648 button2[i] = XmCreatePushButton(pull2, sty[i], NULL, 0);
649 XtManageChild(button2[i]);
650 XtAddCallback(button2[i], XmNactivateCallback,
651 (XtCallbackProc)sty_call, NULL);
654 button = XmCreatePushButton(pull3, "*", NULL, 0);
655 XtManageChild(button);
656 XtAddCallback(button, XmNactivateCallback,
657 (XtCallbackProc)wls_call, NULL);
658 for (i=0; i < wls_count; i++) {
659 snprintf(tmp, sizeof(tmp), "%d", wls[i]);
660 button3[i] = XmCreatePushButton(pull3, tmp, NULL, 0);
661 XtManageChild(button3[i]);
662 XtAddCallback(button3[i], XmNactivateCallback,
663 (XtCallbackProc)wls_call, NULL);
666 button = XmCreatePushButton(pull4, "*", NULL, 0);
667 XtManageChild(button);
668 XtAddCallback(button, XmNactivateCallback,
669 (XtCallbackProc)hls_call, NULL);
670 for (i=0; i < hls_count; i++) {
671 snprintf(tmp, sizeof(tmp), "%d", hls[i]);
672 button4[i] = XmCreatePushButton(pull4, tmp, NULL, 0);
673 XtManageChild(button4[i]);
674 XtAddCallback(button4[i], XmNactivateCallback,
675 (XtCallbackProc)hls_call, NULL);
681 arrow_change(Widget w, Widget wid)
683 if (XtIsSensitive(wid)) {
684 XtSetSensitive(wid, False);
686 XtSetSensitive(wid, True);
701 extern void CodeWindow();
702 XtVaGetValues(scrolllist, XmNselectedItems, &st, NULL);
706 str = _XmStringUngenerate(st[0], NULL, XmMULTIBYTE_TEXT, XmMULTIBYTE_TEXT);
707 CodeWindow(focus_widget, str, True);
713 extern void CodeWindow();
714 CodeWindow(codeText[2], fullFontData.xlfdname, False);
718 CreateCopyXLFD( Widget top )
723 XmString xms, xms1, xms2 ;
724 Widget frame, row, label1, row1, row2, row3, row4, row5;
725 Widget sep, cas1, cas2, cas3, cas4;
728 extern Pixmap arrow_pix;
734 udc_flag = sty_flag = wls_flag = hls_flag = False;
740 XtSetArg( args[n], XmNautoUnmanage, False ) ; n++ ;
741 xms = XmStringCreateLocalized( resource.l_copy ) ;
742 XtSetArg( args[n], XmNokLabelString, xms ) ; n++ ;
743 xms1 = XmStringCreateLocalized( resource.l_overlay ) ;
744 XtSetArg( args[n], XmNcancelLabelString, xms1 ) ; n++ ;
745 xms2 = XmStringCreateLocalized( resource.quit_label) ;
746 XtSetArg( args[n], XmNhelpLabelString, xms2 ) ; n++ ;
747 XtSetArg( args[n], XmNnoResize, True ) ; n++ ;
748 XtSetArg( args[n], XmNminimizeButtons, True ) ; n++ ;
749 XtSetArg( args[n], XmNtitle, resource.l_copy_title) ; n++ ;
750 cpyDialog = XmCreateTemplateDialog( top, "copy_dialog", args, n );
752 XmStringFree( xms ) ;
753 XmStringFree( xms1 ) ;
754 XmStringFree( xms2 ) ;
757 pull1 = XmCreatePulldownMenu(top, "pull", args, n);
758 pull2 = XmCreatePulldownMenu(top, "pull", args, n);
759 pull3 = XmCreatePulldownMenu(top, "pull", args, n);
760 pull4 = XmCreatePulldownMenu(top, "pull", args, n);
763 row = XmCreateRowColumn( cpyDialog, "BaseForm", args, n );
764 XtManageChild( row );
767 frame = XmCreateFrame( row, "frame", args, n);
768 XtManageChild( frame );
771 row1 = XmCreateRowColumn( frame, "row", args, n );
772 XtManageChild( row1 );
775 str = XmStringCreateLocalized(resource.l_selectitem) ;
776 XtSetArg(args[n], XmNlabelString, str); n++;
777 label1 = XmCreateLabel( row1, "SelectItems", args, n);
778 XtManageChild( label1 );
782 row2 = XmCreateRowColumn( row1, "row", args, n );
783 XtManageChild( row2 );
786 str = XmStringCreateLocalized(resource.l_codeset) ;
787 XtSetArg(args[n], XmNlabelString, str); n++;
788 XtSetArg(args[n], XmNsubMenuId, pull1); n++;
789 cas1 = XmCreateOptionMenu( row2, "CodeSet", args, n );
790 XtManageChild( cas1 );
791 XtAddCallback(XmOptionButtonGadget(cas1), XmNcascadingCallback,
792 (XtCallbackProc)button_set1, NULL);
796 str = XmStringCreateLocalized(resource.l_style) ;
797 XtSetArg(args[n], XmNlabelString, str); n++;
798 XtSetArg(args[n], XmNsubMenuId, pull2); n++;
799 cas2 = XmCreateOptionMenu( row2, "Style", args, n );
800 XtAddCallback(XmOptionButtonGadget(cas2), XmNcascadingCallback,
801 (XtCallbackProc)button_set2, NULL);
802 XtManageChild( cas2 );
806 str = XmStringCreateLocalized(resource.l_width) ;
807 XtSetArg(args[n], XmNlabelString, str); n++;
808 XtSetArg(args[n], XmNsubMenuId, pull3); n++;
809 cas3 = XmCreateOptionMenu( row2, "Width", args, n );
810 XtManageChild( cas3 );
811 XtAddCallback(XmOptionButtonGadget(cas3), XmNcascadingCallback,
812 (XtCallbackProc)button_set3, NULL);
816 str = XmStringCreateLocalized(resource.l_height) ;
817 XtSetArg(args[n], XmNlabelString, str); n++;
818 XtSetArg(args[n], XmNsubMenuId, pull4); n++;
819 cas4 = XmCreateOptionMenu( row2, "Height", args, n );
820 XtManageChild( cas4 );
821 XtAddCallback(XmOptionButtonGadget(cas4), XmNcascadingCallback,
822 (XtCallbackProc)button_set4, NULL);
828 XtSetArg(args[n], XmNvisibleItemCount, 10) ; n++ ;
829 XtSetArg(args[n], XmNlistSizePolicy, XmCONSTANT) ; n++ ;
830 XtSetArg(args[n], XmNscrollBarDisplayPolicy, XmSTATIC) ; n++ ;
831 XtSetArg(args[n], XmNselectionPolicy, XmSINGLE_SELECT) ; n++ ;
832 XtSetArg(args[n], XmNitems, xlf) ; n++ ;
833 XtSetArg(args[n], XmNitemCount, xlf_count) ; n++ ;
834 scrolllist = XmCreateScrolledList(row, "scrolllist", args, n);
835 XtManageChild(scrolllist);
838 sep = XmCreateSeparator(row, "sep", args, n);
842 row3 = XmCreateRowColumn( row, "row", args, n );
843 XtManageChild( row3 );
846 disp = XtDisplay(row);
847 root = DefaultRootWindow(disp);
849 ReadXpm(disp, root, arrow_pm, &arrow_pix, &mask, &attr);
853 XtSetArg(args[n], XmNorientation, XmHORIZONTAL) ; n++ ;
854 row4 = XmCreateRowColumn( row3, "row", args, n );
855 XtManageChild( row4 );
857 xms = XmStringCreateLocalized(resource.l_copy_src_code);
859 XtSetArg(args[n], XmNlabelString, xms); n++ ;
860 codeLabel[0] = XmCreateLabel(row4 , "copylabel", args, n);
861 XtManageChild(codeLabel[0]);
862 XmStringFree( xms ) ;
865 XtSetArg(args[n], XmNcolumns, 4); n++;
866 XtSetArg(args[n], XmNmaxLength, 4); n++;
867 XtSetArg(args[n], XmNeditable, True); n++;
868 XtSetArg(args[n], XmNcursorPositionVisible, True); n++;
869 focus_widget = codeText[0] = XmCreateText(row4 , "copytext",
871 XtManageChild(codeText[0]);
873 XtAddCallback(codeText[0], XmNfocusCallback, (XtCallbackProc)focus, NULL);
876 XtSetArg(args[n], XmNlabelPixmap, arrow_pix); n++;
877 XtSetArg(args[n], XmNlabelType, XmPIXMAP); n++;
878 XtSetArg(args[n], XmNindicatorOn, False); n++;
879 XtSetArg(args[n], XmNshadowThickness, 2); n++;
880 XtSetArg(args[n], XmNfillOnSelect, False); n++;
881 XtSetArg(args[n], XmNhighlightThickness, 0); n++;
882 arrow = XmCreateToggleButton(row4, "arrow", args, n);
883 XtManageChild(arrow);
886 XtSetArg(args[n], XmNcolumns, 4); n++;
887 XtSetArg(args[n], XmNmaxLength, 4); n++;
888 XtSetArg(args[n], XmNeditable, True); n++;
889 XtSetArg(args[n], XmNcursorPositionVisible, True); n++;
890 codeText[1] = XmCreateText(row4 , "copytext", args, n);
891 XtManageChild(codeText[1]);
892 XtSetSensitive(codeText[1], False);
894 XtAddCallback(codeText[1], XmNfocusCallback, (XtCallbackProc)focus, NULL);
896 XtAddCallback(arrow, XmNvalueChangedCallback,
897 (XtCallbackProc)arrow_change, (XtPointer)codeText[1]);
900 xms = XmStringCreateLocalized(resource.code) ;
901 XtSetArg(args[n], XmNlabelString, xms); n++;
902 XtSetArg(args[n], XmNhighlightThickness, 0); n++;
903 code = XmCreatePushButton(row4, "Code", args, n);
907 XtAddCallback(code, XmNactivateCallback,
908 (XtCallbackProc)code_input, (XtPointer)NULL);
911 XtSetArg(args[n], XmNorientation, XmHORIZONTAL) ; n++ ;
912 row5 = XmCreateRowColumn( row3, "row", args, n );
913 XtManageChild( row5 );
915 xms = XmStringCreateLocalized(resource.l_copy_dest_code);
918 XtSetArg(args[n], XmNlabelString, xms); n++ ;
919 codeLabel[1] = XmCreateLabel(row5 , "copylabel", args, n);
920 XtManageChild(codeLabel[1]);
921 XmStringFree( xms ) ;
924 XtSetArg(args[n], XmNcolumns, 4); n++;
925 XtSetArg(args[n], XmNmaxLength, 4); n++;
926 XtSetArg(args[n], XmNeditable, True); n++;
927 XtSetArg(args[n], XmNcursorPositionVisible, True); n++;
928 codeText[2] = XmCreateText(row5 , "copytext", args, n);
929 XtManageChild(codeText[2]);
932 xms = XmStringCreateLocalized(resource.code) ;
933 XtSetArg(args[n], XmNlabelString, xms); n++;
934 XtSetArg(args[n], XmNhighlightThickness, 0); n++;
935 code = XmCreatePushButton(row5, "Code", args, n);
939 XtAddCallback(code, XmNactivateCallback,
940 (XtCallbackProc)code_input2, (XtPointer)NULL);
942 return( cpyDialog ) ;