static void activateCB_menu1_p1_b2( Widget wgt, XtPointer cd, XtPointer cb) { Widget UxWidget = wgt; XtPointer UxClientData = cd; XtPointer UxCallbackArg = cb; UxPopupInterface(fileSelectionBoxDialog1, no_grab); }
void activateCB_edit_id_characteristics (Widget filesel, XtPointer cdata, XmFileSelectionBoxCallbackStruct *cbstruct) { FiletypeData *pFtD; XtVaGetValues (AddFiletype, XmNuserData, &pFtD, NULL); /*FileCharacteristics = create_FileCharacteristics();*/ XtVaSetValues (FileCharacteristics, XmNuserData, pFtD, NULL); clear_FileCharacteristics_dialog_fields(); init_FileCharacteristics_dialog_fields(pFtD); UxPopupInterface (FILE_CHARACTERISTICS, no_grab); return; }
main(int argc, char *argv[]) #endif /* _NO_PROTO */ { char *databaseName = "CTNControl"; CONDITION cond; CTNBOOLEAN verboseTBL = FALSE; /*----------------------------------------------------------- * Declarations. * The default identifier - mainIface will only be declared * if the interface function is global and of type swidget. * To change the identifier to a different name, modify the * string mainIface in the file "xtmain.dat". If "mainIface" * is declared, it will be used below where the return value * of PJ_INTERFACE_FUNCTION_CALL will be assigned to it. *----------------------------------------------------------*/ Widget mainIface; /*--------------------------------- * Interface function declaration *--------------------------------*/ Widget create_applicationShell1(swidget); swidget UxParent = NULL; /*--------------------- * Initialize program *--------------------*/ #ifdef XOPEN_CATALOG if (XSupportsLocale()) { XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL); } #endif SgePreInitialize(&argc, argv); UxTopLevel = XtAppInitialize(&UxAppContext, "cfg_ctn_tables", NULL, 0, &argc, argv, NULL, NULL, 0); UxDisplay = XtDisplay(UxTopLevel); UxScreen = XDefaultScreen(UxDisplay); /* * We set the geometry of UxTopLevel so that dialogShells that are * parented on it will get centered on the screen (if defaultPosition is * true). */ XtVaSetValues(UxTopLevel, XtNx, 0, XtNy, 0, XtNwidth, DisplayWidth(UxDisplay, UxScreen), XtNheight, DisplayHeight(UxDisplay, UxScreen), NULL); /*------------------------------------------------------- * Insert initialization code for your application here *------------------------------------------------------*/ while (--argc > 0 && *(++argv)[0] == '-') { switch ((*argv)[1]) { case 'f': if (argc-- < 1) exit(1); databaseName = *++argv; break; case 'h': usageerror(); break; case 'x': if (argc-- < 0) usageerror(); argv++; if (strcmp(*argv, "TBL") == 0) verboseTBL = TRUE; else usageerror(); break; default: printf("Unrecognized option: %s\n", *argv); break; } } TBL_Debug(verboseTBL); THR_Init(); cond = DMAN_Open(databaseName, "", "", &dmanHandle); if (cond != DMAN_NORMAL) { COND_DumpConditions(); exit(1); } /*---------------------------------------------------------------- * Create and popup the first window of the interface. The * return value can be used in the popdown or destroy functions. * The Widget return value of PJ_INTERFACE_FUNCTION_CALL will * be assigned to "mainIface" from PJ_INTERFACE_RETVAL_TYPE. *---------------------------------------------------------------*/ mainIface = create_applicationShell1(UxParent); UxPopupInterface(mainIface, no_grab); /*----------------------- * Enter the event loop *----------------------*/ XtAppMainLoop(UxAppContext); }
/*********************************************************************** * * * Show (manage) the ntuple scanner. * * * ***********************************************************************/ static void show_ntupleScanner(Widget w, XtPointer cd, XmAnyCallbackStruct *call_data) { Widget widget; Pixmap pixmap; Display *display; char *title, *first, *nrow; XmString xmtit; int i, ifirst, nevent; if (ntuple.id == 0) return; if (no_scan) { no_scan = False; return; } /* * Copy items from the ntuple structure for local use. * These items are necessary for being able to scan an Ntuple that * is no longer in the Ntuple viewer. */ ntuple_id = ntuple.id; ntuple_nrows = ntuple.nrows; strcpy(ntuple_dir, ntuple.dir); if (n_scanners >= MAX_SCANNERS) { km_inform_user(w, "Cannot open more Ntuple scanners.", ""); return; } widget = create_ntupleScan(); (void)get_scan_context(widget); /* set icon for scan window */ display = XtDisplay(widget); pixmap = XCreateBitmapFromData(display, DefaultRootWindow(display), scan_bits, scan_width, scan_height); for (i = 0; i < MAX_SCANNERS; i++) { if (!scanner[i].widget) { title = XtCalloc(MAX_STRING, 1); sprintf(title, "Ntuple Scanner %d", i+1); XtVaSetValues(XtParent(widget), XmNtitle, title, XmNiconName, title, XmNiconPixmap, pixmap, XmNdeleteResponse, XmUNMAP, NULL); /* make scanner known to KUIP's Exec window */ km_store_appShell(widget, title); XtFree(title); break; } } /* * Make sure that if the window is popped down, the scanner is * properly destroyed. */ XtAddCallback(XtParent(widget), XmNpopdownCallback, (XtCallbackProc)popdown_cb, widget); /* * Install close callback */ XtAddCallback(closeScButton, XmNactivateCallback, (XtCallbackProc)close_cb, widget); /* * Install callbacks for text, re-scan, next and previous buttons */ XtAddCallback(firstScText, XmNactivateCallback, (XtCallbackProc)next_cb, widget); XtAddCallback(nrowScText, XmNactivateCallback, (XtCallbackProc)next_cb, widget); XtAddCallback(scanScButton, XmNactivateCallback, (XtCallbackProc)next_cb, widget); XtAddCallback(nextScButton, XmNactivateCallback, (XtCallbackProc)next_cb, widget); XtAddCallback(previousScButton, XmNactivateCallback, (XtCallbackProc)next_cb, widget); XtSetSensitive(previousScButton, False); /* "Previous" does not work with new QP */ XtVaSetValues(previousScButton, XmNmappedWhenManaged, False, NULL); /* * Fill in the first and number of row fields as well as the * Ntuple title label */ first = XmTextGetString(firstNtText); nrow = XmTextGetString(nrowNtText); ifirst = atoi(first); nevent = atoi(nrow); if (nevent > MAX_ROWS) nevent = MAX_ROWS; if (ifirst+nevent-1 >= ntuple_nrows) XtSetSensitive(nextScButton, False); XtFree(nrow); nrow = XtCalloc(20, 1); sprintf(nrow, "%d", nevent); XmTextSetString(firstScText, first); XmTextSetString(nrowScText, nrow); XtFree(first); XtFree(nrow); XtVaGetValues(titleNtLabel, XmNlabelString, &xmtit, NULL); XtVaSetValues(titleScLabel, XmNlabelString, xmtit, NULL); /* execute the scan command */ matrix = (Widget) NULL; no_vars = -1; execute_scan_cmd(w, widget); /* finally popup the scanner */ UxPopupInterface(widget, XtGrabNone); n_scanners++; for (i = 0; i < MAX_SCANNERS; i++) { if (!scanner[i].widget) { scanner[i].widget = widget; break; } } save_scan_context(widget); }
void activateCB_open_FindSet (Widget find_set_button, XtPointer cdata, XmFileSelectionBoxCallbackStruct *cbstruct) { Widget filter; Boolean use_bm = False; static char *use_bm_filter = "*.m.bm"; static char *use_pm_filter = "*.m.pm"; char *search_path; char *filter_field_title = NULL; int use_filter_field = False; char *file_filter; char **directories_list = GetIconSearchPathList(); int numberOfTopButtons = 0; void *top_button_one_cb = NULL; void *top_button_two_cb = NULL; void *top_button_three_cb = NULL; char *top_button_one_label = NULL; char *top_button_two_label = NULL; char *top_button_three_label = NULL; int use_icon_name_field = True; int numberOfBottomButtons = 3; void *bottom_button_one_cb = (void *)load_icons; void *bottom_button_two_cb = NULL; void *bottom_button_three_cb = NULL; void *bottom_button_four_cb = NULL; char *bottom_button_one_label = NULL; /* use default */ char *bottom_button_two_label = NULL; /* use default */ char *bottom_button_three_label = NULL; /* use default */ char *bottom_button_four_label = NULL; /* use default */ char *name_field_title; char *container_title; char *directory_title; char *dialog_title, *pre, *suf; name_field_title = XtNewString(GETMESSAGE(11, 12, "Enter Icon Filename")); container_title = XtNewString(GETMESSAGE(11, 11, "Icon Files")); directory_title = XtNewString(GETMESSAGE(11, 30, "Icon Folders")); pre = GETMESSAGE(3, 10, "Create Action"); suf = GETMESSAGE(6, 18, "Find Set"); dialog_title = XtMalloc(strlen(pre) + strlen(suf) + 4); sprintf(dialog_title, "%s - %s", pre, suf); #ifdef DEBUG printf("activate Find Set button; client_data = %p\n", cdata); /* debug */ #endif XtVaGetValues (COLOR_MONO_OPTION, XmNset, &use_bm, NULL); if (use_bm) file_filter = use_bm_filter; else file_filter = use_pm_filter; #ifndef _ICONSELECTOR_DESTROY_ENABLED if (!IconSelector) { #endif /* _ICONSELECTOR_DESTROY_ENABLED */ IconSelector = create_icon_selection_dialog ((swidget) CreateActionAppShell, (unsigned char *)dialog_title, (unsigned char *)filter_field_title, use_filter_field, (unsigned char *)file_filter, (unsigned char *)directory_title, (unsigned char **)directories_list, (unsigned char *)container_title, numberOfTopButtons, (unsigned char *)top_button_one_label, (void (*)())top_button_one_cb, (unsigned char *)top_button_two_label, (void (*)())top_button_two_cb, (unsigned char *)top_button_three_label, (void (*)())top_button_three_cb, use_icon_name_field, (unsigned char *)name_field_title, numberOfBottomButtons, (unsigned char *)bottom_button_one_label, (void (*)())bottom_button_one_cb, (unsigned char *)bottom_button_two_label, (void (*)())bottom_button_two_cb, (unsigned char *)bottom_button_three_label, (void (*)())bottom_button_three_cb, (unsigned char *)bottom_button_four_label, (void (*)())bottom_button_four_cb); #ifndef _ICONSELECTOR_DESTROY_ENABLED } #endif /* _ICONSELECTOR_DESTROY_ENABLED */ XtFree(name_field_title); XtFree(container_title); XtFree(directory_title); XtFree(dialog_title); FreeIconSearchPathList(directories_list); XtVaSetValues (IconSelector, XmNuserData, cdata, NULL); UxPopupInterface (IconSelector, no_grab); XmProcessTraversal(ISD_SelectedIconTextField, XmTRAVERSE_CURRENT); return; }