コード例 #1
0
ファイル: XmCreateFuncs.c プロジェクト: sazae657/TonNurako
Widget XmCreateList_TNK(Widget parent, String name, ArgList arglist,Cardinal argcount) { return XmCreateList(parent, name, arglist, argcount);}
コード例 #2
0
ファイル: MB3DNavList.c プロジェクト: dwcaress/MB-System
MB3DNavListDataPtr
MB3DNavListCreate ( MB3DNavListDataPtr class_in, Widget parent, String name, ArgList args_in, Cardinal ac_in)
{
    Cardinal ac = 0;
    Arg      args[256];
    Boolean  argok = False;

    /**
     * Register the converters for the widgets.
     */
    RegisterBxConverters(XtWidgetToApplicationContext(parent));
    XtInitializeWidgetClass((WidgetClass)xmFormWidgetClass);
    XtInitializeWidgetClass((WidgetClass)xmLabelWidgetClass);
    XtInitializeWidgetClass((WidgetClass)xmPushButtonWidgetClass);
    XtInitializeWidgetClass((WidgetClass)xmScrolledWindowWidgetClass);
    XtInitializeWidgetClass((WidgetClass)xmListWidgetClass);
    /**
     * Setup app-defaults fallback table if not already done.
     */
    if (doInitAppDefaults)
    {
        InitAppDefaults(parent, appDefaults);
        doInitAppDefaults = False;
    }
    /**
     * Now set the app-defaults for this instance.
     */
    SetAppDefaults(parent, appDefaults, name, False);

    ac = 0;
    XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++;
    XtSetArg(args[ac], XmNx, 76); ac++;
    XtSetArg(args[ac], XmNy, 548); ac++;
    XtSetArg(args[ac], XmNwidth, 415); ac++;
    XtSetArg(args[ac], XmNheight, 243); ac++;
    class_in->MB3DNavList = XmCreateForm(parent,
        (char *)name,
        args,
        ac);

    ac = 0;
    {
        XmString    tmp0;

        tmp0 = (XmString) BX_CONVERT(class_in->MB3DNavList, (char *)"Navigation List:",
                XmRXmString, 0, &argok);
        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
        XtSetArg(args[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
        XtSetArg(args[ac], XmNx, 10); ac++;
        XtSetArg(args[ac], XmNy, 10); ac++;
        XtSetArg(args[ac], XmNwidth, 390); ac++;
        XtSetArg(args[ac], XmNheight, 30); ac++;
        XtSetArg(args[ac], XmNfontList,
            BX_CONVERT(class_in->MB3DNavList, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
            XmRFontList, 0, &argok)); if (argok) ac++;
        class_in->mbview_navlist_label = XmCreateLabel(class_in->MB3DNavList,
            (char *)"mbview_navlist_label",
            args,
            ac);
        XtManageChild(class_in->mbview_navlist_label);

        /**
         * Free any memory allocated for resources.
         */
        XmStringFree((XmString)tmp0);
    }


    ac = 0;
    {
        XmString    tmp0;

        tmp0 = (XmString) BX_CONVERT(class_in->MB3DNavList, (char *)"Delete Selected Navigation",
                XmRXmString, 0, &argok);
        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
        XtSetArg(args[ac], XmNx, 10); ac++;
        XtSetArg(args[ac], XmNy, 200); ac++;
        XtSetArg(args[ac], XmNwidth, 210); ac++;
        XtSetArg(args[ac], XmNheight, 30); ac++;
        XtSetArg(args[ac], XmNfontList,
            BX_CONVERT(class_in->MB3DNavList, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
            XmRFontList, 0, &argok)); if (argok) ac++;
        class_in->mbview_pushButton_navlist_delete = XmCreatePushButton(class_in->MB3DNavList,
            (char *)"mbview_pushButton_navlist_delete",
            args,
            ac);
        XtManageChild(class_in->mbview_pushButton_navlist_delete);

        /**
         * Free any memory allocated for resources.
         */
        XmStringFree((XmString)tmp0);
    }

    XtAddCallback(class_in->mbview_pushButton_navlist_delete, XmNactivateCallback, do_mbview_navlist_delete, (XtPointer)0);

    ac = 0;
    {
        XmString    tmp0;

        tmp0 = (XmString) BX_CONVERT(class_in->MB3DNavList, (char *)"Dismiss",
                XmRXmString, 0, &argok);
        XtSetArg(args[ac], XmNlabelString, tmp0); if (argok) ac++;
        XtSetArg(args[ac], XmNx, 290); ac++;
        XtSetArg(args[ac], XmNy, 200); ac++;
        XtSetArg(args[ac], XmNwidth, 110); ac++;
        XtSetArg(args[ac], XmNheight, 30); ac++;
        XtSetArg(args[ac], XmNfontList,
            BX_CONVERT(class_in->MB3DNavList, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
            XmRFontList, 0, &argok)); if (argok) ac++;
        class_in->mbview_pushButton_navlist_dismiss = XmCreatePushButton(class_in->MB3DNavList,
            (char *)"mbview_pushButton_navlist_dismiss",
            args,
            ac);
        XtManageChild(class_in->mbview_pushButton_navlist_dismiss);

        /**
         * Free any memory allocated for resources.
         */
        XmStringFree((XmString)tmp0);
    }

    XtAddCallback(class_in->mbview_pushButton_navlist_dismiss, XmNactivateCallback, do_mbview_navlist_popdown, (XtPointer)0);

    ac = 0;
    XtSetArg(args[ac], XmNscrollingPolicy, XmAPPLICATION_DEFINED); ac++;
    XtSetArg(args[ac], XmNx, 10); ac++;
    XtSetArg(args[ac], XmNy, 40); ac++;
    XtSetArg(args[ac], XmNwidth, 390); ac++;
    XtSetArg(args[ac], XmNheight, 150); ac++;
    class_in->mbview_scrolledWindow_navlist = XmCreateScrolledWindow(class_in->MB3DNavList,
        (char *)"mbview_scrolledWindow_navlist",
        args,
        ac);
    XtManageChild(class_in->mbview_scrolledWindow_navlist);

    ac = 0;
    XtSetArg(args[ac], XmNselectionPolicy, XmEXTENDED_SELECT); ac++;
    XtSetArg(args[ac], XmNwidth, 390); ac++;
    XtSetArg(args[ac], XmNheight, 150); ac++;
    XtSetArg(args[ac], XmNfontList,
        BX_CONVERT(class_in->mbview_scrolledWindow_navlist, (char *)"-*-"SANS"-bold-r-*-*-*-140-75-75-*-*-iso8859-1",
        XmRFontList, 0, &argok)); if (argok) ac++;
    class_in->mbview_list_navlist = XmCreateList(class_in->mbview_scrolledWindow_navlist,
        (char *)"mbview_list_navlist",
        args,
        ac);
    XtManageChild(class_in->mbview_list_navlist);
    XtAddCallback(class_in->mbview_list_navlist, XmNsingleSelectionCallback, do_mbview_navlistselect, (XtPointer)0);
    XtAddCallback(class_in->mbview_list_navlist, XmNextendedSelectionCallback, do_mbview_navlistselect, (XtPointer)0);
    XtAddCallback(class_in->mbview_list_navlist, XmNbrowseSelectionCallback, do_mbview_navlistselect, (XtPointer)0);
    ac = 0;
    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
    XtSetArg(args[ac], XmNrightOffset, 15); ac++;
    XtSetArg(args[ac], XmNtopOffset, 10); ac++;
    XtSetValues(class_in->mbview_navlist_label, args, ac);

    ac = 0;
    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
    XtSetArg(args[ac], XmNbottomOffset, 13); ac++;
    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
    XtSetValues(class_in->mbview_pushButton_navlist_delete, args, ac);

    ac = 0;
    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_NONE); ac++;
    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
    XtSetArg(args[ac], XmNbottomOffset, 13); ac++;
    XtSetArg(args[ac], XmNrightOffset, 15); ac++;
    XtSetValues(class_in->mbview_pushButton_navlist_dismiss, args, ac);

    ac = 0;
    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
    XtSetArg(args[ac], XmNbottomOffset, 53); ac++;
    XtSetArg(args[ac], XmNleftOffset, 10); ac++;
    XtSetArg(args[ac], XmNrightOffset, 15); ac++;
    XtSetArg(args[ac], XmNtopOffset, 0); ac++;
    XtSetArg(args[ac], XmNtopWidget, class_in->mbview_navlist_label); ac++;
    XtSetValues(class_in->mbview_scrolledWindow_navlist, args, ac);


    /*
     * Assign functions to class record
     */


    /* Begin user code block <end_MB3DNavListCreate> */
    /* End user code block <end_MB3DNavListCreate> */

    return( class_in );
}
コード例 #3
0
ファイル: I18nMain.c プロジェクト: juddy/edcde
/*+++++++++++++++++++++++++++++++++++++++*/
static Widget 
BuildI18nDlg(
      Widget shell )
{
    register int     i, n;
    Arg              args[MAX_ARGS];
    XmString         button_string[NUM_LABELS]; 
    XmString         string; 
    Widget           form;
    Widget           inputMethodForm;
    Widget           imStartModeForm;
    Widget           preeditTypeForm;
    int              count = 0;
    Widget           widgetList1[6];

    /* get i18n resource values  */

    /* Set up DialogBoxDialog button labels */
    button_string[0] = CMPSTR((String) _DtOkString);
    button_string[1] = CMPSTR((String) _DtCancelString);
    button_string[2] = CMPSTR((String) _DtHelpString);

    /* Create toplevel DialogBox */

    /* Initialize the i18n structure */
    i18n.pictLabel = NULL;
    i18n.systemDefault = NULL;
    i18n.inputMethodTB = NULL;
    i18n.serverHostLabel = NULL;
    i18n.serverHostCB = NULL;
    i18n.inputMethodLabel = NULL;
    i18n.inputMethodRC = NULL;
    i18n.imStartModeTB = NULL;
    i18n.imStartModeRC = NULL;
    i18n.askAtLoginTG = NULL;
    i18n.resumeCurrentImTG = NULL;
    i18n.preeditTypeTB = NULL;
    i18n.preeditTypeList = NULL;
    i18n.buttonMoveUp = NULL;
    i18n.buttonMoveDown = NULL;
    i18n.warnDialog = NULL;

    /* saveRestore
     * Note that save.poscnt has been initialized elsewhere.  
     * save.posArgs may contain information from restoreBeep().*/

    XtSetArg(save.posArgs[save.poscnt], XmNbuttonCount, NUM_LABELS);  
    save.poscnt++;
    XtSetArg(save.posArgs[save.poscnt], XmNbuttonLabelStrings, button_string);
    save.poscnt++;
    XtSetArg(save.posArgs[save.poscnt], XmNdefaultPosition, False);
    save.poscnt++;
    style.i18nDialog = 
        __DtCreateDialogBoxDialog(shell, "i18nDialog", save.posArgs, 
				  save.poscnt);
    XtAddCallback(style.i18nDialog, XmNhelpCallback,
            (XtCallbackProc)HelpRequestCB, (XtPointer)HELP_I18N_DIALOG);

    XmStringFree(button_string[0]);
    XmStringFree(button_string[1]);
    XmStringFree(button_string[2]);

    widgetList1[0] = _DtDialogBoxGetButton(style.i18nDialog,2);
    n=0;
    XtSetArg(args[n], XmNautoUnmanage, False); n++;
    XtSetArg(args[n], XmNcancelButton, widgetList1[0]); n++;
    XtSetValues (style.i18nDialog, args, n);

    n=0;
    XtSetArg(args[n], XmNtitle, 
	 ((char *)GETMESSAGE(19, 1, "Style Manager - Internationalization")));
    n++;
    XtSetArg (args[n], XmNuseAsyncGeometry, True); n++;
    XtSetArg(args[n], XmNmwmFunctions, DIALOG_MWM_FUNC); n++;
    XtSetValues (XtParent(style.i18nDialog), args, n);

    n = 0;
    XtSetArg(args[n], XmNallowOverlap, False); n++;
    XtSetArg(args[n], XmNchildType, XmWORK_AREA);  n++;
    form = XmCreateForm(style.i18nDialog, "i18nForm", args, n);

    n = 0;
    XtSetArg(args[n], XmNfillMode, XmFILL_SELF); n++;
    XtSetArg(args[n], XmNbehavior, XmICON_LABEL); n++;
    XtSetArg(args[n], XmNpixmapForeground, style.secBSCol); n++;
    XtSetArg(args[n], XmNpixmapBackground, style.secTSCol); n++;
    XtSetArg(args[n], XmNstring, NULL); n++;  
    XtSetArg(args[n], XmNshadowThickness, 0); n++;  
    XtSetArg(args[n], XmNimageName, I18N_ICON); n++;  
    XtSetArg(args[n], XmNtraversalOn, False); n++;  
    widgetList1[count++] = i18n.pictLabel =
	_DtCreateIcon(form, "i18npictLabel", args, n);

    n = 0;
    XtSetArg(args[n], XmNmarginHeight, LB_MARGIN_HEIGHT);  n++;
    XtSetArg(args[n], XmNmarginWidth, LB_MARGIN_WIDTH);  n++;
    string = CMPSTR(((char *)GETMESSAGE(19, 2, "Default")));
    XtSetArg(args[n], XmNlabelString, string); n++;
    widgetList1[count++] = i18n.systemDefault = 
        XmCreatePushButtonGadget(form, "systemDefault", args, n);
    XmStringFree(string);

    n = 0;
    string = CMPSTR((char *)GETMESSAGE(19, 3, "Input Method"));
    XtSetArg(args[n], XmNtitleString, string);  n++;
    widgetList1[count++] = i18n.inputMethodTB =
        _DtCreateTitleBox(form, "inputMethodTB", args, n);
    XmStringFree(string);
    
    n = 0;
    XtSetArg(args[n], XmNallowOverlap, False); n++;
    XtSetArg(args[n], XmNchildType, XmWORK_AREA);  n++;
    inputMethodForm = 
        XmCreateForm(i18n.inputMethodTB, "inputMethodForm", args, n);

    n = 0;
    string = CMPSTR((char *)GETMESSAGE(19, 4, "Input Method Start Mode"));
    XtSetArg(args[n], XmNtitleString, string);  n++;
    widgetList1[count++] = i18n.imStartModeTB =
        _DtCreateTitleBox(form, "imStartModeTB", args, n);
    XmStringFree(string);

    n = 0;
    XtSetArg(args[n], XmNallowOverlap, False); n++;
    XtSetArg(args[n], XmNchildType, XmWORK_AREA);  n++;
    imStartModeForm = 
        XmCreateForm(i18n.imStartModeTB, "imStartModeForm", args, n);

    n = 0;
    string = CMPSTR((char *)GETMESSAGE(19, 5, "Preedit Type"));
    XtSetArg(args[n], XmNtitleString, string);  n++;
    widgetList1[count++] = i18n.preeditTypeTB =
        _DtCreateTitleBox(form, "preeditTypeTB", args, n);
    XmStringFree(string);

    n = 0;
    XtSetArg(args[n], XmNallowOverlap, False); n++;
    XtSetArg(args[n], XmNchildType, XmWORK_AREA);  n++;
    preeditTypeForm = 
        XmCreateForm(i18n.preeditTypeTB, "preeditTypeForm", args, n);

    /* Create widgets inside the inputMethodForm */
    n = 0;
    string = CMPSTR((char *)GETMESSAGE(19, 6, "Server Host :"));
    XtSetArg(args[n], XmNlabelString, string); n++;
    i18n.serverHostLabel = 
	XmCreateLabelGadget(inputMethodForm, "serverHostLabel", args, n);

    n = 0;
    XtSetArg(args[n], XmNcomboBoxType, XmDROP_DOWN_COMBO_BOX); n++;
    i18n.serverHostCB =
  	(Widget) (intptr_t) XmCreateComboBox(inputMethodForm, "serverHostCB", args, n);

    XtAddCallback(XtNameToWidget(i18n.serverHostCB, "Text"),
		  XmNactivateCallback, ServerHostCB, NULL);
    XtAddCallback(XtNameToWidget(i18n.serverHostCB, "Text"),
		  XmNfocusCallback, TextFocusCB, NULL);
    XtAddCallback(XtNameToWidget(i18n.serverHostCB, "Text"),
		  XmNlosingFocusCallback, TextLosingFocusCB, NULL);
    

    n = 0;
    string = CMPSTR((char *)GETMESSAGE(19, 7, "Input Method"));
    XtSetArg(args[n], XmNlabelString, string); n++;
    i18n.inputMethodLabel = 
	XmCreateLabelGadget(inputMethodForm, "inputMethodLabel", args, n);

    n = 0;
    XtSetArg(args[n], XmNmarginWidth, LB_MARGIN_WIDTH); n++;
    XtSetArg(args[n], XmNmarginHeight, LB_MARGIN_HEIGHT); n++;
    i18n.inputMethodRC = 
        XmCreateRadioBox(inputMethodForm, "inputMethodRC", args, n);


    /* Create widgets inside the imStartModeForm */
    n = 0;
    XtSetArg(args[n], XmNmarginWidth, 0); n++;
    XtSetArg(args[n], XmNmarginHeight, 0); n++;
    i18n.imStartModeRC = 
        XmCreateRadioBox(imStartModeForm, "imStartModeRC", args, n);

    n = 0;
    string = CMPSTR((char *)GETMESSAGE(19, 8, "Ask at login"));
    XtSetArg(args[n], XmNlabelString, string); n++;
    i18n.askAtLoginTG = 
	XmCreateToggleButtonGadget(i18n.imStartModeRC, "askAtLoginTG", 
				   args, n);
    XmStringFree(string);

    n = 0;
    string = CMPSTR((char *)GETMESSAGE(19, 9, "Resume Current Input Method"));
    XtSetArg(args[n], XmNlabelString, string); n++;
    i18n.resumeCurrentImTG = 
        XmCreateToggleButtonGadget(i18n.imStartModeRC, "resumeCurrentImTG", 
				   args, n);
    XmStringFree(string);

    /* Create widgets inside the preeditTypeForm */

    n = 0;
    XtSetArg(args[n], XmNselectionPolicy, XmBROWSE_SELECT); n++;
    i18n.preeditTypeList =
	(Widget) (intptr_t) XmCreateList(preeditTypeForm, "preeditTypeList", args, n);

    n = 0;
    string = CMPSTR((char *)GETMESSAGE(19, 10, "Move Up"));
    XtSetArg(args[n], XmNlabelString, string); n++;
    XtSetArg(args[n], XmNsensitive, False); n++;
    i18n.buttonMoveUp =
	XmCreatePushButtonGadget(preeditTypeForm, "buttonMoveUp", args, n);
    XmStringFree(string);

    n = 0;
    string = CMPSTR((char *)GETMESSAGE(19, 11, "Move Down"));
    XtSetArg(args[n], XmNlabelString, string); n++;
    XtSetArg(args[n], XmNsensitive, False); n++;
    i18n.buttonMoveDown =
	XmCreatePushButtonGadget(preeditTypeForm, "buttonMoveDown", args, n);
    XmStringFree(string);

    XtAddCallback(style.i18nDialog, XmNmapCallback, FormLayoutCB, NULL);
    XtAddCallback(style.i18nDialog, XmNmapCallback, MapCB, shell);
    XtAddCallback(style.i18nDialog, XmNcallback, ButtonCB, NULL);
    XtAddCallback(i18n.systemDefault, XmNactivateCallback, 
		  SystemDefaultCB, NULL);
    XtAddCallback(i18n.preeditTypeList, XmNbrowseSelectionCallback, 
		  ListItemSelectCB, NULL);
    XtAddCallback(i18n.buttonMoveUp, XmNactivateCallback, 
		  MoveUpCB, NULL);
    XtAddCallback(i18n.buttonMoveDown, XmNactivateCallback, 
		  MoveDownCB, NULL);

    XtManageChild(form);
    XtManageChildren(widgetList1,count); 

    XtManageChild(inputMethodForm);
    XtManageChild(imStartModeForm);
    XtManageChild(preeditTypeForm);

    XtManageChild(i18n.serverHostLabel);
    XtManageChild(i18n.serverHostCB);
    XtManageChild(i18n.inputMethodLabel);
    XtManageChild(i18n.inputMethodRC);

    XtManageChild(i18n.imStartModeRC);
    XtManageChild(i18n.askAtLoginTG);
    XtManageChild(i18n.resumeCurrentImTG);

    XtManageChild(i18n.preeditTypeList);
    XtManageChild(i18n.buttonMoveUp);
    XtManageChild(i18n.buttonMoveDown);

    return(style.i18nDialog);
}