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); }
void MainWindow::OnMenuPathInfo(wxCommandEvent& /*event*/) { InfoDialog(this).ShowModal(); }
void AboutDialog::on_ButtonStickStatus_clicked() { Stick20InfoDialog InfoDialog(this); InfoDialog.exec(); }