/* * Create the wparam Frame and the wparam Panel */ void create_wparam_frame(Widget, XtPointer, XtPointer) { Widget fr; set_wait_cursor(); if (wparam_frame == NULL) { wparam_frame = XmCreateFileSelectionDialog(app_shell, (char *)"wparam_frame", NULL, 0); XtVaSetValues(XtParent(wparam_frame), XmNtitle, "Write plot parameters", NULL); XtAddCallback(wparam_frame, XmNcancelCallback, (XtCallbackProc)destroy_dialog, wparam_frame); XtAddCallback(wparam_frame, XmNokCallback, (XtCallbackProc)wparam_apply_notify_proc, 0); /* may not be needed handle_close(wparam_frame); */ fr = XmCreateFrame(wparam_frame, (char *)"fr", NULL, 0); wparam_panel = XmCreateRowColumn(fr, (char *)"wparam_rc", NULL, 0); wparam_choice_item = CreateGraphChoice(wparam_panel, "Write parameters from graph: ", maxgraph, 2); XtManageChild(fr); XtManageChild(wparam_panel); } XtRaise(wparam_frame); unset_wait_cursor(); }
/* * Create the files Frame and the files Panel */ void create_eblock_frame(Widget, XtPointer, XtPointer) { long i; int x, y; Widget rc, buts[2]; if (blockncols == 0) { errwin("Need to read block data first"); return; } set_wait_cursor(); if (eblock_frame == NULL) { char *label1[2]; label1[0] = (char *)"Accept"; label1[1] = (char *)"Close"; XmGetPos(app_shell, 0, &x, &y); eblock_frame = XmCreateDialogShell(app_shell, (char *)"Edit block data", NULL, 0); handle_close(eblock_frame); XtVaSetValues(eblock_frame, XmNx, x, XmNy, y, NULL); eblock_panel = XmCreateRowColumn(eblock_frame, (char *)"eblock_rc", NULL, 0); eblock_ncols_item = XtVaCreateManagedWidget((char *)"tmp", xmLabelWidgetClass, eblock_panel, NULL); rc = XtVaCreateWidget((char *)"rc", xmRowColumnWidgetClass, eblock_panel, XmNpacking, XmPACK_COLUMN, XmNnumColumns, 9, XmNorientation, XmHORIZONTAL, XmNisAligned, True, XmNadjustLast, False, XmNentryAlignment, XmALIGNMENT_END, NULL); XtVaCreateManagedWidget((char *)"Set type: ", xmLabelWidgetClass, rc, NULL); eblock_type_choice_item = CreatePanelChoice(rc, " ", 13, "XY", "XY DX", "XY DY", "XY DX1 DX2", "XY DY1 DY2", "XY DX DY", "XY Z", "XY HILO", "XY R", "XY BOX", "Rawspice", "XY BOXPLOT", NULL, 0); for (i = 0; i < 12; i++) { XtAddCallback(eblock_type_choice_item[2 + i], XmNactivateCallback, (XtCallbackProc)eblock_type_notify_proc, (XtPointer)i); } XtVaCreateManagedWidget("X from column:", xmLabelWidgetClass, rc, NULL); eblock_x_choice_item = CreateBlockChoice(rc, (char *)" ", maxblock, 1); XtVaCreateManagedWidget("Y from column:", xmLabelWidgetClass, rc, NULL); eblock_y_choice_item = CreateBlockChoice(rc, (char *)" ", maxblock, 0); XtVaCreateManagedWidget("E1 from column:", xmLabelWidgetClass, rc, NULL); eblock_e1_choice_item = CreateBlockChoice(rc, (char *)" ", maxblock, 0); XtVaCreateManagedWidget("E2 from column:", xmLabelWidgetClass, rc, NULL); eblock_e2_choice_item = CreateBlockChoice(rc, (char *)" ", maxblock, 0); XtVaCreateManagedWidget("E3 from column:", xmLabelWidgetClass, rc, NULL); eblock_e3_choice_item = CreateBlockChoice(rc, (char *)" ", maxblock, 0); XtVaCreateManagedWidget("E4 from column:", xmLabelWidgetClass, rc, NULL); eblock_e4_choice_item = CreateBlockChoice(rc, (char *)" ", maxblock, 0); /* XtVaCreateManagedWidget("Load to set:", xmLabelWidgetClass, rc, NULL); eblock_set_choice_item = CreateSetChoice(rc, " ", maxplot, 4); */ XtVaCreateManagedWidget((char *)"Load to set in graph:", xmLabelWidgetClass, rc, NULL); eblock_graph_choice_item = CreateGraphChoice(rc, (char *)" ", maxgraph, 1); XtManageChild(rc); XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, eblock_panel, NULL); CreateCommandButtons(eblock_panel, 2, buts, label1); XtAddCallback(buts[0], XmNactivateCallback, (XtCallbackProc)eblock_accept_notify_proc, (XtPointer)0); XtAddCallback(buts[1], XmNactivateCallback, (XtCallbackProc)destroy_dialog, (XtPointer)eblock_frame); XtManageChild(eblock_panel); } XtRaise(eblock_frame); update_eblock(); unset_wait_cursor(); } /* end create_eblock_panel */
/* ARGSUSED */ void create_nonl_frame(Widget, XtPointer, XtPointer) { int i; int x, y; Widget sw, fr, rc, rc1, rc2, lab, but1[3]; set_wait_cursor(); if (nonl_frame == NULL) { char *label1[3]; /* label1[0] = "Accept"; label1[1] = "Eval..."; label1[2] = "Close"; */ label1[0] = (char *)"Accept"; label1[1] = (char *)"Close"; XmGetPos(app_shell, 0, &x, &y); nonl_frame = XmCreateDialogShell(app_shell, (char *)"Non-linear curve fitting", NULL, 0); handle_close(nonl_frame); XtVaSetValues(nonl_frame, XmNx, x, XmNy, y, NULL); nonl_panel = XmCreateForm(nonl_frame, (char *)"nonl_frame_rc", NULL, 0); fr = XmCreateFrame(nonl_panel, (char *)"nonl_frame", NULL, 0); rc = XmCreateRowColumn(fr, (char *)"nonl_rc", NULL, 0); nonl_set_item = CreateSetChoice(rc, (char *)"Use set:", maxplot, 0); nonl_load_item = CreatePanelChoice(rc, "Load:", 4, "Fitted values", "Residuals", "None", NULL, NULL); nonl_loadgraph_item = CreateGraphChoice(rc, (char *)"To graph:", maxgraph, 0); nonl_formula_item = (Widget)CreateTextItem2(rc, 35, (char *)"Function:"); xv_setstr(nonl_formula_item, (char *)"y = "); nonl_nparm_item = CreateTextItem2(rc, 5, (char *)"# of parameters:"); nonl_tol_item = CreateTextItem2(rc, 10, (char *)"Tolerance:"); XtManageChild(rc); XtManageChild(fr); sw = XtVaCreateManagedWidget("sw", xmScrolledWindowWidgetClass, nonl_panel, XmNscrollingPolicy, XmAUTOMATIC, NULL); rc = XmCreateRowColumn(sw, (char *)"rc", NULL, 0); XtVaSetValues(rc, XmNorientation, XmHORIZONTAL, NULL); rc1 = XmCreateRowColumn(rc, (char *)"rc1", NULL, 0); lab = XmCreateLabel(rc1, (char *)"Initial guess:", NULL, 0); XtManageChild(lab); rc2 = XmCreateRowColumn(rc, (char *)"rc2", NULL, 0); lab = XmCreateLabel(rc2, (char *)"Computed values:", NULL, 0); XtManageChild(lab); for (i = 0; i < MAXPARM; i++) { sprintf(buf, "A%1d: ", i); nonl_initial_item[i] = CreateTextItem2(rc1, 15, buf); } for (i = 0; i < MAXPARM; i++) { nonl_computed_item[i] = CreateTextItem2(rc2, 15, (char *)""); } XtManageChild(rc1); XtManageChild(rc2); XtManageChild(rc); XtVaSetValues(sw, XmNworkWindow, rc, NULL); rc = XmCreateRowColumn(nonl_panel, (char *)"rc", NULL, 0); CreateCommandButtons(rc, 2, but1, label1); XtAddCallback(but1[0], XmNactivateCallback, (XtCallbackProc)do_nonl_proc, (XtPointer)NULL); /* XtAddCallback(but1[1], XmNactivateCallback, (XtCallbackProc) create_nonleval_frame, (XtPointer) NULL); */ XtAddCallback(but1[1], XmNactivateCallback, (XtCallbackProc)destroy_dialog, (XtPointer)nonl_frame); XtManageChild(rc); XtVaSetValues(fr, XmNtopAttachment, XmATTACH_FORM, XmNleftAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_FORM, NULL); XtVaSetValues(sw, XmNtopAttachment, XmATTACH_WIDGET, XmNtopWidget, fr, XmNleftAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_WIDGET, XmNbottomWidget, rc, NULL); XtVaSetValues(rc, XmNleftAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_FORM, NULL); XtManageChild(nonl_panel); } XtRaise(nonl_frame); unset_wait_cursor(); }
void create_file_popup(Widget, XtPointer, XtPointer) { long i; Widget lab, rc, rc2, fr, rb, w[3]; set_wait_cursor(); if (rdata_dialog == NULL) { rdata_dialog = XmCreateFileSelectionDialog(app_shell, (char *)"rdata_dialog", NULL, 0); XtVaSetValues(XtParent(rdata_dialog), XmNtitle, "Read sets", NULL); XtAddCallback(rdata_dialog, XmNcancelCallback, (XtCallbackProc)destroy_dialog, rdata_dialog); XtAddCallback(rdata_dialog, XmNokCallback, rdata_proc, 0); curtype = XY; rc = XmCreateRowColumn(rdata_dialog, (char *)"Read data main RC", NULL, 0); fr = XmCreateFrame(rc, (char *)"frame_1", NULL, 0); rc2 = XmCreateRowColumn(fr, (char *)"Read data main RC", NULL, 0); XtVaSetValues(rc2, XmNorientation, XmHORIZONTAL, NULL); read_ftype_item = CreatePanelChoice(rc2, "File format: ", 16, "X Y", "X Y1 Y2 ... ", "IHL", "Binary", "X Y DX", "X Y DY", "X Y DX1 DX2", "X Y DY1 DY2", "X Y DX DY", "X Y Z", "X HI LO OPEN CLOSE", "X Y RADIUS", "X Y BOX", "Rawspice", "X Y BOXPLOT", NULL, NULL); XtManageChild(rc2); XtManageChild(fr); fr = XmCreateFrame(rc, (char *)"frame_2", NULL, 0); rc2 = XmCreateRowColumn(fr, (char *)"Read data main RC", NULL, 0); XtVaSetValues(rc2, XmNorientation, XmHORIZONTAL, NULL); lab = XmCreateLabel(rc2, (char *)"File Source:", NULL, 0); rb = XmCreateRadioBox(rc2, (char *)"radio_box_2", NULL, 0); XtVaSetValues(rb, XmNorientation, XmHORIZONTAL, NULL); w[0] = XmCreateToggleButton(rb, (char *)"Disk", NULL, 0); w[1] = XmCreateToggleButton(rb, (char *)"Pipe", NULL, 0); for (i = 0; i < 2; i++) { XtAddCallback(w[i], XmNvalueChangedCallback, set_src_proc, (XtPointer)i); } XtManageChild(lab); XtManageChild(rb); XtManageChildren(w, 2); XtManageChild(rc2); XtManageChild(fr); XmToggleButtonSetState(w[0], True, False); fr = XmCreateFrame(rc, (char *)"frame_3", NULL, 0); rc2 = XmCreateRowColumn(fr, (char *)"Read data main RC", NULL, 0); read_graph_item = CreateGraphChoice(rc2, "Read to graph: ", maxgraph, 1); read_auto_item = XmCreateToggleButton(rc2, (char *)"Autoscale on read", NULL, 0); XtManageChild(read_auto_item); XtManageChild(rc2); XtManageChild(fr); XtManageChild(rc); XtManageChild(rc); } XtRaise(rdata_dialog); unset_wait_cursor(); }
void create_featext_frame(Widget w, XtPointer client_data, XtPointer call_data) { int x, y, i; Widget dialog; set_wait_cursor(); if (feui.top == NULL) { char *label2[3]; label2[0] = "Accept"; label2[1] = "Close"; XmGetPos(app_shell, 0, &x, &y); feui.top = XmCreateDialogShell(app_shell, "Feature Extraction", NULL, 0); handle_close(feui.top); XtVaSetValues(feui.top, XmNx, x, XmNy, y, NULL); dialog = XmCreateRowColumn(feui.top, "dialog_rc", NULL, 0); feui.tograph = CreateGraphChoice(dialog, "Results to graph: ", maxgraph, 1); feui.feature_item = CreatePanelChoice0(dialog, "Feature:", 3, 24, "Y minimum", "Y maximum", "Y average", "Y std. dev.", "Y median", "X minimum", "X maximum", "X average", "X std. dev.", "X median", "Frequency", "Period", "Zero crossing", "Rise time", "Fall time", "Slope", "Y intercept", "Set length", "Half maximal width", "Barycenter X", "Barycenter Y", "X(Y max)", "Y(X max)", NULL, 0); feui.xval_item = CreatePanelChoice(dialog, "X values from:", 5, "Index", "Legends", "X from Set", "Y from set", NULL, 0 ); for (i = 0; i < 4; i++) { XtAddCallback(feui.xval_item[2 + i], XmNactivateCallback, (XtCallbackProc) do_fext_toggle, (XtPointer) i); } XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, dialog, NULL); feui.legload_rc= XmCreateRowColumn(dialog, "fext_legload_rc", NULL, 0); feui.absic_graph = CreateGraphChoice(feui.legload_rc, "Abscissa from graph: ",maxgraph,0); for(i=0; i<maxgraph; i++ ) XtAddCallback(feui.absic_graph[2 + i], XmNactivateCallback, (XtCallbackProc) do_gto_setsel_update, (XtPointer) i); feui.absic_set = CreateSetSelector(feui.legload_rc, "set:", SET_SELECT_ACTIVE, FILTER_SELECT_NONE, 0, SELECTION_TYPE_SINGLE); update_save_set_list( feui.absic_set, 0 ); XtManageChild(feui.legload_rc); XtSetSensitive(feui.legload_rc, False); XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, dialog, NULL); CreateCommandButtons(dialog, 2, but2, label2); XtAddCallback(but2[0], XmNactivateCallback, (XtCallbackProc) do_fext_proc,(XtPointer) & feui); XtAddCallback(but2[1], XmNactivateCallback, (XtCallbackProc)destroy_dialog,(XtPointer)feui.top); XtManageChild(dialog); } XtRaise(feui.top); unset_wait_cursor(); }