コード例 #1
0
/*+++++++++++++++++++++++++++++++++++++++*/
void 
callCancels( void )
{
 DtDialogBoxCallbackStruct CancelBut;
 char dialogStates[60];
 static Boolean calledAlready = False;

  if (!calledAlready) {
     dialogStates[0] = '\0';

   if(style.colorDialog != NULL && XtIsManaged(style.colorDialog)) {
       CancelBut.button_position = CANCEL_BUTTON;
       XtCallCallbacks(style.colorDialog, XmNcallback, &CancelBut);
   }

     if(style.fontDialog != NULL && XtIsManaged(style.fontDialog)) {
	 CancelBut.button_position = CANCEL_BUTTON;
	 XtCallCallbacks(style.fontDialog, XmNcallback, &CancelBut);
     }

     if(style.audioDialog != NULL && XtIsManaged(style.audioDialog)) {
	 CancelBut.button_position = CANCEL_BUTTON;
	 XtCallCallbacks(style.audioDialog, XmNcallback, &CancelBut);
     }

     if(style.kbdDialog != NULL && XtIsManaged(style.kbdDialog)) {
	 CancelBut.button_position = CANCEL_BUTTON;
	 XtCallCallbacks(style.kbdDialog, XmNcallback, &CancelBut);
     }

     if(style.mouseDialog != NULL && XtIsManaged(style.mouseDialog)) {
	 CancelBut.button_position = CANCEL_BUTTON;
	 XtCallCallbacks(style.mouseDialog, XmNcallback, &CancelBut);
     }

     if(style.screenDialog != NULL &&  XtIsManaged(style.screenDialog)) {
	 CancelBut.button_position = CANCEL_BUTTON;
	 XtCallCallbacks(style.screenDialog, XmNcallback, &CancelBut);
     }

     if(style.startupDialog != NULL && XtIsManaged(style.startupDialog)) {
	 CancelBut.button_position = CANCEL_BUTTON;
	 XtCallCallbacks(style.startupDialog, XmNcallback, &CancelBut);
     }

     if (dialogStates) 
       _DtAddToResource(style.display, dialogStates);

     calledAlready = True;
  }
}
コード例 #2
0
static void 
okWarnCB(
        Widget w,
        XtPointer client_data,
        XtPointer call_data )
{
  dtwm.origKeyboardFocusPolicy = XmToggleButtonGadgetGetState (dtwm.explicitTG);
  dtwm.origFocusAutoRaise = XmToggleButtonGadgetGetState (dtwm.autoRaiseTG);
  dtwm.origSecStack = !XmToggleButtonGadgetGetState (dtwm.secStackTG);
  dtwm.origMoveOpaque = XmToggleButtonGadgetGetState (dtwm.moveOpaqueTG);
  dtwm.origUseIconBox = XmToggleButtonGadgetGetState (dtwm.iconBoxTG);
  

  /* write out resources to xrdb */
  _DtAddToResource(style.display, dtwmRes);
  
  /* force the workspace manager to restart */
  _DtWmRestartNoConfirm(style.display, style.root);
}
コード例 #3
0
ファイル: I18nMain.c プロジェクト: juddy/edcde
static int
SaveSelectedValues(
      I18nEnv *env)
{
    int ret = NoError;
    char *preeditStr = NULL, *tmpStr;
    int i;
    XtArgVal num_preedit = 0;
    XmStringTable list_preedit;
    static char preeditTypeRes[1024];

    /* Get the values from the UI and update the FileSel structure */
    SetFileSelValues(env);

    /* Write these values in the IMS Selection File */
    ret = _DtI18nWriteImSelectionFile(env);

    /* Save the preeditType resource value if needed */
    if (i18n.preeditHasChanged) {

	if (style.xrdb.writeXrdbImmediate)
	    InfoDialog(MSG_IMMEDIATE, style.shell, False);
	else
	    InfoDialog(MSG_LATER, style.shell, False);

	/* generate a string from the list to set the resource */
	XtVaGetValues(i18n.preeditTypeList,
		      XmNitemCount, &num_preedit,
		      XmNitems, &list_preedit, NULL);

	/* Save this value in case of a Cancel */
	if (i18n.preeditSavedVal) {
	    FreeST(i18n.preeditSavedVal, i18n.preeditSavedNum);
	}

	i18n.preeditSavedVal = CopyST(list_preedit, num_preedit);
	i18n.preeditSavedNum = num_preedit;

	for (i = 0; i < num_preedit; i++) {
	    /* get the text of the XmString */
	    tmpStr = XmStringUnparse(list_preedit[i], NULL, XmCHARSET_TEXT, 
				     XmCHARSET_TEXT, NULL, 0, XmOUTPUT_ALL);
	    /* realloc mallocs the first time */
	    preeditStr = XtRealloc(preeditStr, 
				   strlen(preeditStr) + strlen(tmpStr) + 2);

	    /* insert the comma before the second, third. etc */
	    if (i != 0) {
		strcat(preeditStr, ",");
		strcat(preeditStr, tmpStr);
	    }
	    else
		strcpy(preeditStr, tmpStr);

	    XtFree(tmpStr);
	}

	/* if writeXrdbImmediate true write to Xrdb else send to 
	   session mgr */

	sprintf(preeditTypeRes, "*preeditType: %s\n", preeditStr);

	XtFree(preeditStr);

	if(style.xrdb.writeXrdbImmediate)
	    _DtAddToResource(style.display, preeditTypeRes);

	SmNewPreeditSettings(preeditTypeRes);

	/* Reset the state of the list. */
	i18n.preeditHasChanged = False;
    }

    return (ret);

}