123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813 |
- /*
- * CDE - Common Desktop Environment
- *
- * Copyright (c) 1993-2012, The Open Group. All rights reserved.
- *
- * These libraries and programs are free software; you can
- * redistribute them and/or modify them under the terms of the GNU
- * Lesser General Public License as published by the Free Software
- * Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * These libraries and programs are distributed in the hope that
- * they will be useful, but WITHOUT ANY WARRANTY; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU Lesser General Public License for more
- * details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with these libraries and programs; if not, write
- * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
- * Floor, Boston, MA 02110-1301 USA
- */
- /* selectx.c 1.23 - Fujitsu source for CDEnext 96/10/30 13:13:45 */
- /* $XConsortium: selectx.c /main/7 1996/11/08 01:54:18 cde-fuj $ */
- /*
- * (c) Copyright 1995 FUJITSU LIMITED
- * This is source code modified by FUJITSU LIMITED under the Joint
- * Development Agreement for the CDEnext PST.
- * This is unpublished proprietary source code of FUJITSU LIMITED
- */
- #include <string.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <Dt/MsgCatP.h>
- #include<X11/Xlib.h>
- #include<X11/Xutil.h>
- #include<X11/Xatom.h>
- #include <Xm/Xm.h>
- #include <Xm/Form.h>
- #include <Xm/PushB.h>
- #include <Xm/Text.h>
- #include <Xm/TextF.h>
- #include <Xm/Label.h>
- #include <Xm/SeparatoG.h>
- #include <Xm/List.h>
- #include <Xm/ToggleB.h>
- #include <Xm/MessageB.h>
- #include <Xm/RowColumn.h>
- #include <Xm/Frame.h>
- #include <Xm/Label.h>
- /*
- * There is no public header file for this function (only an
- * internal header XmStringI.h).
- */
- extern XtPointer _XmStringUngenerate (XmString string,
- XmStringTag tag,
- XmTextType tag_type,
- XmTextType output_type);
- #include "xoakufont.h"
- #include "selectxlfd.h"
- extern Resource resource ;
- /*
- * parameters
- */
- FalFontData fullFontData;
- void PopupSelectXLFD(Widget top) ;
- static Widget CreateSelectXLFD(Widget top) ;
- extern void xlfdPopupDialog(Widget w);
- extern void ReadCB(Widget w, XtPointer client_data, XtPointer call_data);
- Widget xlfdDialog;
- static Widget xlfdWform;
- #define CS0 "Codeset 0"
- #define CS1 "Codeset 1"
- #define CS2 "Codeset 2"
- #define CS3 "Codeset 3"
- #define FAL_ERROR_STR resource.falerrmsg[((fal_utyerrno & 0xff) > 25) ? 0 : (fal_utyerrno & 0xff)]
- static Widget pull1, pull2, pull3, pull4, scrolllist;
- static int xlf_count = 0;
- static XmString *xlf=NULL;
- static int udc_count = 0;
- static Boolean udc_flag = False;
- static int *udc=NULL;
- static int udc_val;
- static int sty_count = 0;
- static Boolean sty_flag = False;
- static char **sty=NULL;
- static char *sty_val=NULL;
- static int wls_count = 0;
- static Boolean wls_flag = False;
- static int *wls=NULL;
- static int wls_val;
- static int hls_count = 0;
- static Boolean hls_flag = False;
- static int *hls=NULL;
- static int hls_val;
- static Widget *button1=NULL;
- static Widget *button2=NULL;
- static Widget *button3=NULL;
- static Widget *button4=NULL;
- /****************************************************************
- * callbacks *
- ***************************************************************/
- static char *
- spc(char *str, char ch, int count)
- {
- char *p;
- p = str + strlen(str);
- for(;count && (str < p);p--) {
- if (*p == ch)
- count --;
- }
- if (! count)
- return(p+1);
- else
- return(NULL);
- }
- static void OpenWindowCB(void)
- {
- char *str, *p;
- XmStringTable st;
- XtVaGetValues(scrolllist, XmNselectedItems, &st, NULL);
- if( st == NULL ){
- fullFontData.xlfdname = NULL;
- return ;
- }
- str = (char *) _XmStringUngenerate(st[0], NULL, XmMULTIBYTE_TEXT, XmMULTIBYTE_TEXT);
- p = spc(str, '-', 4);
- p++;
- if (*p == 'p' || *p == 'P') {
- fullFontData.xlfdname = (char *)-1;
- return ;
- }
- fullFontData.xlfdname = str;
- if(udc_flag == True)
- fullFontData.cd_set = udc_val;
- else
- fullFontData.cd_set = -1;
- }
- /**
- ** contents : "Cancel" button callback
- ** ------------------------
- **
- **
- **/
- /*ARGSUSED*/
- static void
- OpenCancelCB(Widget widget, caddr_t clientData, caddr_t callData)
- {
- extern void ForcePopdownDialog();
- if ( !editPtnW ){
- exit( 0 );
- }
- ForcePopdownDialog(xlfdDialog);
- }
- /*
- * create selection window view
- */
- void
- PopupSelectXLFD(Widget top)
- {
- if( xlfdDialog == NULL ){
- if( (xlfdDialog = CreateSelectXLFD( top )) == NULL ){
- exit( -1 ) ;
- }
- }
- /* pop up select window */
- xlfdPopupDialog( xlfdDialog );
- }
- static void
- create_xlfd(void)
- {
- int mask = FAL_FONT_MASK_DEFINED | FAL_FONT_MASK_UNDEFINED;
- FalFontData key;
- FalFontDataList *fontlist;
- FalFontData *f;
- int i;
- if (udc_flag == True) {
- key.cd_set = udc_val;
- mask |= FAL_FONT_MASK_CODE_SET;
- }
- if (sty_flag == True) {
- key.style.name = sty_val;
- mask |= FAL_FONT_MASK_STYLE_NAME;
- }
- if (wls_flag == True) {
- key.size.w = wls_val;
- mask |= FAL_FONT_MASK_SIZE_W;
- }
- if (hls_flag == True) {
- key.size.h = hls_val;
- mask |= FAL_FONT_MASK_SIZE_H;
- }
- xlf_count = 0;
- if (FalGetFontList(&key, mask, &fontlist) == FAL_ERROR) {
- return;
- }
- if(fontlist->num == 0) {
- FalFreeFontList(fontlist);
- return;
- }
- if (xlf) {
- for (i=0; i < xlf_count; i++) {
- XmStringFree(xlf[i]);
- }
- XtFree((char *)xlf);
- }
- xlf = (XmString *)XtMalloc(sizeof(XmString) * fontlist->num);
- for (i=0, f=fontlist->list; i < fontlist->num; i++, f++) {
- xlf[xlf_count++] = XmStringCreateLocalized(f->xlfdname);
- }
- FalFreeFontList(fontlist);
- }
- static void
- udc_call(Widget w)
- {
- XmString label;
- char *moji;
- XtVaGetValues(w, XmNlabelString, &label, NULL);
- moji = (char *) _XmStringUngenerate(label, NULL, XmMULTIBYTE_TEXT, XmMULTIBYTE_TEXT);
- if(strncmp(moji, "*", 1) == 0) {
- udc_flag = False;
- } else if(strcmp(moji, CS0) == 0) {
- udc_val = FAL_FONT_CS0;
- udc_flag = True;
- } else if(strcmp(moji, CS1) == 0) {
- udc_val = FAL_FONT_CS1;
- udc_flag = True;
- } else if(strcmp(moji, CS2) == 0) {
- udc_val = FAL_FONT_CS2;
- udc_flag = True;
- } else if(strcmp(moji, CS3) == 0) {
- udc_val = FAL_FONT_CS3;
- udc_flag = True;
- } else {
- udc_flag = False;
- }
- XtFree(moji);
- create_xlfd();
- XtVaSetValues(scrolllist, XmNitems, xlf, XmNitemCount, xlf_count, NULL);
- }
- static void
- sty_call(Widget w)
- {
- XmString label;
- char *moji;
- if (sty_val) {
- XtFree(sty_val);
- sty_val = NULL;
- }
- XtVaGetValues(w, XmNlabelString, &label, NULL);
- moji = (char *) _XmStringUngenerate(label, NULL, XmMULTIBYTE_TEXT, XmMULTIBYTE_TEXT);
- if(strncmp(moji, "*", 1) == 0) {
- sty_flag = False;
- }
- else {
- sty_val = XtMalloc(sizeof(char) * (strlen(moji) + 1));
- strcpy(sty_val, moji);
- sty_flag = True;
- }
- XtFree(moji);
- create_xlfd();
- XtVaSetValues(scrolllist, XmNitems, xlf, XmNitemCount, xlf_count, NULL);
- }
- static void
- wls_call(Widget w)
- {
- XmString label;
- char *moji;
- XtVaGetValues(w, XmNlabelString, &label, NULL);
- moji = (char *) _XmStringUngenerate(label, NULL, XmMULTIBYTE_TEXT, XmMULTIBYTE_TEXT);
- if(strncmp(moji, "*", 1) == 0) {
- wls_flag = False;
- }
- else {
- wls_val = atoi(moji);
- wls_flag = True;
- }
- XmStringFree(label);
- XtFree(moji);
- create_xlfd();
- XtVaSetValues(scrolllist, XmNitems, xlf, XmNitemCount, xlf_count, NULL);
- }
- static void
- hls_call(Widget w)
- {
- XmString label;
- char *moji;
- XtVaGetValues(w, XmNlabelString, &label, NULL);
- moji = (char *) _XmStringUngenerate(label, NULL, XmMULTIBYTE_TEXT, XmMULTIBYTE_TEXT);
- if(strncmp(moji, "*", 1) == 0) {
- hls_flag = False;
- }
- else {
- hls_val = atoi(moji);
- hls_flag = True;
- }
- XmStringFree(label);
- XtFree(moji);
- create_xlfd();
- XtVaSetValues(scrolllist, XmNitems, xlf, XmNitemCount, xlf_count, NULL);
- }
- static void
- button_set1(void)
- {
- int i, j;
- int mask = FAL_FONT_MASK_DEFINED | FAL_FONT_MASK_UNDEFINED;
- FalFontData key;
- FalFontDataList *fontlist;
- FalFontData *f;
- Boolean found;
- if (sty_flag == True) {
- key.style.name = sty_val;
- mask |= FAL_FONT_MASK_STYLE_NAME;
- }
- if (wls_flag == True) {
- key.size.w = wls_val;
- mask |= FAL_FONT_MASK_SIZE_W;
- }
- if (hls_flag == True) {
- key.size.h = hls_val;
- mask |= FAL_FONT_MASK_SIZE_H;
- }
- if (FalGetFontList(&key, mask, &fontlist) == FAL_ERROR) {
- for (j=0; j<udc_count; j++)
- XtSetSensitive(button1[j], False);
- return;
- }
- if(fontlist->num == 0) {
- for (j=0; j<udc_count; j++)
- XtSetSensitive(button1[j], False);
- FalFreeFontList(fontlist);
- return;
- }
- for (j=0; j<udc_count; j++) {
- for (i=0, f=fontlist->list, found=False; i < fontlist->num; i++, f++) {
- if(udc[j] == f->cd_set) {
- found = True;
- break;
- }
- }
- if(found == False)
- XtSetSensitive(button1[j], False);
- else
- XtSetSensitive(button1[j], True);
- }
- FalFreeFontList(fontlist);
- }
- static void
- button_set2(void)
- {
- int i, j;
- int mask = FAL_FONT_MASK_DEFINED | FAL_FONT_MASK_UNDEFINED;
- FalFontData key;
- FalFontDataList *fontlist;
- FalFontData *f;
- Boolean found;
- if (udc_flag == True) {
- key.cd_set = udc_val;
- mask |= FAL_FONT_MASK_CODE_SET;
- }
- if (wls_flag == True) {
- key.size.w = wls_val;
- mask |= FAL_FONT_MASK_SIZE_W;
- }
- if (hls_flag == True) {
- key.size.h = hls_val;
- mask |= FAL_FONT_MASK_SIZE_H;
- }
- if (FalGetFontList(&key, mask, &fontlist) == FAL_ERROR) {
- for (j=0; j<sty_count; j++)
- XtSetSensitive(button2[j], False);
- return;
- }
- if(fontlist->num == 0) {
- for (j=0; j<sty_count; j++)
- XtSetSensitive(button2[j], False);
- FalFreeFontList(fontlist);
- return;
- }
- for (j=0; j<sty_count; j++) {
- for (i=0, f=fontlist->list, found=False; i < fontlist->num; i++, f++) {
- if(strcmp(sty[j], f->style.name) == 0) {
- found = True;
- break;
- }
- }
- if(found == False)
- XtSetSensitive(button2[j], False);
- else
- XtSetSensitive(button2[j], True);
- }
- FalFreeFontList(fontlist);
- }
- static void
- button_set3(void)
- {
- int i, j;
- int mask = FAL_FONT_MASK_DEFINED | FAL_FONT_MASK_UNDEFINED;
- FalFontData key;
- FalFontDataList *fontlist;
- FalFontData *f;
- Boolean found;
- if (udc_flag == True) {
- key.cd_set = udc_val;
- mask |= FAL_FONT_MASK_CODE_SET;
- }
- if (sty_flag == True) {
- key.style.name = sty_val;
- mask |= FAL_FONT_MASK_STYLE_NAME;
- }
- if (hls_flag == True) {
- key.size.h = hls_val;
- mask |= FAL_FONT_MASK_SIZE_H;
- }
- if (FalGetFontList(&key, mask, &fontlist) == FAL_ERROR) {
- for (j=0; j<wls_count; j++)
- XtSetSensitive(button3[j], False);
- return;
- }
- if(fontlist->num == 0) {
- for (j=0; j<wls_count; j++)
- XtSetSensitive(button3[j], False);
- FalFreeFontList(fontlist);
- return;
- }
- for (j=0; j<wls_count; j++) {
- for (i=0, f=fontlist->list, found=False; i < fontlist->num; i++, f++) {
- if(wls[j] == f->size.w) {
- found = True;
- break;
- }
- }
- if(found == False)
- XtSetSensitive(button3[j], False);
- else
- XtSetSensitive(button3[j], True);
- }
- FalFreeFontList(fontlist);
- }
- static void
- button_set4(void)
- {
- int i, j;
- int mask = FAL_FONT_MASK_DEFINED | FAL_FONT_MASK_UNDEFINED;
- FalFontData key;
- FalFontDataList *fontlist;
- FalFontData *f;
- Boolean found;
- if (udc_flag == True) {
- key.cd_set = udc_val;
- mask |= FAL_FONT_MASK_CODE_SET;
- }
- if (sty_flag == True) {
- key.style.name = sty_val;
- mask |= FAL_FONT_MASK_STYLE_NAME;
- }
- if (wls_flag == True) {
- key.size.w = wls_val;
- mask |= FAL_FONT_MASK_SIZE_W;
- }
- if (FalGetFontList(&key, mask, &fontlist) == FAL_ERROR) {
- for (j=0; j<hls_count; j++)
- XtSetSensitive(button4[j], False);
- return;
- }
- if(fontlist->num == 0) {
- for (j=0; j<hls_count; j++)
- XtSetSensitive(button4[j], False);
- FalFreeFontList(fontlist);
- return;
- }
- for (j=0; j<hls_count; j++) {
- for (i=0, f=fontlist->list, found=False; i < fontlist->num; i++, f++) {
- if(hls[j] == f->size.h) {
- found = True;
- break;
- }
- }
- if (found == False)
- XtSetSensitive(button4[j], False);
- else
- XtSetSensitive(button4[j], True);
- }
- FalFreeFontList(fontlist);
- }
- void
- data_sort(int *data, int count)
- {
- int *p1, *p2, tmp, i;
- for (; count; count--) {
- for (i=1, p1=data, p2=data+1; i < count; i++, p1++, p2++) {
- if( *p1 > *p2) {
- tmp = *p2;
- *p2 = *p1;
- *p1 = tmp;
- }
- }
- }
- }
- static void
- font_init(void)
- {
- FalFontDataList *fontlist;
- FalFontData *f;
- Boolean found;
- int i, j;
- char tmp[16];
- char err[128];
- Widget button;
- extern void Error_message();
- xlf_count = udc_count = sty_count = wls_count = hls_count = 0;
- if (FalGetFontList(NULL, FAL_FONT_MASK_DEFINED |
- FAL_FONT_MASK_UNDEFINED, &fontlist) == FAL_ERROR) {
- strcpy(err, FAL_ERROR_STR);
- Error_message((Widget)NULL, err);
- return;
- }
- if(fontlist->num == 0) {
- FalFreeFontList(fontlist);
- strcpy(err, resource.mn_no_font);
- Error_message((Widget)NULL, err);
- return;
- }
- udc = (int *)XtMalloc(sizeof(int) * fontlist->num);
- sty = (char **)XtMalloc(sizeof(char *) * fontlist->num);
- wls = (int *)XtMalloc(sizeof(int) * fontlist->num);
- hls = (int *)XtMalloc(sizeof(int) * fontlist->num);
- for (i=0, f=fontlist->list; i < fontlist->num; i++, f++) {
- for (j=0,found=False; j<udc_count; j++) {
- if(udc[j] == f->cd_set) {
- found=True;
- break;
- }
- }
- if (found == False) {
- udc[udc_count++] = f->cd_set;
- }
- for (j=0,found=False; j<sty_count; j++) {
- if(strcmp(sty[j], f->style.name) == 0) {
- found=True;
- break;
- }
- }
- if (found == False) {
- sty[sty_count] = XtMalloc(sizeof(char) * (strlen(f->style.name) + 1));
- strcpy(sty[sty_count++], f->style.name);
- }
- if (f->size.w != -1) {
- for (j=0,found=False; j<wls_count; j++) {
- if(wls[j] == f->size.w) {
- found=True;
- break;
- }
- }
- if (found == False) {
- wls[wls_count++] = f->size.w;
- }
- }
- for (j=0,found=False; j<hls_count; j++) {
- if(hls[j] == f->size.h) {
- found=True;
- break;
- }
- }
- if (found == False) {
- hls[hls_count++] = f->size.h;
- }
- }
- FalFreeFontList(fontlist);
- data_sort(udc, udc_count);
- data_sort(wls, wls_count);
- data_sort(hls, hls_count);
- button1 = (Widget *) XtMalloc(sizeof(Widget) * udc_count);
- button2 = (Widget *) XtMalloc(sizeof(Widget) * sty_count);
- button3 = (Widget *) XtMalloc(sizeof(Widget) * wls_count);
- button4 = (Widget *) XtMalloc(sizeof(Widget) * hls_count);
- button = XmCreatePushButton(pull1, "*", NULL, 0);
- XtManageChild(button);
- XtAddCallback(button, XmNactivateCallback,
- (XtCallbackProc)udc_call, NULL);
- for (i=0; i < udc_count; i++) {
- if(udc[i] == FAL_FONT_CS0)
- sprintf(tmp, CS0);
- else if(udc[i] == FAL_FONT_CS1)
- sprintf(tmp, CS1);
- else if(udc[i] == FAL_FONT_CS2)
- sprintf(tmp, CS2);
- else if(udc[i] == FAL_FONT_CS3)
- sprintf(tmp, CS3);
- else
- sprintf(tmp, "Codeset %x?", udc[i]);
- button1[i] = XmCreatePushButton(pull1, tmp, NULL, 0);
- XtManageChild(button1[i]);
- XtAddCallback(button1[i], XmNactivateCallback,
- (XtCallbackProc)udc_call, NULL);
- }
- button = XmCreatePushButton(pull2, "*", NULL, 0);
- XtManageChild(button);
- XtAddCallback(button, XmNactivateCallback,
- (XtCallbackProc)sty_call, NULL);
- for (i=0; i < sty_count; i++) {
- button2[i] = XmCreatePushButton(pull2, sty[i], NULL, 0);
- XtManageChild(button2[i]);
- XtAddCallback(button2[i], XmNactivateCallback,
- (XtCallbackProc)sty_call, NULL);
- }
- button = XmCreatePushButton(pull3, "*", NULL, 0);
- XtManageChild(button);
- XtAddCallback(button, XmNactivateCallback,
- (XtCallbackProc)wls_call, NULL);
- for (i=0; i < wls_count; i++) {
- sprintf(tmp, "%d", wls[i]);
- button3[i] = XmCreatePushButton(pull3, tmp, NULL, 0);
- XtManageChild(button3[i]);
- XtAddCallback(button3[i], XmNactivateCallback,
- (XtCallbackProc)wls_call, NULL);
- }
- button = XmCreatePushButton(pull4, "*", NULL, 0);
- XtManageChild(button);
- XtAddCallback(button, XmNactivateCallback,
- (XtCallbackProc)hls_call, NULL);
- for (i=0; i < hls_count; i++) {
- sprintf(tmp, "%d", hls[i]);
- button4[i] = XmCreatePushButton(pull4, tmp, NULL, 0);
- XtManageChild(button4[i]);
- XtAddCallback(button4[i], XmNactivateCallback,
- (XtCallbackProc)hls_call, NULL);
- }
- }
- static Widget
- CreateSelectXLFD(Widget top)
- {
- int n;
- Arg args[16];
- XmString xms, xms1 ;
- Widget editW ;
- Widget frame, row1, label1, row2, cas1, cas2, cas3, cas4;
- XmString str;
- udc_flag = sty_flag = wls_flag = hls_flag = False;
- /*
- * create base window
- */
- n = 0 ;
- XtSetArg( args[n], XmNautoUnmanage, False ) ; n++ ;
- XtSetArg( args[n], XmNnoResize, True ) ; n++ ;
- XtSetArg( args[n], XmNminimizeButtons, True ) ; n++ ;
- xms = XmStringCreateLocalized( resource.exec_label ) ;
- XtSetArg( args[n], XmNokLabelString, xms ) ; n++ ;
- xms1 = XmStringCreateLocalized( resource.quit_label) ;
- XtSetArg( args[n], XmNhelpLabelString, xms1 ) ; n++ ;
- XtSetArg( args[n], XmNtitle, resource.l_open_title ) ; n++ ;
- editW = XmCreateTemplateDialog( top, "open_dialog", args, n );
- XmStringFree( xms ) ;
- XmStringFree( xms1 ) ;
- n = 0;
- pull1 = XmCreatePulldownMenu(toplevel, "pull", args, n);
- pull2 = XmCreatePulldownMenu(toplevel, "pull", args, n);
- pull3 = XmCreatePulldownMenu(toplevel, "pull", args, n);
- pull4 = XmCreatePulldownMenu(toplevel, "pull", args, n);
- n = 0 ;
- xlfdWform = XmCreateRowColumn( editW, "BaseForm", args, n );
- XtManageChild( xlfdWform );
- n = 0;
- frame = XmCreateFrame( xlfdWform, "frame", args, n);
- XtManageChild( frame );
- n = 0 ;
- row1 = XmCreateRowColumn( frame, "row", args, n );
- XtManageChild( row1 );
- n = 0;
- str = XmStringCreateLocalized(resource.l_selectitem) ;
- XtSetArg(args[n], XmNlabelString, str); n++;
- label1 = XmCreateLabel( row1, "SelectItems", args, n);
- XtManageChild( label1 );
- XmStringFree(str);
- n = 0 ;
- row2 = XmCreateRowColumn( row1, "row", args, n );
- XtManageChild( row2 );
- n = 0 ;
- str = XmStringCreateLocalized(resource.l_codeset) ;
- XtSetArg(args[n], XmNlabelString, str); n++;
- XtSetArg(args[n], XmNsubMenuId, pull1); n++;
- cas1 = XmCreateOptionMenu( row2, "CodeSet", args, n );
- XtManageChild( cas1 );
- XtAddCallback(XmOptionButtonGadget(cas1), XmNcascadingCallback,
- (XtCallbackProc)button_set1, NULL);
- XmStringFree(str);
- n = 0 ;
- str = XmStringCreateLocalized(resource.l_style) ;
- XtSetArg(args[n], XmNlabelString, str); n++;
- XtSetArg(args[n], XmNsubMenuId, pull2); n++;
- cas2 = XmCreateOptionMenu( row2, "Style", args, n );
- XtAddCallback(XmOptionButtonGadget(cas2), XmNcascadingCallback,
- (XtCallbackProc)button_set2, NULL);
- XtManageChild( cas2 );
- XmStringFree(str);
- n = 0 ;
- str = XmStringCreateLocalized(resource.l_width) ;
- XtSetArg(args[n], XmNlabelString, str); n++;
- XtSetArg(args[n], XmNsubMenuId, pull3); n++;
- cas3 = XmCreateOptionMenu( row2, "Width", args, n );
- XtManageChild( cas3 );
- XtAddCallback(XmOptionButtonGadget(cas3), XmNcascadingCallback,
- (XtCallbackProc)button_set3, NULL);
- XmStringFree(str);
- n = 0 ;
- str = XmStringCreateLocalized(resource.l_height) ;
- XtSetArg(args[n], XmNlabelString, str); n++;
- XtSetArg(args[n], XmNsubMenuId, pull4); n++;
- cas4 = XmCreateOptionMenu( row2, "Height", args, n );
- XtManageChild( cas4 );
- XtAddCallback(XmOptionButtonGadget(cas4), XmNcascadingCallback,
- (XtCallbackProc)button_set4, NULL);
- XmStringFree(str);
- font_init();
- create_xlfd();
- n = 0;
- XtSetArg(args[n], XmNvisibleItemCount, 10) ; n++ ;
- XtSetArg(args[n], XmNlistSizePolicy, XmCONSTANT) ; n++ ;
- XtSetArg(args[n], XmNscrollBarDisplayPolicy, XmSTATIC) ; n++ ;
- XtSetArg(args[n], XmNselectionPolicy, XmSINGLE_SELECT) ; n++ ;
- XtSetArg(args[n], XmNitems, xlf) ; n++ ;
- XtSetArg(args[n], XmNitemCount, xlf_count) ; n++ ;
- scrolllist = XmCreateScrolledList(xlfdWform, "scrolllist", args, n);
- XtManageChild(scrolllist);
- /*
- * Error_Messege
- */
- XtAddCallback(editW, XmNokCallback, (XtCallbackProc)OpenWindowCB, NULL);
- XtAddCallback(editW, XmNokCallback, (XtCallbackProc)ReadCB, NULL);
- XtAddCallback(editW, XmNhelpCallback,
- (XtCallbackProc)OpenCancelCB, NULL);
- return( editW ) ;
- }
|