static void do_axis_proc(Widget w, XtPointer client_data, XtPointer call_data) { Widget wlabel; int x, y; set_wait_cursor(); if (axis_frame == NULL) { char *label1[2]; label1[0] = "Accept"; label1[1] = "Close"; XmGetPos(app_shell, 0, &x, &y); axis_frame = XmCreateDialogShell(app_shell, "Axis props", NULL, 0); handle_close(axis_frame); XtVaSetValues(axis_frame, XmNx, x, XmNy, y, NULL); axis_panel = XmCreateRowColumn(axis_frame, "axis_rc", NULL, 0); wlabel = XtVaCreateManagedWidget("Axis offset (viewport coordinates):", xmLabelWidgetClass, axis_panel, NULL); offx = CreateTextItem2(axis_panel, 10, "Left or bottom:"); offy = CreateTextItem2(axis_panel, 10, "Right or top:"); XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, axis_panel, NULL); CreateCommandButtons(axis_panel, 2, but1, label1); XtAddCallback(but1[0], XmNactivateCallback, (XtCallbackProc) accept_axis_proc, (XtPointer) 0); XtAddCallback(but1[1], XmNactivateCallback, (XtCallbackProc) destroy_dialog, (XtPointer) axis_frame); XtManageChild(axis_panel); } XtRaise(axis_frame); update_axis_items(cg); unset_wait_cursor(); }
/* * Create the draw Frame and the draw Panel */ void create_draw_frame(Widget w, XtPointer client_data, XtPointer call_data) { int x, y; Widget buts[2]; Widget wlabel; set_wait_cursor(); if (draw_frame == NULL) { char *label1[2]; label1[0] = "Accept"; label1[1] = "Close"; XmGetPos(app_shell, 0, &x, &y); draw_frame = XmCreateDialogShell(app_shell, "Draw options", NULL, 0); handle_close(draw_frame); XtVaSetValues(draw_frame, XmNx, x, XmNy, y, NULL); draw_panel = XmCreateRowColumn(draw_frame, "draw_rc", NULL, 0); wlabel = XtVaCreateManagedWidget("Scroll %:", xmLabelWidgetClass, draw_panel, NULL); scrollper_item = XtVaCreateManagedWidget("scroll", xmScaleWidgetClass, draw_panel, XmNwidth, 200, XmNminimum, 0, XmNmaximum, 200, XmNvalue, 0, XmNshowValue, True, XmNprocessingDirection, XmMAX_ON_RIGHT, XmNorientation, XmHORIZONTAL, NULL); linkscroll_item = XtVaCreateManagedWidget("Linked scrolling", xmToggleButtonWidgetClass, draw_panel, NULL); autoredraw_type_item = XtVaCreateManagedWidget("Auto redraw", xmToggleButtonWidgetClass, draw_panel, NULL); autorefresh_type_item = XtVaCreateManagedWidget("Auto refresh", xmToggleButtonWidgetClass, draw_panel, NULL); cursor_type_item = XtVaCreateManagedWidget("Crosshair cursor", xmToggleButtonWidgetClass, draw_panel, NULL); XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, draw_panel, NULL); CreateCommandButtons(draw_panel, 2, buts, label1); XtAddCallback(buts[0], XmNactivateCallback, (XtCallbackProc) define_draw_proc, (XtPointer) 0); XtAddCallback(buts[1], XmNactivateCallback, (XtCallbackProc) destroy_dialog, (XtPointer) draw_frame); XtManageChild(draw_panel); } XtRaise(draw_frame); update_draw(); unset_wait_cursor(); }
void create_editp_frame(Widget w, XtPointer client_data, XtPointer call_data) { int x, y; static Widget top; Widget dialog; set_wait_cursor(); if (top == NULL) { Widget but1[3]; char *label1[3]; label1[0] = "Edit"; label1[1] = "Formula"; label1[2] = "Close"; XmGetPos(app_shell, 0, &x, &y); top = XmCreateDialogShell(app_shell, "Edit/Create set", NULL, 0); handle_close(top); XtVaSetValues(top, XmNx, x, XmNy, y, NULL); dialog = XmCreateRowColumn(top, "dialog_rc", NULL, 0); editp_set_item = CreateSetSelector(dialog, "Edit set:", SET_SELECT_NEXT, FILTER_SELECT_NONE, GRAPH_SELECT_CURRENT, SELECTION_TYPE_SINGLE); XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, dialog, NULL); #ifdef HAVE_LIBXBAE ext_editor_item = XtVaCreateManagedWidget("Use external editor", xmToggleButtonWidgetClass, dialog, NULL); XmToggleButtonSetState( ext_editor_item, False, False ); XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, dialog, NULL); #endif CreateCommandButtons(dialog, 3, but1, label1); XtAddCallback(but1[0], XmNactivateCallback, (XtCallbackProc) edit_set_proc, NULL); XtAddCallback(but1[1], XmNactivateCallback, (XtCallbackProc) create_leval_frame, NULL); XtAddCallback(but1[2], XmNactivateCallback, (XtCallbackProc) destroy_dialog, (XtPointer) top); XtAddCallback(editp_set_item.list, XmNsingleSelectionCallback, (XtCallbackProc) setsel_cred_cb, (XtPointer)but1[1] ); XtManageChild(dialog); } XtRaise(top); unset_wait_cursor(); }
static void do_axisbar_proc(Widget w, XtPointer client_data, XtPointer call_data) { int x, y; set_wait_cursor(); if (axisbar_frame == NULL) { char *label1[2]; label1[0] = "Accept"; label1[1] = "Close"; XmGetPos(app_shell, 0, &x, &y); axisbar_frame = XmCreateDialogShell(app_shell, "Axis bar", NULL, 0); handle_close(axisbar_frame); XtVaSetValues(axisbar_frame, XmNx, x, XmNy, y, NULL); axisbar_panel = XmCreateRowColumn(axisbar_frame, "axisbar_rc", NULL, 0); barcolor = CreateColorChoice(axisbar_panel, "Color:", 0); barlinew = CreatePanelChoice(axisbar_panel, "Line width:", 10, "1", "2", "3", "4", "5", "6", "7", "8", "9", 0, 0); barlines = (Widget *) CreatePanelChoice(axisbar_panel, "Line style:", 6, "Solid line", "Dotted line", "Dashed line", "Long Dashed", "Dot-dashed", NULL, NULL); XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, axisbar_panel, NULL); CreateCommandButtons(axisbar_panel, 2, but1, label1); XtAddCallback(but1[0], XmNactivateCallback, (XtCallbackProc) accept_axisbar_proc, (XtPointer) 0); XtAddCallback(but1[1], XmNactivateCallback, (XtCallbackProc) destroy_dialog, (XtPointer) axisbar_frame); XtManageChild(axisbar_panel); } XtRaise(axisbar_frame); update_axisbar_items(cg); unset_wait_cursor(); }
/* * Create the label Frame and the label Panel */ void create_label_frame(Widget, XtPointer, XtPointer) { int x, y; set_wait_cursor(); if (label_frame == NULL) { Widget buts[3]; char *label1[3]; label1[0] = (char *)"Accept"; label1[1] = (char *)"Props..."; label1[2] = (char *)"Close"; XmGetPos(app_shell, 0, &x, &y); label_frame = XmCreateDialogShell(app_shell, (char *)"Title/Subtitle", NULL, 0); handle_close(label_frame); XtVaSetValues(label_frame, XmNx, x, XmNy, y, NULL); label_panel = XtVaCreateWidget("label panel", xmRowColumnWidgetClass, label_frame, NULL); label_title_text_item = CreateTextItem2(label_panel, 30, "Title:"); label_subtitle_text_item = CreateTextItem2(label_panel, 30, "Subtitle:"); XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, label_panel, NULL); CreateCommandButtons(label_panel, 3, buts, label1); XtAddCallback(buts[0], XmNactivateCallback, (XtCallbackProc)label_define_notify_proc, (XtPointer)NULL); XtAddCallback(buts[1], XmNactivateCallback, (XtCallbackProc)label_props_notify_proc, (XtPointer)NULL); XtAddCallback(buts[2], XmNactivateCallback, (XtCallbackProc)destroy_dialog, (XtPointer)label_frame); XtManageChild(label_panel); } XtRaise(label_frame); update_label_proc(); unset_wait_cursor(); }
void create_netcdfs_popup(Widget, XtPointer, XtPointer) { int x, y; static Widget top, dialog; Widget wbut, lab, rc, rcl, rc1, rc2, form; Arg args[3]; set_wait_cursor(); if (top == NULL) { char *label1[5]; Widget but1[5]; label1[0] = (char *)"Accept"; label1[1] = (char *)"Files..."; label1[2] = (char *)"Update"; label1[3] = (char *)"Query"; label1[4] = (char *)"Close"; XmGetPos(app_shell, 0, &x, &y); #ifdef HAVE_MFHDF top = XmCreateDialogShell(app_shell, (char *)"netCDF/HDF", NULL, 0); #else #ifdef HAVE_NETCDF top = XmCreateDialogShell(app_shell, (char *)"netCDF", NULL, 0); #endif #endif handle_close(top); XtVaSetValues(top, XmNx, x, XmNy, y, NULL); dialog = XmCreateRowColumn(top, (char *)"dialog_rc", NULL, 0); /* form = XmCreateForm(dialog, "form", NULL, 0); */ form = XmCreateRowColumn(dialog, (char *)"form", NULL, 0); XtVaSetValues(form, XmNpacking, XmPACK_COLUMN, XmNnumColumns, 1, XmNorientation, XmHORIZONTAL, XmNisAligned, True, XmNadjustLast, False, XmNentryAlignment, XmALIGNMENT_END, NULL); XtSetArg(args[0], XmNlistSizePolicy, XmRESIZE_IF_POSSIBLE); XtSetArg(args[1], XmNvisibleItemCount, 5); rc1 = XmCreateRowColumn(form, (char *)"rc1", NULL, 0); lab = XmCreateLabel(rc1, (char *)"Select set X:", NULL, 0); XtManageChild(lab); netcdf_listx_item = XmCreateScrolledList(rc1, (char *)"list", args, 2); XtManageChild(netcdf_listx_item); XtManageChild(rc1); rc2 = XmCreateRowColumn(form, (char *)"rc2", NULL, 0); lab = XmCreateLabel(rc2, (char *)"Select set Y:", NULL, 0); XtManageChild(lab); netcdf_listy_item = XmCreateScrolledList(rc2, (char *)"list", args, 2); XtManageChild(netcdf_listy_item); XtManageChild(rc2); XtManageChild(form); netcdf_file_item = CreateTextItem2(dialog, 30, "netCDF file:"); netcdf_set_item = CreateSetChoice(dialog, "Read to set:", maxplot, 4); netcdf_auto_item = XmCreateToggleButton(dialog, "Autoscale on read", NULL, 0); XtManageChild(netcdf_auto_item); XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, dialog, NULL); CreateCommandButtons(dialog, 5, but1, label1); XtAddCallback(but1[0], XmNactivateCallback, (XtCallbackProc)do_netcdf_proc, (XtPointer)NULL); XtAddCallback(but1[1], XmNactivateCallback, (XtCallbackProc)create_netcdffiles_popup, (XtPointer)NULL); XtAddCallback(but1[2], XmNactivateCallback, (XtCallbackProc)do_netcdfupdate_proc, (XtPointer)NULL); XtAddCallback(but1[3], XmNactivateCallback, (XtCallbackProc)do_netcdfquery_proc, (XtPointer)NULL); XtAddCallback(but1[4], XmNactivateCallback, (XtCallbackProc)destroy_dialog, (XtPointer)top); XtManageChild(dialog); netcdf_frame = top; if (strlen(netcdf_name)) { xv_setstr(netcdf_file_item, netcdf_name); } } update_netcdfs(); XtRaise(top); unset_wait_cursor(); }
static void label_props_notify_proc(Widget, XtPointer, XtPointer) { Widget wlabel, rc, rc2, rc3, fr; int x, y; set_wait_cursor(); if (labelprops_frame == NULL) { Widget buts[2]; char *label1[2]; label1[0] = (char *)"Accept"; label1[1] = (char *)"Close"; XmGetPos(app_shell, 0, &x, &y); labelprops_frame = XmCreateDialogShell(app_shell, (char *)"Title/Subtitle props", NULL, 0); handle_close(labelprops_frame); XtVaSetValues(labelprops_frame, XmNx, x, XmNy, y, NULL); labelprops_panel = XtVaCreateWidget("labelprops panel", xmRowColumnWidgetClass, labelprops_frame, NULL); rc = XmCreateRowColumn(labelprops_panel, (char *)"rc", NULL, 0); XtVaSetValues(rc, XmNorientation, XmHORIZONTAL, NULL); fr = XtVaCreateManagedWidget("frame", xmFrameWidgetClass, rc, NULL); rc2 = XtVaCreateManagedWidget("rc2", xmRowColumnWidgetClass, fr, NULL); XtVaCreateManagedWidget("Title:", xmLabelWidgetClass, rc2, NULL); title_font_item = CreatePanelChoice(rc2, "Font:", 11, "Times-Roman", "Times-Bold", "Times-Italic", "Times-BoldItalic", "Helvetica", "Helvetica-Bold", "Helvetica-Oblique", "Helvetica-BoldOblique", "Greek", "Symbol", 0, 0); wlabel = XtVaCreateManagedWidget("Character size:", xmLabelWidgetClass, rc2, NULL); title_size_item = XtVaCreateManagedWidget("stringsize", xmScaleWidgetClass, rc2, XmNminimum, 0, XmNmaximum, 400, XmNvalue, 100, XmNshowValue, True, XmNprocessingDirection, XmMAX_ON_RIGHT, XmNorientation, XmHORIZONTAL, NULL); rc3 = XmCreateRowColumn(rc2, (char *)"rc3", NULL, 0); XtVaSetValues(rc3, XmNorientation, XmHORIZONTAL, NULL); title_color_item = CreateColorChoice(rc3, "Color:", 0); title_linew_item = CreatePanelChoice(rc3, "Width:", 10, "1", "2", "3", "4", "5", "6", "7", "8", "9", 0, 0); XtManageChild(rc3); XtManageChild(rc2); XtManageChild(fr); fr = XtVaCreateManagedWidget("frame", xmFrameWidgetClass, rc, NULL); rc2 = XtVaCreateManagedWidget("rc2", xmRowColumnWidgetClass, fr, NULL); wlabel = XtVaCreateManagedWidget("Subtitle:", xmLabelWidgetClass, rc2, NULL); stitle_font_item = CreatePanelChoice(rc2, "Font:", 11, "Times-Roman", "Times-Bold", "Times-Italic", "Times-BoldItalic", "Helvetica", "Helvetica-Bold", "Helvetica-Oblique", "Helvetica-BoldOblique", "Greek", "Symbol", 0, 0); wlabel = XtVaCreateManagedWidget("Character size:", xmLabelWidgetClass, rc2, NULL); stitle_size_item = XtVaCreateManagedWidget("stringsize", xmScaleWidgetClass, rc2, XmNminimum, 0, XmNmaximum, 400, XmNvalue, 100, XmNshowValue, True, XmNprocessingDirection, XmMAX_ON_RIGHT, XmNorientation, XmHORIZONTAL, NULL); rc3 = XmCreateRowColumn(rc2, (char *)"rc3", NULL, 0); XtVaSetValues(rc3, XmNorientation, XmHORIZONTAL, NULL); stitle_color_item = CreateColorChoice(rc3, "Color:", 0); stitle_linew_item = CreatePanelChoice(rc3, "Width:", 10, "1", "2", "3", "4", "5", "6", "7", "8", "9", 0, 0); XtManageChild(rc3); XtManageChild(rc2); XtManageChild(fr); XtManageChild(rc); CreateCommandButtons(labelprops_panel, 2, buts, label1); XtAddCallback(buts[0], XmNactivateCallback, (XtCallbackProc)labelprops_define_notify_proc, (XtPointer)NULL); XtAddCallback(buts[1], XmNactivateCallback, (XtCallbackProc)destroy_dialog, (XtPointer)labelprops_frame); XtManageChild(labelprops_panel); } update_labelprops_proc(); XtRaise(labelprops_frame); unset_wait_cursor(); }
/* 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(); }
/* ARGSUSED */ void create_nonl_frame(Widget w, XtPointer client_data, XtPointer call_data) { int i; Widget sw, fr, title_fr, fr1, fr3, rc, rc1, rc2, rc3, lab, fitbut[4], but1[2]; Widget menubar, menupane, submenupane, cascade; set_wait_cursor(); if (nonl_frame == NULL) { char *fitlabel[4]; char *blabel[2]; fitlabel[0] = "Load as is"; fitlabel[1] = "Run 5 steps"; fitlabel[2] = "Run 20 steps"; fitlabel[3] = "Run 100 steps"; blabel[0] = "Accept"; blabel[1] = "Cancel"; nonl_frame = XmCreateDialogShell(app_shell, "Non-linear curve fitting", NULL, 0); handle_close(nonl_frame); nonl_panel = XmCreateForm(nonl_frame, "nonl_frame_rc", NULL, 0); menubar = CreateMenuBar(nonl_panel, "nonlMenuBar", NULL); menupane = CreateMenu(menubar, "nonlFileMenu", "File", 'F', NULL, NULL); CreateMenuButton(menupane, "open", "Open...", 'O', (XtCallbackProc) create_openfit_popup, (XtPointer) NULL, NULL); CreateMenuButton(menupane, "save", "Save...", 'S', (XtCallbackProc) create_savefit_popup, (XtPointer) NULL, NULL); CreateMenuSeparator(menupane, "sep1"); CreateMenuButton(menupane, "close", "Close", 'C', (XtCallbackProc) destroy_nonl_frame, (XtPointer) NONL_ACCEPT, NULL); menupane = CreateMenu(menubar, "nonlDataMenu", "Data", 'D', NULL, NULL); CreateMenuButton(menupane, "reset", "Reset", 'R', (XtCallbackProc) reset_nonl_frame, (XtPointer) NULL, 0); CreateMenuButton(menupane, "update", "Update", 'U', (XtCallbackProc) update_nonl_frame, (XtPointer) NULL, 0); menupane = CreateMenu(menubar, "nonlOptionsMenu", "Options", 'O', NULL, NULL); submenupane = CreateMenu(menupane, "nonlLoadMenu", "Load", 'L', NULL, NULL); nonl_load_item[0] = CreateMenuToggle(submenupane, "values", "Fitted values", 'v', (XtCallbackProc) do_nonl_toggle, (XtPointer) 0, NULL); nonl_load_item[1] = CreateMenuToggle(submenupane, "residuals", "Residuals", 'R', (XtCallbackProc) do_nonl_toggle, (XtPointer) 1, NULL); nonl_load_item[2] = CreateMenuToggle(submenupane, "function", "Function", 'F', (XtCallbackProc) do_nonl_toggle, (XtPointer) 2, NULL); nonl_autol_item = CreateMenuToggle(menupane, "autoload", "Autoload", 'A', (XtCallbackProc) NULL, (XtPointer) NULL, NULL); menupane = CreateMenu(menubar, "nonlHelpMenu", "Help", 'H', &cascade, NULL); XtVaSetValues(menubar, XmNmenuHelpWidget, cascade, NULL); CreateMenuButton(menupane, "onFit", "On fit", 'f', (XtCallbackProc) HelpCB, (XtPointer) "trans.html#nlcurve", 0); CreateMenuButton(menupane, "onContext", "On context", 'x', (XtCallbackProc) ContextHelpCB, (XtPointer) NULL, 0); XtManageChild(menubar); XtVaSetValues(menubar, XmNtopAttachment, XmATTACH_FORM, XmNleftAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_FORM, NULL); fr1 = XmCreateFrame(nonl_panel, "nonl_frame", NULL, 0); nonl_set_item = CreateSetSelector(fr1, "Apply to set:", SET_SELECT_ACTIVE, FILTER_SELECT_NONE, GRAPH_SELECT_CURRENT, SELECTION_TYPE_SINGLE); XtManageChild(fr1); XtVaSetValues(fr1, XmNtopAttachment, XmATTACH_WIDGET, XmNtopWidget, menubar, XmNleftAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_FORM, NULL); fr = XmCreateFrame(nonl_panel, "nonl_frame", NULL, 0); rc = XmCreateRowColumn(fr, "nonl_rc", NULL, 0); title_fr = XmCreateFrame(rc, "nonl_title_frame", NULL, 0); XtVaSetValues(title_fr, XmNshadowType, XmSHADOW_ETCHED_OUT, NULL); nonl_title_item = XmCreateLabel(title_fr, nonl_opts.title, NULL, 0); XtManageChild(nonl_title_item); XtManageChild(title_fr); nonl_formula_item = (Widget) CreateTextItem2(rc, 35, "Formula:"); rc1 = XmCreateRowColumn(rc, "nonl_rc", NULL, 0); XtVaSetValues(rc1, XmNorientation, XmHORIZONTAL, NULL); nonl_nparm_item = CreatePanelChoice(rc1, "Number of parameters:", 12, "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", NULL, NULL); for (i = 0; i < MAXPARM + 1; i++) { XtAddCallback(nonl_nparm_item[2 + i], XmNactivateCallback, (XtCallbackProc) do_nparm_toggle, (XtPointer) i); } nonl_tol_item = CreateTextItem2(rc1, 10, "Tolerance:"); XtManageChild(rc1); sw = XtVaCreateManagedWidget("sw", xmScrolledWindowWidgetClass, rc, XmNheight, 180, XmNscrollingPolicy, XmAUTOMATIC, NULL); rc2 = XmCreateRowColumn(sw, "rc2", NULL, 0); for (i = 0; i < MAXPARM; i++) { nonl_parm_item[i] = XmCreateRowColumn(rc2, "rc1", NULL, 0); XtVaSetValues(nonl_parm_item[i], XmNorientation, XmHORIZONTAL, NULL); sprintf(buf, "A%1d: ", i); nonl_value_item[i] = CreateTextItem2(nonl_parm_item[i], 10, buf); nonl_constr_item[i] = XmCreateToggleButton(nonl_parm_item[i], "Bounds:", NULL, 0); XtAddCallback(nonl_constr_item[i], XmNvalueChangedCallback, (XtCallbackProc) do_constr_toggle, (XtPointer) i); XtManageChild(nonl_constr_item[i]); nonl_lowb_item[i] = CreateTextItem2(nonl_parm_item[i], 6, ""); sprintf(buf, "< A%1d < ", i); lab = XmCreateLabel(nonl_parm_item[i], buf, NULL, 0); XtManageChild(lab); nonl_uppb_item[i] = CreateTextItem2(nonl_parm_item[i], 6, ""); XtManageChild(nonl_parm_item[i]); } XtManageChild(rc2); XtManageChild(rc); XtManageChild(fr); XtVaSetValues(fr, XmNtopAttachment, XmATTACH_WIDGET, XmNtopWidget, fr1, XmNleftAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_FORM, NULL); fr3 = XmCreateFrame(nonl_panel, "nonl_frame", NULL, 0); rc3 = XmCreateRowColumn(fr3, "rc3", NULL, 0); CreateCommandButtons(rc3, 4, fitbut, fitlabel); XtAddCallback(fitbut[0], XmNactivateCallback, (XtCallbackProc) do_nonl_proc, (XtPointer) (0)); XtAddCallback(fitbut[1], XmNactivateCallback, (XtCallbackProc) do_nonl_proc, (XtPointer) (5)); XtAddCallback(fitbut[2], XmNactivateCallback, (XtCallbackProc) do_nonl_proc, (XtPointer) (20)); XtAddCallback(fitbut[3], XmNactivateCallback, (XtCallbackProc) do_nonl_proc, (XtPointer) (100)); XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, rc3, NULL); nonl_fload_rc = XmCreateRowColumn(rc3, "nonl_fload_rc", NULL, 0); XtVaSetValues(nonl_fload_rc, XmNorientation, XmHORIZONTAL, NULL); nonl_start_item = CreateTextItem2(nonl_fload_rc, 6, "Start load at:"); nonl_stop_item = CreateTextItem2(nonl_fload_rc, 6, "Stop load at:"); nonl_npts_item = CreateTextItem2(nonl_fload_rc, 4, "# of points:"); XtManageChild(nonl_fload_rc); XtSetSensitive(nonl_fload_rc, False); CreateCommandButtons(rc3, 2, but1, blabel); XtAddCallback(but1[0], XmNactivateCallback, (XtCallbackProc) destroy_nonl_frame, (XtPointer) NONL_ACCEPT); XtAddCallback(but1[1], XmNactivateCallback, (XtCallbackProc) destroy_nonl_frame, (XtPointer) NONL_CANCEL); XtManageChild(rc3); XtManageChild(fr3); XtVaSetValues(fr3, XmNtopAttachment, XmATTACH_WIDGET, XmNtopWidget, fr, XmNleftAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_FORM, NULL); XtManageChild(nonl_panel); } update_nonl_frame(); XtRaise(nonl_frame); unset_wait_cursor(); }
static void do_ticklabels_proc(Widget w, XtPointer client_data, XtPointer call_data) { Widget wlabel, rc; int x, y; set_wait_cursor(); if (ticklabel_frame == NULL) { char *label1[2]; label1[0] = "Accept"; label1[1] = "Close"; XmGetPos(app_shell, 0, &x, &y); ticklabel_frame = XmCreateDialogShell(app_shell, "Tick labels", NULL, 0); handle_close(ticklabel_frame); XtVaSetValues(ticklabel_frame, XmNx, x, XmNy, y, NULL); ticklabel_panel = XmCreateRowColumn(ticklabel_frame, "ticklabel_rc", NULL, 0); tlfont = CreatePanelChoice(ticklabel_panel, "Font:", 11, "Times-Roman", "Times-Bold", "Times-Italic", "Times-BoldItalic", "Helvetica", "Helvetica-Bold", "Helvetica-Oblique", "Helvetica-BoldOblique", "Greek", "Symbol", 0, 0); rc = XmCreateRowColumn(ticklabel_panel, "rc", NULL, 0); XtVaSetValues(rc, XmNorientation, XmHORIZONTAL, NULL); tlcolor = CreateColorChoice(rc, "Color:", 0); tllinew = CreatePanelChoice(rc, "Line width:", 10, "1", "2", "3", "4", "5", "6", "7", "8", "9", 0, 0); XtManageChild(rc); rc = XmCreateRowColumn(ticklabel_panel, "rc", NULL, 0); XtVaSetValues(rc, XmNorientation, XmHORIZONTAL, NULL); wlabel = XtVaCreateManagedWidget("Char size:", xmLabelWidgetClass, rc, NULL); tlcharsize = XtVaCreateManagedWidget("stringsize", xmScaleWidgetClass, rc, XmNminimum, 0, XmNmaximum, 400, XmNvalue, 0, XmNshowValue, True, XmNprocessingDirection, XmMAX_ON_RIGHT, XmNorientation, XmHORIZONTAL, NULL); XtManageChild(rc); XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, ticklabel_panel, NULL); tlform = CreatePanelChoice0(ticklabel_panel, "Format:", 4, 30, "Decimal", "Exponential", "Power", "General", "DD-MM-YY", "MM-DD-YY", "YY-MM-DD", "MM-YY", "MM-DD", "Month-DD", "DD-Month", "Month (abrev.)", "Month (abrev.)-YY", "Month", "Day of week (abrev.)", "Day of week", "Day of year", "HH:MM:SS.s", "MM-DD HH:MM:SS.s", "MM-DD-YY HH:MM:SS.s", "YY-MM-DD HH:MM:SS.s", "Degrees (lon)", "DD MM' (lon)", "DD MM' SS.s\" (lon)", "MM' SS.s\" (lon)", "Degrees (lat)", "DD MM' (lat)", "DD MM' SS.s\" (lat)", "MM' SS.s\" (lat)", 0, 0); tlprec = CreatePanelChoice(ticklabel_panel, "Precision:", 11, "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", 0, 0); tlappstr = CreateTextItem2(ticklabel_panel, 10, "Append to labels:"); tlprestr = CreateTextItem2(ticklabel_panel, 10, "Prepend to labels:"); XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, ticklabel_panel, NULL); tlstagger = CreatePanelChoice(ticklabel_panel, "Stagger labels:", 11, "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", 0, 0); tlskip = CreatePanelChoice(ticklabel_panel, "Skip every:", 11, "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", 0, 0); XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, ticklabel_panel, NULL); rc = XmCreateRowColumn(ticklabel_panel, "rc", NULL, 0); XtVaSetValues(rc, XmNorientation, XmHORIZONTAL, NULL); tlstarttype = CreatePanelChoice(rc, "Start labels at:", 3, "Graph min", "Specified:", 0, 0); tlstart = XtVaCreateManagedWidget("tlstart", xmTextWidgetClass, rc, XmNtraversalOn, True, XmNcolumns, 10, NULL); XtManageChild(rc); rc = XmCreateRowColumn(ticklabel_panel, "rc", NULL, 0); XtVaSetValues(rc, XmNorientation, XmHORIZONTAL, NULL); tlstoptype = CreatePanelChoice(rc, "Stop labels at:", 3, "Graph max", "Specified:", 0, 0); tlstop = XtVaCreateManagedWidget("tlstop", xmTextWidgetClass, rc, XmNtraversalOn, True, XmNcolumns, 10, NULL); XtManageChild(rc); tlloc = (Widget *) CreatePanelChoice(ticklabel_panel, "Location:", 3, "On ticks", "Between ticks", NULL, NULL); rc = XmCreateRowColumn(ticklabel_panel, "rc", NULL, 0); XtVaSetValues(rc, XmNorientation, XmHORIZONTAL, NULL); tllayout = (Widget *) CreatePanelChoice(rc, "Layout:", 4, "Horizontal", "Vertical", "Specified (degrees):", NULL, NULL); tlangle = XtVaCreateManagedWidget("ticklangle", xmScaleWidgetClass, rc, XmNminimum, 0, XmNmaximum, 360, XmNvalue, 100, XmNshowValue, True, XmNprocessingDirection, XmMAX_ON_RIGHT, XmNorientation, XmHORIZONTAL, NULL); XtManageChild(rc); XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, ticklabel_panel, NULL); ticklop = CreatePanelChoice(ticklabel_panel, "Draw tick labels on:", 4, "Normal side", "Opposite side", "Both", 0, 0); tlsign = CreatePanelChoice(ticklabel_panel, "Sign of label:", 4, "As is", "Absolute value", "Negate", NULL, 0); ticklabel_applyto = CreatePanelChoice(ticklabel_panel, "Apply to:", 5, "Current axis", "All axes, current graph", "Current axis, all graphs", "All axes, all graphs", NULL, 0); XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, ticklabel_panel, NULL); CreateCommandButtons(ticklabel_panel, 2, but1, label1); XtAddCallback(but1[0], XmNactivateCallback, (XtCallbackProc) accept_ticklabel_proc, (XtPointer) 0); XtAddCallback(but1[1], XmNactivateCallback, (XtCallbackProc) destroy_dialog, (XtPointer) ticklabel_frame); XtManageChild(ticklabel_panel); } XtRaise(ticklabel_frame); update_ticklabel_items(cg); unset_wait_cursor(); }
static void do_axislabel_proc(Widget w, XtPointer client_data, XtPointer call_data) { Widget wlabel, rc; int x, y; set_wait_cursor(); if (axislabel_frame == NULL) { char *label1[2]; label1[0] = "Accept"; label1[1] = "Close"; XmGetPos(app_shell, 0, &x, &y); axislabel_frame = XmCreateDialogShell(app_shell, "Axis label", NULL, 0); handle_close(axislabel_frame); XtVaSetValues(axislabel_frame, XmNx, x, XmNy, y, NULL); axislabel_panel = XmCreateRowColumn(axislabel_frame, "axislabel_rc", NULL, 0); axislabellayout = (Widget *) CreatePanelChoice(axislabel_panel, "Axis layout:", 3, "Parallel to axis", "Perpendicular to axis", NULL, NULL); axislabelplace = (Widget *) CreatePanelChoice(axislabel_panel, "Axis label location:", 3, "Auto", "Specified", NULL, NULL); axislabelspec = CreateTextItem2(axislabel_panel, 10, "Location:"); axislabelfont = CreatePanelChoice(axislabel_panel, "Font:", 11, "Times-Roman", "Times-Bold", "Times-Italic", "Times-BoldItalic", "Helvetica", "Helvetica-Bold", "Helvetica-Oblique", "Helvetica-BoldOblique", "Greek", "Symbol", 0, 0); rc = XmCreateRowColumn(axislabel_panel, "rc", NULL, 0); XtVaSetValues(rc, XmNorientation, XmHORIZONTAL, NULL); axislabelcolor = CreateColorChoice(rc, "Color:", 0); axislabellinew = CreatePanelChoice(rc, "Line width:", 10, "1", "2", "3", "4", "5", "6", "7", "8", "9", 0, 0); XtManageChild(rc); wlabel = XtVaCreateManagedWidget("Size:", xmLabelWidgetClass, axislabel_panel, NULL); axislabelcharsize = XtVaCreateManagedWidget("stringsize", xmScaleWidgetClass, axislabel_panel, XmNminimum, 0, XmNmaximum, 400, XmNvalue, 100, XmNshowValue, True, XmNprocessingDirection, XmMAX_ON_RIGHT, XmNorientation, XmHORIZONTAL, NULL); XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, axislabel_panel, NULL); CreateCommandButtons(axislabel_panel, 2, but1, label1); XtAddCallback(but1[0], XmNactivateCallback, (XtCallbackProc) accept_axislabel_proc, (XtPointer) 0); XtAddCallback(but1[1], XmNactivateCallback, (XtCallbackProc) destroy_dialog, (XtPointer) axislabel_frame); XtManageChild(axislabel_panel); } XtRaise(axislabel_frame); update_axislabel_items(cg); unset_wait_cursor(); }
/* * Create the ticks popup */ void create_ticks_frame(Widget w, XtPointer client_data, XtPointer call_data) { Widget wbut, rc; int x, y; int i; set_wait_cursor(); if (ticks_frame == NULL) { char *label1[2]; label1[0] = "Accept"; label1[1] = "Close"; XmGetPos(app_shell, 0, &x, &y); ticks_frame = XmCreateDialogShell(app_shell, "Axes", NULL, 0); handle_close(ticks_frame); XtVaSetValues(ticks_frame, XmNx, x, XmNy, y, NULL); ticks_panel = XmCreateRowColumn(ticks_frame, "ticks_rc", NULL, 0); editaxis = (Widget *) CreatePanelChoice(ticks_panel, "Edit:", 5, "X axis", "Y axis", "Zero X axis", "Zero Y axis", NULL, NULL); for (i = 0; i < 4; i++) { XtAddCallback(editaxis[2 + i], XmNactivateCallback, (XtCallbackProc) set_axis_proc, (XtPointer) (intptr_t) i); } XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, ticks_panel, NULL); axislabel = CreateTextItem2(ticks_panel, 30, "Axis label:"); XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, ticks_panel, NULL); tmajor = CreateTextItem2(ticks_panel, 10, "Major tick spacing:"); tminor = CreateTextItem2(ticks_panel, 10, "Minor tick spacing:"); XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, ticks_panel, NULL); tlonoff = XtVaCreateManagedWidget("Display tick labels", xmToggleButtonWidgetClass, ticks_panel, NULL); tonoff = XtVaCreateManagedWidget("Display tick marks", xmToggleButtonWidgetClass, ticks_panel, NULL); baronoff = XtVaCreateManagedWidget("Display axis bar", xmToggleButtonWidgetClass, ticks_panel, NULL); XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, ticks_panel, NULL); rc = XmCreateRowColumn(ticks_panel, "rc", NULL, 0); XtVaSetValues(rc, XmNorientation, XmHORIZONTAL, NULL); wbut = XtVaCreateManagedWidget("Axis props...", xmPushButtonWidgetClass, rc, NULL); XtAddCallback(wbut, XmNactivateCallback, (XtCallbackProc) do_axis_proc, (XtPointer) 0); wbut = XtVaCreateManagedWidget("Axis label...", xmPushButtonWidgetClass, rc, NULL); XtAddCallback(wbut, XmNactivateCallback, (XtCallbackProc) do_axislabel_proc, (XtPointer) 0); wbut = XtVaCreateManagedWidget("Tick labels...", xmPushButtonWidgetClass, rc, NULL); XtAddCallback(wbut, XmNactivateCallback, (XtCallbackProc) do_ticklabels_proc, (XtPointer) 0); XtManageChild(rc); rc = XmCreateRowColumn(ticks_panel, "rc", NULL, 0); XtVaSetValues(rc, XmNorientation, XmHORIZONTAL, NULL); wbut = XtVaCreateManagedWidget("Tick marks...", xmPushButtonWidgetClass, rc, NULL); XtAddCallback(wbut, XmNactivateCallback, (XtCallbackProc) do_tickmarks_proc, (XtPointer) 0); wbut = XtVaCreateManagedWidget("Axis bar...", xmPushButtonWidgetClass, rc, NULL); XtAddCallback(wbut, XmNactivateCallback, (XtCallbackProc) do_axisbar_proc, (XtPointer) 0); wbut = XtVaCreateManagedWidget("User ticks/tick labels...", xmPushButtonWidgetClass, rc, NULL); XtAddCallback(wbut, XmNactivateCallback, (XtCallbackProc) do_special_proc, (XtPointer) 0); XtManageChild(rc); XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, ticks_panel, NULL); axis_applyto = (Widget *) CreatePanelChoice(ticks_panel, "Apply to:", 5, "Current axis", "All axes, current graph", "Current axis, all graphs", "All axes, all graphs", NULL, NULL); XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, ticks_panel, NULL); CreateCommandButtons(ticks_panel, 2, but1, label1); XtAddCallback(but1[0], XmNactivateCallback, (XtCallbackProc) ticks_define_notify_proc, (XtPointer) 0); XtAddCallback(but1[1], XmNactivateCallback, (XtCallbackProc) destroy_dialog, (XtPointer) ticks_frame); XtManageChild(ticks_panel); } XtRaise(ticks_frame); update_ticks(cg); unset_wait_cursor(); }
static void do_special_proc(Widget w, XtPointer client_data, XtPointer call_data) { Widget wlabel, rc, rc3, sw; int i, x, y; char buf[10]; set_wait_cursor(); if (special_frame == NULL) { char *label1[2]; label1[0] = "Accept"; label1[1] = "Close"; XmGetPos(app_shell, 0, &x, &y); special_frame = XmCreateDialogShell(app_shell, "Specified ticks/ticklabels", NULL, 0); handle_close(special_frame); XtVaSetValues(special_frame, XmNx, x, XmNy, y, NULL); special_panel = XmCreateForm(special_frame, "special_form", NULL, 0); rc = XmCreateRowColumn(special_panel, "rc", NULL, 0); specticks = XtVaCreateManagedWidget("Use special tick locations", xmToggleButtonWidgetClass, rc, NULL); specticklabels = XtVaCreateManagedWidget("Use special tick labels", xmToggleButtonWidgetClass, rc, NULL); nspec = CreateTextItem2(rc, 10, "# of user ticks/labels to use:"); wlabel = XtVaCreateManagedWidget("Tick location - Label:", xmLabelWidgetClass, rc, NULL); XtManageChild(rc); XtVaSetValues(rc, XmNleftAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_FORM, XmNtopAttachment, XmATTACH_FORM, NULL); sw = XtVaCreateManagedWidget("sw", xmScrolledWindowWidgetClass, special_panel, XmNscrollingPolicy, XmAUTOMATIC, XmNtopAttachment, XmATTACH_WIDGET, XmNtopWidget, rc, XmNleftAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_FORM, NULL); rc = XmCreateRowColumn(sw, "rc", NULL, 0); XtVaSetValues(sw, XmNworkWindow, rc, NULL); for (i = 0; i < MAX_TICK_LABELS; i++) { rc3 = XmCreateRowColumn(rc, "rc3", NULL, 0); XtVaSetValues(rc3, XmNorientation, XmHORIZONTAL, NULL); sprintf(buf, "%2d", i + 1); specnum[i] = XtVaCreateManagedWidget(buf, xmLabelWidgetClass, rc3, NULL); specloc[i] = XtVaCreateManagedWidget("tickmark", xmTextFieldWidgetClass, rc3, XmNcolumns, 10, NULL); speclabel[i] = XtVaCreateManagedWidget("ticklabel", xmTextFieldWidgetClass, rc3, XmNcolumns, 35, NULL); XtManageChild(rc3); } XtManageChild(rc); XtManageChild(sw); rc = XmCreateRowColumn(special_panel, "rc", NULL, 0); XtVaSetValues(rc, XmNorientation, XmHORIZONTAL, NULL); CreateCommandButtons(rc, 2, but1, label1); XtAddCallback(but1[0], XmNactivateCallback, (XtCallbackProc) accept_special_proc, (XtPointer) 0); XtAddCallback(but1[1], XmNactivateCallback, (XtCallbackProc) destroy_dialog, (XtPointer) special_frame); XtManageChild(rc); XtVaSetValues(rc, XmNleftAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_FORM, NULL); XtVaSetValues(sw, XmNbottomAttachment, XmATTACH_WIDGET, XmNbottomWidget, rc, NULL); load_special(cg, curaxis); XtManageChild(special_panel); } XtRaise(special_frame); update_special_items(cg); unset_wait_cursor(); }
void do_props_proc(Widget w, XtPointer client_data, XtPointer call_data) { int x, y; static Widget top, acceptcallback; Widget dialog; EditPoints *ep = (EditPoints *) client_data; set_wait_cursor(); if (top == NULL) { Widget but1[2]; char *label1[2]; label1[0] = "Accept"; label1[1] = "Close"; XmGetPos(app_shell, 0, &x, &y); top = XmCreateDialogShell(app_shell, "Edit set props", NULL, 0); handle_close(top); XtVaSetValues(top, XmNx, x, XmNy, y, NULL); dialog = XmCreateRowColumn(top, "dialog_rc", NULL, 0); editp_col_item = CreatePanelChoice(dialog, "Apply to column:", 8, "1", "2", "3", "4", "5", "6", "All", NULL, 0); editp_format_item = CreatePanelChoice(dialog, "Format:", 4, "Decimal", "General", "Exponential", NULL, 0); editp_precision_item = CreatePanelChoice(dialog, "Precision:", 16, "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", NULL, 0); editp_width_item = CreatePanelChoice0(dialog, "Width:", 5, 21, "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", NULL, 0); XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, dialog, NULL); CreateCommandButtons(dialog, 2, but1, label1); XtAddCallback(but1[0], XmNactivateCallback, (XtCallbackProc) do_accept_props, (XtPointer) ep); XtAddCallback(but1[1], XmNactivateCallback, (XtCallbackProc) destroy_dialog, (XtPointer) top); XtManageChild(dialog); acceptcallback = but1[0]; } XtRemoveAllCallbacks(acceptcallback, XmNactivateCallback); XtAddCallback(acceptcallback, XmNactivateCallback, (XtCallbackProc) do_accept_props, (XtPointer) ep); update_props(ep); XtRaise(top); unset_wait_cursor(); }
void create_hotlinks_popup(Widget, XtPointer, XtPointer) { int x, y; static Widget top, dialog; Arg args[3]; set_wait_cursor(); if (top == NULL) { char *label1[5]; Widget but1[5]; label1[0] = (char *)"Link"; label1[1] = (char *)"Files..."; label1[2] = (char *)"Unlink"; label1[3] = (char *)"Update"; label1[4] = (char *)"Close"; XmGetPos(app_shell, 0, &x, &y); top = XmCreateDialogShell(app_shell, (char *)"Hot links", NULL, 0); handle_close(top); XtVaSetValues(top, XmNx, x, XmNy, y, NULL); dialog = XmCreateRowColumn(top, (char *)"dialog_rc", NULL, 0); XtSetArg(args[0], XmNlistSizePolicy, XmRESIZE_IF_POSSIBLE); XtSetArg(args[1], XmNvisibleItemCount, 5); hotlink_list_item = XmCreateScrolledList(dialog, (char *)"list", args, 2); XtManageChild(hotlink_list_item); hotlink_set_item = CreateSetSelector(dialog, "Link set:", SET_SELECT_ACTIVE, FILTER_SELECT_ALL, GRAPH_SELECT_CURRENT, SELECTION_TYPE_MULTIPLE); DefineSetSelectorFilter(&hotlink_set_item); hotlink_file_item = CreateTextItem2(dialog, 30, "To file or pipe:"); hotlink_source_item = CreatePanelChoice(dialog, "Source: ", 3, "Disk file", "Pipe", NULL, NULL); XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, dialog, NULL); CreateCommandButtons(dialog, 5, but1, label1); XtAddCallback(but1[0], XmNactivateCallback, (XtCallbackProc)do_hotlink_proc, (XtPointer)NULL); XtAddCallback(but1[1], XmNactivateCallback, (XtCallbackProc)create_hotfiles_popup, (XtPointer)NULL); XtAddCallback(but1[2], XmNactivateCallback, (XtCallbackProc)do_hotunlink_proc, (XtPointer)NULL); XtAddCallback(but1[3], XmNactivateCallback, (XtCallbackProc)do_hotupdate_proc, (XtPointer)NULL); XtAddCallback(but1[4], XmNactivateCallback, (XtCallbackProc)destroy_dialog, (XtPointer)top); XtManageChild(dialog); hotlink_frame = top; } XtRaise(top); update_hotlinks(); unset_wait_cursor(); }
void create_ss_frame(EditPoints * ep) { Widget dialog; char buf[32], wname[256]; int i, j; Widget but1[3], but2[2]; char *label1[3] = { "Props...", "Update", "Close" }; char *label2[2] = { "Delete", "Add" }; short width; set_wait_cursor(); sprintf( wname, "Edit set: S%d of G%d", ep->setno, ep->gno ); ep->top = XmCreateDialogShell(app_shell, wname, NULL, 0); handle_close(ep->top); dialog = XmCreateRowColumn(ep->top, "dialog_rc", NULL, 0); cells = MakeCells(ep); rowlabels = (String *) malloc(ep->nrows * sizeof(String)); for (i = 0; i < ep->nrows; i++) { sprintf(buf, "%d", i + 1); rowlabels[i] = (String) malloc((sizeof(buf) + 1) * sizeof(char)); strcpy(rowlabels[i], buf); } /* added by Ed Vigmond -- increase row label width by 1 */ width = (short) ceil(log10(i))+1; ep->mw = XtVaCreateManagedWidget("mw", xbaeMatrixWidgetClass, dialog, XmNrows, ep->nrows, XmNcolumns, ep->ncols, XmNcolumnWidths, widths, XmNvisibleRows, 10, XmNvisibleColumns, 2, XmNrowLabels, rowlabels, XmNcolumnLabels, ep->collabels, XmNcells, cells, XmNgridType, XmGRID_SHADOW_IN, XmNcellShadowType, XmSHADOW_ETCHED_OUT, XmNcellShadowThickness, 4, XmNrowLabelWidth, width, NULL); XtAddCallback(ep->mw, XmNselectCellCallback, selectCB, ep); XtAddCallback(ep->mw, XmNdrawCellCallback, drawcellCB, ep); XtAddCallback(ep->mw, XmNleaveCellCallback, leaveCB, ep); XtAddCallback(ep->mw, XmNwriteCellCallback, writeCB, ep); for (i = 0; i < ep->nrows; i++) { for (j = 0; j < ep->ncols; j++) { XtFree((XtPointer) cells[i][j]); } free( rowlabels[i] ); XtFree((XtPointer) cells[i]); } XtFree((XtPointer) cells); XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, dialog, NULL); CreateCommandButtons(dialog, 2, but2, label2); XtAddCallback(but2[0], XmNactivateCallback, (XtCallbackProc) del_point_cb, (XtPointer) ep); XtAddCallback(but2[1], XmNactivateCallback, (XtCallbackProc) add_pt_cb, (XtPointer) ep); XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, dialog, NULL); CreateCommandButtons(dialog, 3, but1, label1); XtAddCallback(but1[0], XmNactivateCallback, (XtCallbackProc) do_props_proc, (XtPointer) ep); XtAddCallback(but1[1], XmNactivateCallback, (XtCallbackProc) update_cells, (XtPointer) ep); XtAddCallback(but1[2], XmNactivateCallback, (XtCallbackProc) destroy_dialog, (XtPointer) ep->top); XtManageChild(dialog); XtRaise(ep->top); 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(); }
/* * 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 */
static void do_tickmarks_proc(Widget w, XtPointer client_data, XtPointer call_data) { Widget wlabel, rc, rc2, rc3, fr; int x, y; set_wait_cursor(); if (tickmark_frame == NULL) { char *label1[2]; label1[0] = "Accept"; label1[1] = "Close"; XmGetPos(app_shell, 0, &x, &y); tickmark_frame = XmCreateDialogShell(app_shell, "Tick marks", NULL, 0); handle_close(tickmark_frame); XtVaSetValues(tickmark_frame, XmNx, x, XmNy, y, NULL); tickmark_panel = XmCreateRowColumn(tickmark_frame, "tickmark_rc", NULL, 0); tinout = CreatePanelChoice(tickmark_panel, "Tick marks pointing:", 4, "In", "Out", "Both", 0, 0); tickop = CreatePanelChoice(tickmark_panel, "Draw tick marks on:", 4, "Normal side", "Opposite side", "Both sides", 0, 0); rc2 = XmCreateRowColumn(tickmark_panel, "rc2", NULL, 0); XtVaSetValues(rc2, XmNorientation, XmHORIZONTAL, NULL); /* major tick marks */ fr = XmCreateFrame(rc2, "fr", NULL, 0); rc = XmCreateRowColumn(fr, "rc", NULL, 0); tgrid = XtVaCreateManagedWidget("Major ticks grid lines", xmToggleButtonWidgetClass, rc, NULL); rc3 = XmCreateRowColumn(rc, "rc3", NULL, 0); wlabel = XtVaCreateManagedWidget("Major tick length:", xmLabelWidgetClass, rc3, NULL); tlen = XtVaCreateManagedWidget("ticklength", xmScaleWidgetClass, rc3, XmNminimum, 0, XmNmaximum, 400, XmNvalue, 100, XmNshowValue, True, XmNprocessingDirection, XmMAX_ON_RIGHT, XmNorientation, XmHORIZONTAL, NULL); XtManageChild(rc3); tgridcol = CreateColorChoice(rc, "Color:", 0); tgridlinew = CreatePanelChoice(rc, "Line width:", 10, "1", "2", "3", "4", "5", "6", "7", "8", "9", 0, 0); tgridlines = (Widget *) CreatePanelChoice(rc, "Line style:", 6, "Solid line", "Dotted line", "Dashed line", "Long Dashed", "Dot-dashed", NULL, NULL); XtManageChild(rc); XtManageChild(fr); fr = XmCreateFrame(rc2, "fr", NULL, 0); rc = XmCreateRowColumn(fr, "rc", NULL, 0); tmgrid = XtVaCreateManagedWidget("Minor ticks grid lines", xmToggleButtonWidgetClass, rc, NULL); rc3 = XmCreateRowColumn(rc, "rc", NULL, 0); wlabel = XtVaCreateManagedWidget("Minor tick length:", xmLabelWidgetClass, rc3, NULL); tmlen = XtVaCreateManagedWidget("mticklength", xmScaleWidgetClass, rc3, XmNminimum, 0, XmNmaximum, 400, XmNvalue, 100, XmNshowValue, True, XmNprocessingDirection, XmMAX_ON_RIGHT, XmNorientation, XmHORIZONTAL, NULL); XtManageChild(rc3); tmgridcol = CreateColorChoice(rc, "Color:", 0); tmgridlinew = CreatePanelChoice(rc, "Line width:", 10, "1", "2", "3", "4", "5", "6", "7", "8", "9", 0, 0); tmgridlines = (Widget *) CreatePanelChoice(rc, "Line style:", 6, "Solid line", "Dotted line", "Dashed line", "Long Dashed", "Dot-dashed", NULL, NULL); XtManageChild(rc); XtManageChild(fr); XtManageChild(rc2); tick_applyto = CreatePanelChoice(tickmark_panel, "Apply to:", 5, "Current axis", "All axes, current graph", "Current axis, all graphs", "All axes, all graphs", NULL, 0); XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, tickmark_panel, NULL); CreateCommandButtons(tickmark_panel, 2, but1, label1); XtAddCallback(but1[0], XmNactivateCallback, (XtCallbackProc) accept_tickmark_proc, (XtPointer) 0); XtAddCallback(but1[1], XmNactivateCallback, (XtCallbackProc) destroy_dialog, (XtPointer) tickmark_frame); XtManageChild(tickmark_panel); } XtRaise(tickmark_frame); update_tickmark_items(cg); unset_wait_cursor(); }