Add -fpermissive to allow compilation of old C++ on modern GCC
[oweals/cde.git] / cde / programs / dtudcfonted / mtfgui.c
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
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)
10  * any later version.
11  *
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
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /* mtfgui.c 1.21 - Fujitsu source for CDEnext    96/10/30 13:13:46      */
24 /* $XConsortium: mtfgui.c /main/11 1996/11/08 01:55:01 cde-fuj $ */
25 /*
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
30  */
31
32
33
34 #include <stdio.h>
35 #include <locale.h>
36 #include <X11/Intrinsic.h>
37 #include <Xm/MessageB.h>
38
39 #include "xoakufont.h"
40 #include "util.h"
41
42 void CBeOblB_aEnd();
43 void EHeStaT_list();
44 void CBeScro();
45 void EHeBulB_eMEv();
46 void EHeBulB_eExp();
47 void EHeBulB_dExp();
48 static void EHStaT_disp();
49
50 extern Resource resource;
51
52 extern int efctPtnNum();
53 extern char *char_set();
54
55 extern char *fullpath;
56 extern FalFontData fullFontData;
57
58 extern FalCodeRegion CodeArea[16];
59
60 /********************************************************************
61  structure of widgets
62  ********************************************************************/
63 extern  Widget  toplevel;
64         Widget  editPopW,
65                 wgeScro,
66                 wgeBulB_edit;
67 static  Widget  wgeStaT_form[EDLIST_MAX],
68                 wgeStaT_disp[EDLIST_MAX],
69                 wgeStaT_list[EDLIST_MAX],
70                 wgeBulB_disp;
71
72 /**********************************************************************
73  display windows
74  **********************************************************************/
75
76 /*
77  * contents : displays the "User Defined Charactrer editor" window
78  */
79
80 static Widget CreateEditPtn();
81 void OpenCB();
82 void MngPtnCB();
83 void CpyPtnCB();
84 void CBeRecB_color();
85 void CBeRecB_obj();
86 void CBeOblB_aAdd();
87 void CBeOblB_rCmd();
88 void CBeOblB_rCmdp();
89 void CBeOblB_rCan();
90
91
92 /**
93  **  contents : manage the codes list 
94  ** ===================================================================
95  **/
96
97 static void
98 XlfdCB()
99 {
100   Widget        dialog;
101   Arg           args[5];
102   char          mess[1024];
103   int           n;
104   XmString      cs, cs1, cs2;
105
106   sprintf(mess, "%s : %s", resource.file_name, fullpath);
107   cs = XmStringCreateLocalized(mess);
108   cs1 = XmStringSeparatorCreate();
109   cs2 = XmStringConcat(cs, cs1);
110   XmStringFree(cs);
111   XmStringFree(cs1);
112   sprintf(mess, "%s : %s", resource.xlfd_name, fullFontData.xlfdname);
113   cs1 = XmStringCreateLocalized(mess);
114   cs = XmStringConcat(cs2, cs1);
115   XmStringFree(cs1);
116   XmStringFree(cs2);
117   n = 0;
118   XtSetArg (args[n], XmNtitle, resource.l_xlfd_title); n++;
119   XtSetArg (args[n], XmNmessageString, cs); n++;
120   XtSetArg (args[n], XmNdialogStyle, XmDIALOG_MODELESS); n++;
121   dialog = XmCreateInformationDialog (toplevel, "Xlfd_name", args, n);
122   XtUnmanageChild (XmMessageBoxGetChild(dialog, XmDIALOG_CANCEL_BUTTON));
123   XtUnmanageChild (XmMessageBoxGetChild(dialog, XmDIALOG_HELP_BUTTON));
124   XtManageChild (dialog);
125   XmStringFree(cs);
126 }
127
128 static void
129 CodeAreaCB()
130 {
131     char        mess[256];
132     char        tmp[16];
133     Widget      dialog;
134     Arg         args[5];
135     int         n;
136     XmString    cs;
137
138     sprintf(mess, "%s : ", resource.codearea);
139     switch (fullFontData.cd_set) {
140         case FAL_FONT_CS0:
141             strcat(mess, "CS0:");
142             break;
143         case FAL_FONT_CS1:
144             strcat(mess, "CS1:");
145             break;
146         case FAL_FONT_CS2:
147             strcat(mess, "CS2:");
148             break;
149         case FAL_FONT_CS3:
150             strcat(mess, "CS3:");
151             break;
152     }
153
154     for (n=0; CodeArea[n].start != -1; n++) {
155         sprintf(tmp, " %X - %X ", CodeArea[n].start, CodeArea[n].end);
156         strcat(mess, tmp);
157     }
158     cs = XmStringCreateLocalized(mess);
159     n = 0;
160     XtSetArg (args[n], XmNtitle, resource.l_codearea_title); n++;
161     XtSetArg (args[n], XmNmessageString, cs); n++;
162     XtSetArg (args[n], XmNdialogStyle, XmDIALOG_MODELESS); n++;
163     XtSetArg (args[n], XmNdefaultButtonType, XmDIALOG_CANCEL_BUTTON); n++;
164     dialog = XmCreateInformationDialog (toplevel, "UDCarea", args, n);
165     XtUnmanageChild (XmMessageBoxGetChild(dialog, XmDIALOG_CANCEL_BUTTON));
166     XtUnmanageChild (XmMessageBoxGetChild(dialog, XmDIALOG_HELP_BUTTON));
167     XtManageChild (dialog);
168     XmStringFree(cs);
169 }
170
171 void
172 ListSetLabelStr(i, str)
173 int i;
174 String str;
175 {
176     SetLabelString( wgeStaT_list[i], str );
177 }
178
179 void
180 ListSelectItem(i)
181 int i;
182 {
183     XtVaSetValues( wgeStaT_list[i],
184         XmNbackground, (XtArgVal) resource.foreground,
185         XmNforeground, (XtArgVal) resource.background,
186         0);
187     xl.list_winID = XtWindow( wgeStaT_disp[i] ) ;
188 }
189
190 void
191 ListUnselectItem(i)
192 int i;
193 {
194     XtVaSetValues( wgeStaT_list[i],
195         XmNbackground, (XtArgVal) resource.background,
196         XmNforeground, (XtArgVal) resource.foreground,
197         0);
198     xl.list_winID = NULL ;
199 }
200
201 void
202 ListSetGlyphImage( i )
203 int     i ;
204 {
205         int     code ;
206
207         dl_glyph[i].disp_winID = XtWindow(wgeStaT_disp[i]);
208         code = noToCode(ptnSqToNo(sq_disp[i]));
209         if (codeCheck(code)) {
210                 XClearWindow(xl.display, dl_glyph[i].disp_winID);
211                 return;
212         }
213         if (code == edg.code && xl.dispImage != NULL) {
214                 XPutImage(xl.display, dl_glyph[i].disp_winID, xl.borderGC,
215                                 xl.dispImage, 0,0,0,0, edg.width, edg.height );
216         } else {
217                 if (dl_glyph[i].dispImage)
218                     XFree((char *)dl_glyph[i].dispImage);
219                 if (ptnGet(code, dl_glyph[i].ptn))
220                     return ;
221                 dl_glyph[i].dispImage  = XCreateImage( xl.display,
222                     DefaultVisual(xl.display, DefaultScreen(xl.display)), 1,
223                     XYBitmap, 0, dl_glyph[i].ptn, edg.width, edg.height, 8, 0);
224                 dl_glyph[i].dispImage->bitmap_bit_order = MSBFirst;
225                 dl_glyph[i].dispImage->byte_order       = MSBFirst;
226
227                 XPutImage(xl.display, dl_glyph[i].disp_winID, xl.borderGC,
228                         dl_glyph[i].dispImage, 0,0,0,0, edg.width, edg.height);
229         }
230 }
231
232 /*ARGSUSED*/
233 static void
234 EHStaT_disp( widget, i )
235 Widget          widget;
236 int             i;                      /* widget that have some ivent */
237 {
238     ListSetGlyphImage( i );
239 }
240
241 /**
242  **  contents : create the icon
243  ** ===================================================================
244  **/
245
246
247 /**
248  **  contents : set callback functions for UDC editor window 
249  ** ===================================================================
250  **/
251
252 static void _create_editptn_after();
253
254 static Widget FooterMessage;
255 static Widget codeLabel;
256
257 static menuButtonItems menu_btn[] = {
258     MENUBTNARGS( 'F' ),
259     MENUBTNARGS( 'E' ),
260     MENUBTNARGS( 'C' ),
261     MENUBTNARGS( 'I' ),
262 };
263 static MButton MenuBTN = MBUTTONS( menu_btn );
264
265 static ButtonItems file_btn[] = {
266     BTNARGS( OpenCB, NULL, 'O', True, False),
267     BTNARGS( CBeOblB_aAdd,   NULL, 'S', True, False),
268     BTNARGS( NULL,           NULL, NULL, NULL, NULL),
269     BTNARGS( CBeOblB_aEnd,   NULL, 'E', True, False),
270 };
271 static Button FileBTN = BUTTONS( file_btn );
272
273 static ButtonItems edit_btn[] = {
274     BTNARGS( CBeOblB_rCmd, PROC_CLS,  'C', True, False),
275     BTNARGS( CBeOblB_rCmd, PROC_SET,  'S', True, False),
276     BTNARGS( CBeOblB_rCmd, PROC_REV,  'R', True, False),
277     BTNARGS( CBeOblB_rCmdp, PROC_CUT,  'U', True, False),
278     BTNARGS( CBeOblB_rCmdp, PROC_CPY,  'O', True, False),
279     BTNARGS( CBeOblB_rCmdp, PROC_PASTE,'P', True, False),
280     BTNARGS( CBeOblB_rCmd, PROC_ROLL, 'A', True, False),
281     BTNARGS( CBeOblB_rCmd, PROC_SYMV, 'V', True, False),
282     BTNARGS( CBeOblB_rCmd, PROC_SYMH, 'H', True, False),
283     BTNARGS( CBeOblB_rCan, NULL,      'N', True, False),
284 };
285 static Button EditBTN = BUTTONS( edit_btn );
286
287 static ButtonItems char_btn[] = {
288     BTNARGS( MngPtnCB, NULL, 'A', True, False ),
289     BTNARGS( CpyPtnCB, NULL, 'C', True, False ),
290 };
291 static Button CharBTN = BUTTONS( char_btn );
292
293 static ButtonItems info_btn[] = {
294     BTNARGS( XlfdCB, NULL, 'X', True, False ),
295     BTNARGS( CodeAreaCB, NULL, 'C', True, False ),
296 };
297 static Button InfoBTN = BUTTONS( info_btn );
298
299 static ExclusiveItems draw_ex[] = {
300     EXARGS( PROC_POINT,  "pencil",    True, CBeRecB_obj, True  ),
301     EXARGS( PROC_LINE,   "line",      True, CBeRecB_obj, False ),
302     EXARGS( PROC_RECT,   "rectangle", True, CBeRecB_obj, False ),
303     EXARGS( PROC_CIRCLE, "circle",    True, CBeRecB_obj, False ),
304     EXARGS( PROC_ERASE,  "erase",     True, CBeRecB_obj, False ),
305     EXARGS( PROC_SELECT, "select",    True, CBeRecB_obj, False ),
306 };
307 static Exclusive DrawEX = EXCLUSIVE( draw_ex );
308
309 static void
310 Unset()
311 {
312     XtSetSensitive(EditBTN.w[0], False);
313     XtSetSensitive(EditBTN.w[1], False);
314     XtSetSensitive(EditBTN.w[2], False);
315     XtSetSensitive(EditBTN.w[3], False);
316     XtSetSensitive(EditBTN.w[4], False);
317     XtSetSensitive(EditBTN.w[5], False);
318     XtSetSensitive(EditBTN.w[6], False);
319     XtSetSensitive(EditBTN.w[7], False);
320     XtSetSensitive(EditBTN.w[8], False);
321     XtSetSensitive(EditBTN.w[9], False);
322 }
323
324 void
325 SelectSet()
326 {
327     XtSetSensitive(EditBTN.w[0], True);
328     XtSetSensitive(EditBTN.w[1], True);
329     XtSetSensitive(EditBTN.w[2], True);
330     XtSetSensitive(EditBTN.w[3], True);
331     XtSetSensitive(EditBTN.w[4], True);
332     XtSetSensitive(EditBTN.w[6], True);
333     XtSetSensitive(EditBTN.w[7], True);
334     XtSetSensitive(EditBTN.w[8], True);
335 }
336
337 void
338 SelectUnset()
339 {
340     XtSetSensitive(EditBTN.w[0], False);
341     XtSetSensitive(EditBTN.w[1], False);
342     XtSetSensitive(EditBTN.w[2], False);
343     XtSetSensitive(EditBTN.w[3], False);
344     XtSetSensitive(EditBTN.w[4], False);
345     XtSetSensitive(EditBTN.w[6], False);
346     XtSetSensitive(EditBTN.w[7], False);
347     XtSetSensitive(EditBTN.w[8], False);
348 }
349
350 void
351 CopySet()
352 {
353     XtSetSensitive(EditBTN.w[5], True);
354 }
355
356 void
357 UndoSet()
358 {
359     XtSetSensitive(EditBTN.w[9], True);
360 }
361
362 void
363 UndoUnset()
364 {
365     XtSetSensitive(EditBTN.w[9], False);
366 }
367
368 /**
369  **  contents : create the UDC editor window 
370  ** --------------------------------
371  **/
372
373 void
374 PopupEditPtn(owner)
375 Widget owner;
376 {
377     if (! editPtnW){
378         editPtnW = CreateEditPtn(owner);
379         _create_editptn_after();
380     }
381     XtPopup(editPtnW, XtGrabNone);
382 }
383
384 static Widget
385 CreateEditPtn(owner)
386 Widget owner;
387 {
388     int         slimax;
389     int         i;
390     Widget      baseForm, pop, font_menu, edit_menu, char_menu, info_menu;
391     Widget      listBase, listFrame, rc, editFrame, figure_w;
392     Widget      imageFrame, imageForm, editPane, image;
393     extern Widget CreateFrame();
394     extern Widget CreatePixButton();
395
396     Arg arg[1];
397
398
399     SetItemLabel(&MenuBTN, 0, resource.l_font);
400     SetItemLabel(&MenuBTN, 1, resource.l_edit);
401     SetItemLabel(&MenuBTN, 2, resource.l_manage);
402     SetItemLabel(&MenuBTN, 3, resource.l_info);
403     baseForm = (Widget)
404     CreateMenuBarAndFooterMessageForm( owner, "dtudcfonted",
405         &MenuBTN, XtNumber(menu_btn), &pop, &FooterMessage );
406
407     editPopW = pop;
408
409     AddDeleteProc(pop, CBeOblB_aEnd);
410
411     font_menu = GetMenuWidget( &MenuBTN, 0 );
412     edit_menu = GetMenuWidget( &MenuBTN, 1 );
413     char_menu = GetMenuWidget( &MenuBTN, 2 );
414     info_menu = GetMenuWidget( &MenuBTN, 3 );
415
416     SetItemLabel(&FileBTN, 0, resource.l_open_w);
417     SetItemLabel(&FileBTN, 1, resource.l_save);
418     SetItemLabel(&FileBTN, 3, resource.l_exit);
419
420     SetItemLabel(&EditBTN, 0, resource.l_clear);
421     SetItemLabel(&EditBTN, 1, resource.l_set);
422     SetItemLabel(&EditBTN, 2, resource.l_reverse);
423     SetItemLabel(&EditBTN, 3, resource.l_cut);
424     SetItemLabel(&EditBTN, 4, resource.l_Copy);
425     SetItemLabel(&EditBTN, 5, resource.l_paste);
426     SetItemLabel(&EditBTN, 6, resource.l_roll);
427     SetItemLabel(&EditBTN, 7, resource.l_updown_roll);
428     SetItemLabel(&EditBTN, 8, resource.l_leftright_roll);
429     SetItemLabel(&EditBTN, 9, resource.l_undo);
430
431     SetItemLabel(&CharBTN, 0, resource.l_manage_w);
432     SetItemLabel(&CharBTN, 1, resource.l_copy_w);
433
434     SetItemLabel(&InfoBTN, 0, resource.l_xlfd);
435     SetItemLabel(&InfoBTN, 1, resource.l_codearea);
436
437     CreateMenuButtons( font_menu, &FileBTN, XtNumber(file_btn));
438     CreateMenuButtons( edit_menu, &EditBTN, XtNumber(edit_btn));
439     Unset();
440     CreateMenuButtons( char_menu, &CharBTN, XtNumber(char_btn));
441     CreateMenuButtons( info_menu, &InfoBTN, XtNumber(info_btn));
442
443     /* create "Character list" */
444
445     listFrame =
446     CreateFrame( baseForm, "listFrame", XmSHADOW_IN, 2);
447     AddTopAttachForm(listFrame, resource.ed_wge_topoff);
448     AddLeftAttachForm(listFrame, resource.ed_wge_lftoff);
449     AddBottomAttachForm(listFrame, resource.ed_wge_btmoff);
450
451     listBase =
452     CreateRowColumn( listFrame, "listFrame", L_VERTICAL, 4, 2, 2);
453
454     for( i=0  ;  i < edlist.nlist  ;  i++ ) {
455         wgeStaT_form[i] = CreateForm( listBase, "listform" );
456         wgeStaT_list[i] =
457         CreateLabel( wgeStaT_form[i], "label",  "0000" );
458         wgeStaT_disp[i] = CreateDrawingArea( wgeStaT_form[i], "image",
459                         edg.width, edg.height, EHStaT_disp, i ) ;
460         AddLeftAttachWidget( wgeStaT_disp[i], wgeStaT_list[i], 0 ) ;
461         XtAddEventHandler( wgeStaT_list[i],
462                 ButtonPressMask|ButtonReleaseMask,
463                 False, EHeStaT_list, (XtPointer)i );
464         XtAddEventHandler( wgeStaT_disp[i],
465                 ButtonPressMask|ButtonReleaseMask,
466                 False, EHeStaT_list, (XtPointer)i );
467
468         if (i==0){
469             XtVaGetValues(wgeStaT_disp[i],
470                 XmNheight,      &(edlist.elem_h),
471                 XmNwidth,       &(edlist.elem_w), NULL);
472
473             edlist.back = resource.pane_background;
474             edlist.border = resource.pane_foreground;
475
476             dn.elem_h = edlist.elem_h;
477             dn.elem_w = edlist.elem_w;
478
479             /*
480             */
481             edpane.pix_w  = edpane.width / edg.width;
482             edpane.pix_h  = edpane.height / edg.height;
483             if(edpane.pix_w > edpane.pix_h)
484                 edpane.pix_w = edpane.pix_h;
485             else
486                 edpane.pix_h = edpane.pix_w;
487             /* */
488             edpane.pix_w  = ( edpane.pix_w < 8 ) ? 8 : edpane.pix_w;
489             edpane.pix_h  = ( edpane.pix_h < 8 ) ? 8 : edpane.pix_h;
490             /* 
491             */
492             edpane.width  = edpane.pix_w * edg.width  - 1;
493             edpane.height = edpane.pix_h * edg.height - 1;
494
495             edlist.nlist = (edpane.height +2)/(int)(edlist.elem_h +8);
496             edlist.nlist =
497                 (edlist.nlist<EDLIST_MAX)?edlist.nlist:EDLIST_MAX;
498         }
499     }
500
501     XtManageChildren( wgeStaT_form, edlist.nlist );
502     for( i=0  ;  i < edlist.nlist  ;  i++ ) {
503         XtManageChild( wgeStaT_list[i] );
504         XtManageChild( wgeStaT_disp[i] );       
505     }
506
507     /* create the scroll bar for Charcter list */
508     XtVaGetValues( listBase, XmNheight, &(edlist.list_h), 0);
509
510     if (( slimax = efctPtnNum()) < edlist.nlist)  
511         slimax = edlist.nlist;
512     wgeScro = CreateScrollBar( baseForm, "scrollBar", (edpane.height+2),
513                                 edlist.nlist, 0, slimax, CBeScro);
514     AddLeftAttachWidget( wgeScro, listFrame, 4 );
515     AddTopAttachForm( wgeScro, resource.ed_wge_topoff );
516     AddBottomAttachForm( wgeScro, resource.ed_wge_btmoff );
517
518     rc =
519     CreateForm( baseForm, "rc" );
520     AddTopAttachForm( rc, resource.ed_wge_topoff );
521     AddRightAttachForm( rc, resource.ed_wge_rghoff );
522     AddBottomAttachForm( rc, resource.ed_wge_btmoff );
523
524     editFrame =
525     CreateFrame( baseForm, "editFrame", XmSHADOW_IN, 2);
526     AddTopAttachForm(editFrame, resource.ed_wge_topoff);
527     AddLeftAttachWidget(editFrame, wgeScro, 4);
528     AddRightAttachWidget(editFrame, rc, 10);
529
530     figure_w =
531     CreatePixButton(rc, "Draw", &DrawEX);
532     AddTopAttachForm(figure_w, 0);
533     AddLeftAttachForm(figure_w, 0);
534     AddRightAttachForm(figure_w, 0);
535
536     imageFrame =
537     CreateCaptionFrame( rc, "Frame", "  ", XmSHADOW_IN, 1);
538     AddTopAttachWidget(XtParent(imageFrame), figure_w, 4);
539     AddLeftAttachForm(XtParent(imageFrame), 0);
540     AddRightAttachForm(XtParent(imageFrame), 0);
541     AddBottomAttachForm(XtParent(imageFrame), 0);
542
543     imageForm =
544     CreateForm( imageFrame, "separator" );
545
546     /* create the Editing pane */
547     wgeBulB_edit = editPane =
548     CreateDrawingArea( editFrame, "editPane",
549                         edpane.width, edpane.height, EHeBulB_eExp, 0);
550
551     XtAddEventHandler( editPane,
552               ButtonPressMask | ButtonMotionMask | ButtonReleaseMask,
553               False, EHeBulB_eMEv, NULL );
554     AddTopAttachForm( editPane, 2 );
555     AddLeftAttachForm( editPane, 2 );
556
557     /* create character image */
558     codeLabel = CreateLabel( imageForm, "codeLabel", "0000" );
559     AddTopAttachForm( codeLabel, 3 );
560     AddLeftAttachForm( codeLabel, 3 );
561
562     wgeBulB_disp = image = CreateDrawingArea( imageForm, "image", edg.width,
563                                         edg.height, EHeBulB_dExp, 0);
564     AddTopAttachWidget( image, codeLabel, 3 );
565     AddLeftAttachForm( image, 6 );
566
567     XtRealizeWidget( editPopW );
568
569     return(editPopW);
570 }
571
572
573
574
575 void
576 SetCodeString(code)
577 int code;
578 {
579     char str[8];
580
581     if (! code){
582         str[0] = NULL;
583     }
584     else{
585         sprintf( str, "%4x:", code );
586     }
587     SetLabelString(codeLabel, str);
588 }
589
590
591
592 static void
593 _create_editptn_after()
594 {
595     int         slctloc; 
596     static char dashPtn[] = {1,1};      /* Editing pane's border pattern */
597     extern void chgEdList();
598
599
600     /*
601      *  set X-library interface 
602      */
603     xl.display    = XtDisplayOfObject( editPopW );
604     xl.root_winID = RootWindow( xl.display, DefaultScreen(xl.display) );
605     xl.edit_winID = XtWindow( wgeBulB_edit );
606     xl.disp_winID = XtWindow( wgeBulB_disp );    
607     xl.list_winID = XtWindow( wgeStaT_disp[0] );
608
609     /*
610      *  Graphic Context ( Pixel clear ) 
611      */
612     xl.backGC     = XCreateGC( xl.display, xl.root_winID, 0, 0 );
613     XSetForeground( xl.display, xl.backGC, edpane.back );
614     XSetBackground( xl.display, xl.backGC, edpane.border );
615
616     /*
617      *  Graphic Context ( Pixel set ) 
618      */
619     xl.borderGC   = XCreateGC( xl.display, xl.root_winID, 0, 0 );
620     XSetForeground( xl.display, xl.borderGC, edpane.border );
621     XSetBackground( xl.display, xl.borderGC, edpane.back );
622
623     /*
624      *  Graphic Context ( rubber band ) 
625      */
626     xl.rubGC      = XCreateGC( xl.display, xl.root_winID, 0, 0 );
627     XSetForeground(xl.display, xl.rubGC, edpane.border ^ edpane.back);
628
629     XSetFunction  ( xl.display, xl.rubGC, GXxor );
630
631     /*
632      *  Graphc Context ( lattice of Editing pane ) 
633      */
634     xl.dashGC     = XCreateGC( xl.display, xl.root_winID, 0, 0 );
635     XSetForeground( xl.display, xl.dashGC, edpane.border );
636     XSetBackground( xl.display, xl.dashGC, edpane.back );
637
638     XSetLineAttributes( xl.display, xl.dashGC, 0,
639                         LineDoubleDash, CapButt, JoinMiter );
640     XSetDashes    ( xl.display, xl.dashGC, 0, dashPtn, 2 );
641
642     /*
643      *  display Editing pane 
644      */
645     xl.dispImage  = XCreateImage( xl.display,
646         DefaultVisual( xl.display, DefaultScreen(xl.display) ),
647         1, XYBitmap, 0, edg.ptn, edg.width, edg.height, 8, 0    );
648     xl.dispImage->bitmap_bit_order = MSBFirst;
649     xl.dispImage->byte_order       = MSBFirst;
650                     
651     /*
652      *  initialize 
653      */
654     edpane.color = ON;
655     edpane.obj   = PROC_POINT;
656     em.proc      = PROC_POINT;
657
658     if(efctPtnNum() > 0){
659         slctloc = 0;
660         SetCodeString(edg.code);
661     }
662     else{
663         slctloc = -1;    
664     }
665     chgEdList( 0, slctloc, ON );
666
667 }
668
669 void
670 UpdateMessage(str)
671 String str;
672 {
673     static Boolean nomsg = False;
674
675     if (! str || ! *str){
676         if (nomsg){
677             return;
678         }
679         else{
680             nomsg = True;
681         }
682     }
683     else{
684         nomsg = False;
685     }
686     SetFooterString(FooterMessage, str);
687 }