static void activateCB_AF_OkButton( Widget UxWidget, XtPointer UxClientData, XtPointer UxCallbackArg) { FiletypeData *pFtD; FiletypeData **papArray; int i; /**************************************************************************/ /* Check if fields are valid. */ /**************************************************************************/ if (!AddFiletypeCheckFields()) { /***********************************************************************/ /* Get FiletypeData structure that was allocated when Add button on */ /* the CreateActionAppShell interface was activated. */ /***********************************************************************/ XtVaGetValues(AddFiletype, XmNuserData, &pFtD, NULL); /***********************************************************************/ /* Get all values from gui */ /***********************************************************************/ readAFFromGUI(pFtD); /***********************************************************************/ /* If in edit mode, then don't do add type things. */ /***********************************************************************/ if (!(pFtD->fsInternal & CA_FT_EDIT)) { /********************************************************************/ /* Update the Filetype listbox with this new filetype */ /********************************************************************/ AddFiletypeToList(); /********************************************************************/ /* Update FiletypeData array within the ActionData structure */ /********************************************************************/ UpdateFiletypeDataArray(pFtD); } /***********************************************************************/ /* Unset previous set values. */ /***********************************************************************/ pFtD->fsInternal &= (~(CA_FT_APPLY)); pFtD->fsInternal &= (~(CA_FT_EDIT)); /***********************************************************************/ /* Pop down the AddFiletype interface */ /***********************************************************************/ UxPopdownInterface(AddFiletype); } }
static void okCallback_OpenFile( Widget UxWidget, XtPointer UxClientData, XtPointer UxCallbackArg ) { _UxCOpenFile *UxSaveCtx, *UxContext; XmFileSelectionBoxCallbackStruct *cbs; /*char *text;*/ int rc; ActionData ADTmp; UxSaveCtx = UxOpenFileContext; UxOpenFileContext = UxContext = (_UxCOpenFile *) UxGetContext( UxWidget ); { /********************************************************************/ /* Call file parsing code here! */ /********************************************************************/ cbs = (XmFileSelectionBoxCallbackStruct *)UxCallbackArg; if (pszFileToEdit) { XtFree(pszFileToEdit); } pszFileToEdit = _XmStringUngenerate(cbs->value, NULL, XmCHARSET_TEXT, XmCHARSET_TEXT); if (pszFileToEdit != (char *)NULL) { memset(&ADTmp, 0, sizeof(ActionData)); rc = OpenDefinitionFile(pszFileToEdit, &ADTmp); /*XtFree(text);*/ /*****************************************************************/ /* If everything ok, then clear out data from action structure */ /* and store new data. */ /*****************************************************************/ if (!rc) { FreeAndClearAD(&AD); memcpy(&AD, &ADTmp, sizeof(ActionData)); } } UxPopdownInterface (UxWidget); /********************************************************************/ /* If successfully opened and parsed file, then init the fields of */ /* the main window. */ /********************************************************************/ if (!rc) { clear_CreateActionAppShell_fields(); writeCAToGUI(&AD); } } UxOpenFileContext = UxSaveCtx; }
static void activateCB_AF_CancelButton( Widget UxWidget, XtPointer UxClientData, XtPointer UxCallbackArg) { FiletypeData *pFtD; UxPopdownInterface(AddFiletype); XtVaGetValues(AddFiletype, XmNuserData, &pFtD, NULL); if (!((pFtD->fsInternal & CA_FT_APPLY) || (pFtD->fsInternal & CA_FT_EDIT))) { free_Filetypedata(pFtD); } else { pFtD->fsInternal &= (~(CA_FT_APPLY)); pFtD->fsInternal &= (~(CA_FT_EDIT)); } }
static void cancelCB_OpenFile( Widget UxWidget, XtPointer UxClientData, XtPointer UxCallbackArg ) { _UxCOpenFile *UxSaveCtx, *UxContext; UxSaveCtx = UxOpenFileContext; UxOpenFileContext = UxContext = (_UxCOpenFile *) UxGetContext( UxWidget ); { UxPopdownInterface(UxWidget); } UxOpenFileContext = UxSaveCtx; }
/*********************************************************************** * * * Send mail. * * * ***********************************************************************/ static void send_mail(Widget w, XtPointer cd, XmAnyCallbackStruct *cbs) { char *name, *inst, *phone, *email, *mess, mode; mode = XmToggleButtonGadgetGetState(bugMailToggle) ? 'B' : 'C'; name = XmTextGetString(userMailText); inst = XmTextGetString(instituteMailText); phone = XmTextGetString(phoneMailText); email = XmTextGetString(emailMailText); mess = XmTextGetString(bugMailText); if (br_mail_motif(mode, name, inst, phone, email, mess)) km_warn_user(mailDialog, "Error sending mail...", ""); else UxPopdownInterface(mailDialog); XtFree(name); XtFree(inst); XtFree(phone); XtFree(email); XtFree(mess); }