static void label_define_notify_proc(Widget w, XtPointer client_data, XtPointer call_data) { set_plotstr_string(&g[cg].labs.title, (char *) xv_getstr(label_title_text_item)); set_plotstr_string(&g[cg].labs.stitle, (char *) xv_getstr(label_subtitle_text_item)); drawgraph(); set_dirtystate(); }
static void accept_special_proc(Widget w, XtPointer client_data, XtPointer call_data) { tickmarks t; int iv, i; get_graph_tickmarks(cg, &t, curaxis); t.t_type = XmToggleButtonGetState(specticks) ? TYPE_SPEC : TYPE_AUTO; t.tl_type = XmToggleButtonGetState(specticklabels) ? TYPE_SPEC : TYPE_AUTO; iv = atoi((char *) xv_getstr(nspec)); if (iv > MAX_TICK_LABELS) { sprintf(buf, "Number of ticks/tick labels exceeds %d", MAX_TICK_LABELS); errwin(buf); return; } t.t_spec = iv; for (i = 0; i < MAX_TICK_LABELS; i++) { t.t_specloc[i] = atof((char *) xv_getstr(specloc[i])); set_plotstr_string(&t.t_speclab[i], (char *) xv_getstr(speclabel[i])); } set_graph_tickmarks(cg, &t, curaxis); drawgraph(); set_dirtystate(); }
static void label_define_notify_proc(Widget, XtPointer, XtPointer) { set_plotstr_string(&g[cg].labs.title, (char *)xv_getstr(label_title_text_item)); set_plotstr_string(&g[cg].labs.stitle, (char *)xv_getstr(label_subtitle_text_item)); drawgraph(); }
/* * define tick marks */ static void ticks_define_notify_proc(Widget w, XtPointer client_data, XtPointer call_data) { char val[80]; int i, j; int applyto; extern double result; double x = (g[cg].w.xg2 - g[cg].w.xg1), y = (g[cg].w.yg2 - g[cg].w.yg1), a = g[cg].w.xg1, b = g[cg].w.yg1, c = g[cg].w.xg2, d = g[cg].w.yg2; int errpos; int axis_start, axis_stop, graph_start, graph_stop; tickmarks t; get_graph_tickmarks(cg, &t, curaxis); t.label.s = NULL; applyto = GetChoice(axis_applyto); strcpy(val, (char *) xv_getstr(tmajor)); scanner(val, &x, &y, 1, &a, &b, &c, &d, 1, 0, 0, &errpos); if (errpos) { return; } t.tmajor = result; if (islogx(cg) && (curaxis % 2 == 0)) { t.tmajor = (int) t.tmajor; } else if (islogy(cg) && (curaxis % 2 == 1)) { t.tmajor = (int) t.tmajor; } strcpy(val, (char *) xv_getstr(tminor)); scanner(val, &x, &y, 1, &a, &b, &c, &d, 1, 0, 0, &errpos); if (errpos) { return; } t.tminor = result; if (islogx(cg) && (curaxis % 2 == 0)) { t.tminor = (int) t.tminor; if (t.tminor < 0 || t.tminor > 5) { t.tminor = 0; } } else if (islogy(cg) && (curaxis % 2 == 1)) { t.tminor = (int) t.tminor; if (t.tminor < 0 || t.tminor > 5) { t.tminor = 0; } } t.tl_flag = XmToggleButtonGetState(tlonoff) ? TRUE : FALSE; t.t_flag = XmToggleButtonGetState(tonoff) ? TRUE : FALSE; t.t_drawbar = XmToggleButtonGetState(baronoff) ? TRUE : FALSE; set_plotstr_string(&t.label, (char *) xv_getstr(axislabel)); switch (applyto) { case 0: /* current axis */ axis_start = curaxis; axis_stop = curaxis; graph_start = cg; graph_stop = cg; break; case 1: /* all axes, current graph */ axis_start = 0; axis_stop = MAXAXES - 1; graph_start = cg; graph_stop = cg; break; case 2: /* current axis, all graphs */ axis_start = curaxis; axis_stop = curaxis; graph_start = 0; graph_stop = maxgraph - 1; break; case 3: /* all axes, all graphs */ axis_start = 0; axis_stop = MAXAXES - 1; graph_start = 0; graph_stop = maxgraph - 1; break; default: axis_start = curaxis; axis_stop = curaxis; graph_start = cg; graph_stop = cg; break; } /* * set_graph_tickmarks(cg, &t, curaxis); * set_plotstr_string(&g[cg].t[curaxis].label, t.label.s); * break; */ for (i = graph_start; i <= graph_stop; i++) { for (j = axis_start; j <= axis_stop; j++) { g[i].t[j].tl_flag = t.tl_flag; g[i].t[j].t_flag = t.t_flag; g[i].t[j].t_drawbar = t.t_drawbar; g[i].t[j].tmajor = t.tmajor; g[i].t[j].tminor = t.tminor; set_plotstr_string(&g[i].t[j].label, t.label.s); } } drawgraph(); set_dirtystate(); }