diff -C 3 -P --exclude-from=/home/ed/src/exclude-iu-file -r ./README.instup ../grace-5.1.13iu/README.instup *** ./README.instup 1969-12-31 17:00:00.000000000 -0700 --- ../grace-5.1.13iu/README.instup 2003-12-03 16:34:20.000000000 -0700 *************** *** 0 **** --- 1,22 ---- + + This patch adds instantaneous updating to the major widgets. Only the + feature changed gets updated. This means that, for example, the line + colour of a set is changed when you select the colour, NOT + when you press apply. Make sure that the instant update button is selected + for this feature to work. + + Why is this so great? + 1) Well, say I have a bunch of sets for which I selected all the line styles, + symbols and colours. Now I want to change the width of all of them + Traditionally, this would have meant that I would have to go through and + do every set individually. Now, I can select all the sets and ONLY the + line width wll get changed when I select a new line width. + Imagine this with graphs, axes, etc. + 2) I can see the result right away. I do not have to leave the widget and + hit the apply button. + + There is a new X resource to set for this to work automatically. Put the + following line in your ~/.Xresources or .Xdefaults file: + + XMgrace*InstantUpdate: true + Binary files ./src/buildinfo and ../grace-5.1.13iu/src/buildinfo differ diff -C 3 -P --exclude-from=/home/ed/src/exclude-iu-file -r ./src/compwin.c ../grace-5.1.13iu/src/compwin.c *** ./src/compwin.c 2003-03-08 15:24:13.000000000 -0700 --- ../grace-5.1.13iu/src/compwin.c 2003-12-03 16:34:20.000000000 -0700 *************** *** 74,80 **** static void do_window_proc(Widget w, XtPointer client_data, XtPointer call_data); static int do_histo_proc(void *data); static void do_sample_proc(Widget w, XtPointer client_data, XtPointer call_data); ! static void do_prune_toggle(Widget w, XtPointer client_data, XtPointer call_data); static void do_prune_proc(Widget w, XtPointer client_data, XtPointer call_data); static void set_regr_sensitivity(Widget , XtPointer , XtPointer ); --- 74,80 ---- static void do_window_proc(Widget w, XtPointer client_data, XtPointer call_data); static int do_histo_proc(void *data); static void do_sample_proc(Widget w, XtPointer client_data, XtPointer call_data); ! static void do_prune_toggle(int c, void *data); static void do_prune_proc(Widget w, XtPointer client_data, XtPointer call_data); static void set_regr_sensitivity(Widget , XtPointer , XtPointer ); *************** *** 589,599 **** typedef struct _Four_ui { Widget top; SetChoiceItem sel; ! Widget *load_item; ! Widget *window_item; ! Widget *loadx_item; ! Widget *inv_item; ! Widget *type_item; Widget *graph_item; } Four_ui; --- 589,599 ---- typedef struct _Four_ui { Widget top; SetChoiceItem sel; ! OptionStructure *load_item; ! OptionStructure *window_item; ! OptionStructure *loadx_item; ! OptionStructure *inv_item; ! OptionStructure *type_item; Widget *graph_item; } Four_ui; *************** *** 793,800 **** Widget top; SetChoiceItem sel; Widget len_item; ! Widget *type_item; ! Widget *region_item; Widget rinvert_item; } Run_ui; --- 793,800 ---- Widget top; SetChoiceItem sel; Widget len_item; ! OptionStructure *type_item; ! OptionStructure *region_item; Widget rinvert_item; } Run_ui; *************** *** 912,921 **** typedef struct _Reg_ui { Widget top; SetChoiceItem sel; ! Widget *degree_item; Widget zero_item; ! Widget *resid_item; ! Widget *region_item; Widget rinvert_item; Widget start_item; Widget stop_item; --- 912,921 ---- typedef struct _Reg_ui { Widget top; SetChoiceItem sel; ! OptionStructure *degree_item; Widget zero_item; ! OptionStructure *resid_item; ! OptionStructure *region_item; Widget rinvert_item; Widget start_item; Widget stop_item; *************** *** 1007,1016 **** 0, 0); ManageChild(rc2); for( i=2; i<5; i++ ) XtAddCallback( regui.resid_item[i], XmNactivateCallback, set_regr_sensitivity, (XtPointer)(i-2) ); ! rc2 = XtVaCreateWidget("rc2", xmRowColumnWidgetClass, rc, --- 1007,1020 ---- 0, 0); ManageChild(rc2); + /* for( i=2; i<5; i++ ) XtAddCallback( regui.resid_item[i], XmNactivateCallback, set_regr_sensitivity, (XtPointer)(i-2) ); ! */ ! for( i=0; i<3; i++ ) ! XtAddCallback( regui.resid_item->options[i].widget, XmNactivateCallback, ! set_regr_sensitivity, (XtPointer)(i) ); rc2 = XtVaCreateWidget("rc2", xmRowColumnWidgetClass, rc, *************** *** 1138,1144 **** typedef struct _Diff_ui { Widget top; SetChoiceItem sel; ! Widget *type_item; Widget *region_item; Widget rinvert_item; } Diff_ui; --- 1142,1148 ---- typedef struct _Diff_ui { Widget top; SetChoiceItem sel; ! OptionStructure *type_item; Widget *region_item; Widget rinvert_item; } Diff_ui; *************** *** 1216,1222 **** typedef struct _Int_ui { Widget top; SetChoiceItem sel; ! Widget *type_item; Widget sum_item; Widget *region_item; Widget rinvert_item; --- 1220,1226 ---- typedef struct _Int_ui { Widget top; SetChoiceItem sel; ! OptionStructure *type_item; Widget sum_item; Widget *region_item; Widget rinvert_item; *************** *** 1450,1456 **** typedef struct _Samp_ui { Widget top; SetChoiceItem sel; ! Widget *type_item; Widget start_item; Widget step_item; Widget expr_item; --- 1454,1460 ---- typedef struct _Samp_ui { Widget top; SetChoiceItem sel; ! OptionStructure *type_item; Widget start_item; Widget step_item; Widget expr_item; *************** *** 1566,1575 **** typedef struct _Prune_ui { Widget top; SetChoiceItem sel; ! Widget *type_item; ! Widget *dxtype_item; ! Widget *dytype_item; ! Widget *deltatype_item; Widget dx_rc; Widget dy_rc; Widget dx_item; --- 1570,1579 ---- typedef struct _Prune_ui { Widget top; SetChoiceItem sel; ! OptionStructure *type_item; ! OptionStructure *dxtype_item; ! OptionStructure *dytype_item; ! OptionStructure *deltatype_item; Widget dx_rc; Widget dy_rc; Widget dx_item; *************** *** 1580,1586 **** void create_prune_frame(void *data) { - int i; static Widget dialog; set_wait_cursor(); --- 1584,1589 ---- *************** *** 1628,1642 **** update_prune_frame(); ! for (i = 0; i <= 3; i++) { ! XtAddCallback(pruneui.type_item[2 + i], XmNactivateCallback, ! (XtCallbackProc) do_prune_toggle, (XtPointer) &pruneui); ! } ! for (i = 0; i <= 1; i++) { ! XtAddCallback(pruneui.deltatype_item[2 + i], XmNactivateCallback, ! (XtCallbackProc) do_prune_toggle, (XtPointer) &pruneui); ! } ! do_prune_toggle ((Widget) NULL, (XtPointer) &pruneui, 0); CreateSeparator(dialog); --- 1631,1642 ---- update_prune_frame(); ! AddOptionChoiceCB(pruneui.type_item, do_prune_toggle, ! (XtPointer)&pruneui); ! AddOptionChoiceCB(pruneui.deltatype_item, ! do_prune_toggle, (XtPointer)&pruneui); ! ! do_prune_toggle( 0, (XtPointer) &pruneui ); CreateSeparator(dialog); *************** *** 1663,1671 **** /* * Toggle prune type */ ! static void do_prune_toggle(Widget w, XtPointer client_data, XtPointer call_data) { ! Prune_ui *ui = (Prune_ui *) client_data; int typeno = (int) GetChoice(ui->type_item); int deltatypeno = (int) GetChoice(ui->deltatype_item); --- 1663,1671 ---- /* * Toggle prune type */ ! static void do_prune_toggle(int c, void *data) { ! Prune_ui *ui = (Prune_ui *)data; int typeno = (int) GetChoice(ui->type_item); int deltatypeno = (int) GetChoice(ui->deltatype_item); *************** *** 1675,1686 **** SetSensitive(pruneui.dy_rc, FALSE); switch (deltatypeno) { case PRUNE_VIEWPORT: SetSensitive(*pruneui.dxtype_item, FALSE); SetSensitive(*pruneui.dytype_item, FALSE); break; case PRUNE_WORLD: ! SetSensitive(*pruneui.dxtype_item, TRUE); ! SetSensitive(*pruneui.dytype_item, FALSE); break; } break; --- 1675,1690 ---- SetSensitive(pruneui.dy_rc, FALSE); switch (deltatypeno) { case PRUNE_VIEWPORT: + /* SetSensitive(*pruneui.dxtype_item, FALSE); SetSensitive(*pruneui.dytype_item, FALSE); + */ + SetSensitive(pruneui.dxtype_item->pulldown, FALSE); + SetSensitive(pruneui.dytype_item->pulldown, FALSE); break; case PRUNE_WORLD: ! SetSensitive(pruneui.dxtype_item->pulldown, TRUE); ! SetSensitive(pruneui.dytype_item->pulldown, FALSE); break; } break; *************** *** 1690,1701 **** SetSensitive(pruneui.dy_rc, TRUE); switch (deltatypeno) { case PRUNE_VIEWPORT: ! SetSensitive(*pruneui.dxtype_item, FALSE); ! SetSensitive(*pruneui.dytype_item, FALSE); break; case PRUNE_WORLD: ! SetSensitive(*pruneui.dxtype_item, TRUE); ! SetSensitive(*pruneui.dytype_item, TRUE); break; } break; --- 1694,1705 ---- SetSensitive(pruneui.dy_rc, TRUE); switch (deltatypeno) { case PRUNE_VIEWPORT: ! SetSensitive(pruneui.dxtype_item->pulldown, FALSE); ! SetSensitive(pruneui.dytype_item->pulldown, FALSE); break; case PRUNE_WORLD: ! SetSensitive(pruneui.dxtype_item->pulldown, TRUE); ! SetSensitive(pruneui.dytype_item->pulldown, TRUE); break; } break; *************** *** 1704,1715 **** SetSensitive(pruneui.dy_rc, TRUE); switch (deltatypeno) { case PRUNE_VIEWPORT: ! SetSensitive(*pruneui.dxtype_item, FALSE); ! SetSensitive(*pruneui.dytype_item, FALSE); break; case PRUNE_WORLD: ! SetSensitive(*pruneui.dxtype_item, FALSE); ! SetSensitive(*pruneui.dytype_item, TRUE); break; } break; --- 1708,1719 ---- SetSensitive(pruneui.dy_rc, TRUE); switch (deltatypeno) { case PRUNE_VIEWPORT: ! SetSensitive(pruneui.dxtype_item->pulldown, FALSE); ! SetSensitive(pruneui.dytype_item->pulldown, FALSE); break; case PRUNE_WORLD: ! SetSensitive(pruneui.dxtype_item->pulldown, FALSE); ! SetSensitive(pruneui.dytype_item->pulldown, TRUE); break; } break; *************** *** 1908,1914 **** Widget top; SetChoiceItem sel; SetChoiceItem sel2; ! Widget *order_item; Widget degrees_item; Widget rotx_item; Widget roty_item; --- 1912,1918 ---- Widget top; SetChoiceItem sel; SetChoiceItem sel2; ! OptionStructure *order_item; Widget degrees_item; Widget rotx_item; Widget roty_item; diff -C 3 -P --exclude-from=/home/ed/src/exclude-iu-file -r ./src/featext.c ../grace-5.1.13iu/src/featext.c *** ./src/featext.c 2002-05-27 14:10:15.000000000 -0600 --- ../grace-5.1.13iu/src/featext.c 2003-12-03 16:34:20.000000000 -0700 *************** *** 56,62 **** Widget top; ListStructure *tograph; OptionStructure *feature_item; ! Widget *xval_item; ListStructure *absic_graph; SetChoiceItem absic_set; Widget legload_rc; --- 56,62 ---- Widget top; ListStructure *tograph; OptionStructure *feature_item; ! OptionStructure *xval_item; ListStructure *absic_graph; SetChoiceItem absic_set; Widget legload_rc; *************** *** 143,149 **** NULL, 0 ); for (i = 0; i < 4; i++) { ! XtAddCallback(feui.xval_item[2 + i], XmNactivateCallback, (XtCallbackProc) do_fext_toggle, (XtPointer) i); } --- 143,149 ---- NULL, 0 ); for (i = 0; i < 4; i++) { ! XtAddCallback(feui.xval_item->options[i].widget, XmNactivateCallback, (XtCallbackProc) do_fext_toggle, (XtPointer) i); } diff -C 3 -P --exclude-from=/home/ed/src/exclude-iu-file -r ./src/fileswin.c ../grace-5.1.13iu/src/fileswin.c *** ./src/fileswin.c 2000-07-12 16:31:47.000000000 -0600 --- ../grace-5.1.13iu/src/fileswin.c 2003-12-03 16:34:20.000000000 -0700 *************** *** 393,399 **** set_wait_cursor(); if (fsb == NULL) { ! Widget fr, *graph_item; fsb = CreateFileSelectionBox(app_shell, "Write parameters"); fr = CreateFrame(fsb->rc, NULL); --- 393,400 ---- set_wait_cursor(); if (fsb == NULL) { ! Widget fr; ! OptionStructure *graph_item; fsb = CreateFileSelectionBox(app_shell, "Write parameters"); fr = CreateFrame(fsb->rc, NULL); *************** *** 415,421 **** static int write_params_proc(char *filename, void *data) { ! Widget *graph_item = (Widget *) data; int gno; FILE *pp; --- 416,422 ---- static int write_params_proc(char *filename, void *data) { ! OptionStructure *graph_item = (Widget *) data; int gno; FILE *pp; diff -C 3 -P --exclude-from=/home/ed/src/exclude-iu-file -r ./src/graphappwin.c ../grace-5.1.13iu/src/graphappwin.c *** ./src/graphappwin.c 2001-11-13 13:36:22.000000000 -0700 --- ../grace-5.1.13iu/src/graphappwin.c 2003-12-03 16:34:20.000000000 -0700 *************** *** 54,60 **** static Widget define_view_yv1; static Widget define_view_yv2; ! static Widget *graph_type_choice_item; static Widget stacked_item; --- 54,60 ---- static Widget define_view_yv1; static Widget define_view_yv2; ! static OptionStructure *graph_type_choice_item; static Widget stacked_item; *************** *** 72,78 **** static SpinStructure *bargap_item; static Widget znorm_item; ! static Widget *frame_framestyle_choice_item; static OptionStructure *frame_color_choice_item; static OptionStructure *frame_pattern_choice_item; static OptionStructure *frame_lines_choice_item; --- 72,78 ---- static SpinStructure *bargap_item; static Widget znorm_item; ! static OptionStructure *frame_framestyle_choice_item; static OptionStructure *frame_color_choice_item; static OptionStructure *frame_pattern_choice_item; static OptionStructure *frame_lines_choice_item; *************** *** 83,92 **** static Widget legend_x_item; static Widget legend_y_item; static Widget toggle_legends_item; ! static Widget *toggle_legendloc_item; ! static Widget *legends_vgap_item; ! static Widget *legends_hgap_item; ! static Widget *legends_len_item; static Widget legends_invert_item; static OptionStructure *legend_font_item; static Widget legend_charsize_item; --- 83,92 ---- static Widget legend_x_item; static Widget legend_y_item; static Widget toggle_legends_item; ! static OptionStructure *toggle_legendloc_item; ! static OptionStructure *legends_vgap_item; ! static OptionStructure *legends_hgap_item; ! static OptionStructure *legends_len_item; static Widget legends_invert_item; static OptionStructure *legend_font_item; static Widget legend_charsize_item; *************** *** 98,103 **** --- 98,106 ---- static OptionStructure *legend_boxcolor_item; static OptionStructure *legend_boxpattern_item; + static Widget instantupdate_item; + static int instantupdate=0; + /* * Event and Notify proc declarations */ *************** *** 108,113 **** --- 111,131 ---- void update_graphapp_items(int n, int *values, void *data); + void graphwin_iu(int a, void *data) + { + instantupdate = a; + } + + void oc_graph_cb( int a, void *data ) + { + graphapp_aac_cb( data ); + } + + void sp_graph_cb( double a, void *data ) + { + graphapp_aac_cb( data ); + } + void create_graphapp_frame_cb(void *data) { create_graphapp_frame((int) data); *************** *** 170,175 **** --- 188,198 ---- CreateMenuButton(menupane, "Create new", 'C', create_new_graph_proc, graph_selector); + menupane = CreateMenu(menubar, "Options", 'O', FALSE); + instantupdate_item = CreateMenuToggle(menupane, "Instantaneous update", + 'u', graphwin_iu, NULL); + SetToggleButtonState(instantupdate_item, instantupdate); + menupane = CreateMenu(menubar, "Help", 'H', TRUE); CreateMenuHelpButton(menupane, "On graph appearance", 'g', graphapp_dialog, "doc/UsersGuide.html#graph-appearance"); *************** *** 196,225 **** "Fixed", "Pie chart", NULL, ! NULL); stacked_item = CreateToggleButton(rc, "Stacked chart"); fr = CreateFrame(graphapp_main, "Titles"); rc = CreateVContainer(fr); label_title_text_item = CreateCSText(rc, "Title: "); label_subtitle_text_item = CreateCSText(rc, "Subtitle: "); fr = CreateFrame(graphapp_main, "Viewport"); rc = CreateVContainer(fr); rc1 = CreateHContainer(rc); define_view_xv1 = CreateTextItem2(rc1, 8, "Xmin:"); define_view_xv2 = CreateTextItem2(rc1, 8, "Xmax:"); rc1 = CreateHContainer(rc); define_view_yv1 = CreateTextItem2(rc1, 8, "Ymin:"); define_view_yv2 = CreateTextItem2(rc1, 8, "Ymax:"); fr = CreateFrame(graphapp_main, "Display options"); rc = CreateHContainer(fr); toggle_legends_item = CreateToggleButton(rc, "Display legend"); graph_flipxy_item = CreateToggleButton(rc, "Flip XY (N/I)"); AddToggleButtonCB(graph_flipxy_item, flipxy_cb, NULL); /* ------------ Titles tab -------------- */ --- 219,267 ---- "Fixed", "Pie chart", NULL, ! 0); ! AddOptionChoiceCB( graph_type_choice_item, (OC_CBProc)oc_graph_cb, ! (void *)graph_type_choice_item ); stacked_item = CreateToggleButton(rc, "Stacked chart"); + AddToggleButtonCB( stacked_item, (OC_CBProc)oc_graph_cb, + (void *)stacked_item ); fr = CreateFrame(graphapp_main, "Titles"); rc = CreateVContainer(fr); label_title_text_item = CreateCSText(rc, "Title: "); + AddTextInputCB( label_title_text_item, (Text_CBProc)graphapp_aac_cb, + (void *)label_title_text_item ); label_subtitle_text_item = CreateCSText(rc, "Subtitle: "); + AddTextInputCB( label_subtitle_text_item, (Text_CBProc)graphapp_aac_cb, + (void *)label_subtitle_text_item ); fr = CreateFrame(graphapp_main, "Viewport"); rc = CreateVContainer(fr); rc1 = CreateHContainer(rc); define_view_xv1 = CreateTextItem2(rc1, 8, "Xmin:"); + AddTextItem2CB( define_view_xv1, (Button_CBProc)graphapp_aac_cb, + (void *)define_view_xv1 ); define_view_xv2 = CreateTextItem2(rc1, 8, "Xmax:"); + AddTextItem2CB( define_view_xv2, (Button_CBProc)graphapp_aac_cb, + (void *)define_view_xv2 ); rc1 = CreateHContainer(rc); define_view_yv1 = CreateTextItem2(rc1, 8, "Ymin:"); + AddTextItem2CB( define_view_yv1, (Button_CBProc)graphapp_aac_cb, + (void *)define_view_yv1 ); define_view_yv2 = CreateTextItem2(rc1, 8, "Ymax:"); + AddTextItem2CB( define_view_yv2, (Button_CBProc)graphapp_aac_cb, + (void *)define_view_yv2 ); fr = CreateFrame(graphapp_main, "Display options"); rc = CreateHContainer(fr); toggle_legends_item = CreateToggleButton(rc, "Display legend"); + AddToggleButtonCB( toggle_legends_item, (TB_CBProc)oc_graph_cb, + (void *)toggle_legends_item ); graph_flipxy_item = CreateToggleButton(rc, "Flip XY (N/I)"); AddToggleButtonCB(graph_flipxy_item, flipxy_cb, NULL); + /*AddToggleButtonCB(graph_flipxy_item, oc_graph_cb, (void *)graph_flipxy_item);*/ /* ------------ Titles tab -------------- */ *************** *** 229,243 **** fr = CreateFrame(graphapp_titles, "Title"); rc2 = CreateVContainer(fr); title_font_item = CreateFontChoice(rc2, "Font:"); title_size_item = CreateCharSizeChoice(rc2, "Character size"); title_color_item = CreateColorChoice(rc2, "Color:"); fr = CreateFrame(graphapp_titles, "Subtitle"); rc2 = CreateVContainer(fr); stitle_font_item = CreateFontChoice(rc2, "Font:"); stitle_size_item = CreateCharSizeChoice(rc2, "Character size"); stitle_color_item = CreateColorChoice(rc2, "Color:"); ! /* ------------ Frame tab -------------- */ --- 271,296 ---- fr = CreateFrame(graphapp_titles, "Title"); rc2 = CreateVContainer(fr); title_font_item = CreateFontChoice(rc2, "Font:"); + AddOptionChoiceCB( title_font_item, (OC_CBProc)oc_graph_cb, + (void *)title_font_item ); title_size_item = CreateCharSizeChoice(rc2, "Character size"); + AddScaleCB( title_size_item, (OC_CBProc)oc_graph_cb, + (void *)title_size_item ); title_color_item = CreateColorChoice(rc2, "Color:"); + AddOptionChoiceCB( title_color_item, (OC_CBProc)oc_graph_cb, + (void *)title_color_item ); fr = CreateFrame(graphapp_titles, "Subtitle"); rc2 = CreateVContainer(fr); stitle_font_item = CreateFontChoice(rc2, "Font:"); + AddOptionChoiceCB( stitle_font_item, (OC_CBProc)oc_graph_cb, + (void *)stitle_font_item ); stitle_size_item = CreateCharSizeChoice(rc2, "Character size"); + AddScaleCB( stitle_size_item, (OC_CBProc)oc_graph_cb, + (void *)stitle_size_item ); stitle_color_item = CreateColorChoice(rc2, "Color:"); ! AddOptionChoiceCB( stitle_color_item, (OC_CBProc)oc_graph_cb, ! (void *)stitle_color_item ); /* ------------ Frame tab -------------- */ *************** *** 255,273 **** --- 308,340 ---- "Break right", NULL, NULL); + AddOptionChoiceCB( frame_framestyle_choice_item,(OC_CBProc)oc_graph_cb, + (void *)frame_framestyle_choice_item ); rc2 = CreateHContainer(rc); frame_color_choice_item = CreateColorChoice(rc2, "Color:"); + AddOptionChoiceCB( frame_color_choice_item, (OC_CBProc)oc_graph_cb, + (void *)frame_color_choice_item ); frame_pattern_choice_item = CreatePatternChoice(rc2, "Pattern:"); + AddOptionChoiceCB( frame_pattern_choice_item, (OC_CBProc)oc_graph_cb, + (void *)frame_pattern_choice_item ); rc2 = CreateHContainer(rc); frame_linew_choice_item = CreateLineWidthChoice(rc2, "Width:"); + AddSpinButtonCB( frame_linew_choice_item, (Spin_CBProc)sp_graph_cb, + (void *)frame_linew_choice_item ); frame_lines_choice_item = CreateLineStyleChoice(rc2, "Style:"); + AddOptionChoiceCB( frame_lines_choice_item, (OC_CBProc)oc_graph_cb, + (void *)frame_lines_choice_item ); fr = CreateFrame(graphapp_frame, "Frame fill"); rc = CreateHContainer(fr); frame_fillcolor_choice_item = CreateColorChoice(rc, "Color:"); + AddOptionChoiceCB( frame_fillcolor_choice_item, (OC_CBProc)oc_graph_cb, + (void *)frame_fillcolor_choice_item ); frame_fillpattern_choice_item = CreatePatternChoice(rc, "Pattern:"); + AddOptionChoiceCB( frame_fillpattern_choice_item, (OC_CBProc)oc_graph_cb, + (void *)frame_fillpattern_choice_item ); /* ------------ Legend frame tab -------------- */ *************** *** 281,306 **** --- 348,391 ---- "World coords", "Viewport coords", 0, 0); + AddOptionChoiceCB( toggle_legendloc_item, (OC_CBProc)oc_graph_cb, + (void *)toggle_legendloc_item ); rc1 = CreateHContainer(rc); legend_x_item = CreateTextItem2(rc1, 10, "X:"); + AddTextItem2CB( legend_x_item, (Button_CBProc)graphapp_aac_cb, + (void *)legend_x_item ); legend_y_item = CreateTextItem2(rc1, 10, "Y:"); + AddTextItem2CB( legend_y_item, (Button_CBProc)graphapp_aac_cb, + (void *)legend_y_item ); fr = CreateFrame(graphapp_legendbox, "Frame line"); rc = CreateVContainer(fr); rc2 = CreateHContainer(rc); legend_boxcolor_item = CreateColorChoice(rc2, "Color:"); + AddOptionChoiceCB( legend_boxcolor_item, (OC_CBProc)oc_graph_cb, + (void *)legend_boxcolor_item); legend_boxpattern_item = CreatePatternChoice(rc2, "Pattern:"); + AddOptionChoiceCB( legend_boxpattern_item, (OC_CBProc)oc_graph_cb, + (void *)legend_boxpattern_item ); rc2 = CreateHContainer(rc); legend_boxlinew_item = CreateLineWidthChoice(rc2, "Width:"); + AddSpinButtonCB( legend_boxlinew_item, (Spin_CBProc)sp_graph_cb, + (void *)legend_boxlinew_item ); legend_boxlines_item = CreateLineStyleChoice(rc2, "Style:"); + AddOptionChoiceCB( legend_boxlines_item, (OC_CBProc)oc_graph_cb, + (void *)legend_boxlines_item ); fr = CreateFrame(graphapp_legendbox, "Frame fill"); rc = CreateHContainer(fr); legend_boxfillcolor_item = CreateColorChoice(rc, "Color:"); + AddOptionChoiceCB( legend_boxfillcolor_item, (OC_CBProc)oc_graph_cb, + (void *)legend_boxfillcolor_item ); legend_boxfillpat_item = CreatePatternChoice(rc, "Pattern:"); + AddOptionChoiceCB( legend_boxfillpat_item, (OC_CBProc)oc_graph_cb, + (void *)legend_boxfillpat_item ); /* ------------ Legends tab -------------- */ *************** *** 310,317 **** --- 395,408 ---- fr = CreateFrame(graphapp_legends, "Text properties"); rc = CreateVContainer(fr); legend_font_item = CreateFontChoice(rc, "Font:"); + AddOptionChoiceCB( legend_font_item, (OC_CBProc)oc_graph_cb, + (void *)legend_font_item ); legend_charsize_item = CreateCharSizeChoice(rc, "Char size"); + AddScaleCB( legend_charsize_item, (OC_CBProc)oc_graph_cb, + (void *)legend_charsize_item ); legend_color_item = CreateColorChoice(rc, "Color:"); + AddOptionChoiceCB( legend_color_item, (OC_CBProc)oc_graph_cb, + (void *)legend_color_item ); fr = CreateFrame(graphapp_legends, "Placement"); rc = CreateVContainer(fr); *************** *** 320,335 **** --- 411,434 ---- 7, "0", "1", "2", "3", "4", "5", 0, 0); + AddOptionChoiceCB( legends_vgap_item, (OC_CBProc)oc_graph_cb, + (void *)legends_vgap_item ); legends_hgap_item = CreatePanelChoice(rc1, "H-gap:", 7, "0", "1", "2", "3", "4", "5", 0, 0); + AddOptionChoiceCB( legends_hgap_item, (OC_CBProc)oc_graph_cb, + (void *)legends_hgap_item ); legends_len_item = CreatePanelChoice(rc, "Legend line length:", 10, "0", "1", "2", "3", "4", "5", "6", "7", "8", 0, 0); + AddOptionChoiceCB( legends_len_item, (OC_CBProc)oc_graph_cb, + (void *)legends_len_item ); legends_invert_item = CreateToggleButton(rc, "Put in reverse order"); + AddToggleButtonCB(legends_invert_item, (OC_CBProc)oc_graph_cb, + (void *)legends_invert_item ); /* ------------ Special tab -------------- */ *************** *** 338,347 **** fr = CreateFrame(graphapp_spec, "2D+ graphs"); znorm_item = CreateTextItem2(fr, 10, "Z normalization"); fr = CreateFrame(graphapp_spec, "XY charts"); bargap_item = CreateSpinChoice(fr, "Bar gap:", 5, ! SPIN_TYPE_FLOAT, -1.0, 1.0, 0.005); SelectTabPage(graphapp_tab, graphapp_main); --- 437,450 ---- fr = CreateFrame(graphapp_spec, "2D+ graphs"); znorm_item = CreateTextItem2(fr, 10, "Z normalization"); + AddTextItem2CB(znorm_item, (Button_CBProc)graphapp_aac_cb, + (void *)&znorm_item ); fr = CreateFrame(graphapp_spec, "XY charts"); bargap_item = CreateSpinChoice(fr, "Bar gap:", 5, ! SPIN_TYPE_FLOAT, 0.0, 1.0, 0.005); ! AddSpinButtonCB( bargap_item, (Spin_CBProc)sp_graph_cb, ! (void *)bargap_item ); SelectTabPage(graphapp_tab, graphapp_main); *************** *** 373,460 **** labels labs; framep f; legend l; - int graphtype; - int stacked; - double bargap; double znorm; /* * int flipxy; */ ! graphtype = GetChoice(graph_type_choice_item); xv_evalexpr(define_view_xv1, &v.xv1); xv_evalexpr(define_view_xv2, &v.xv2); xv_evalexpr(define_view_yv1, &v.yv1); xv_evalexpr(define_view_yv2, &v.yv2); ! if (isvalid_viewport(v) == FALSE) { errmsg("Invalid viewport coordinates"); return RETURN_FAILURE; } ! set_default_string(&labs.title); set_plotstr_string(&labs.title, GetTextString(label_title_text_item)); labs.title.charsize = GetCharSizeChoice(title_size_item); labs.title.color = GetOptionChoice(title_color_item); labs.title.font = GetOptionChoice(title_font_item); ! ! set_default_string(&labs.stitle); set_plotstr_string(&labs.stitle, GetTextString(label_subtitle_text_item)); labs.stitle.charsize = GetCharSizeChoice(stitle_size_item); labs.stitle.color = GetOptionChoice(stitle_color_item); labs.stitle.font = GetOptionChoice(stitle_font_item); ! f.type = GetChoice(frame_framestyle_choice_item); f.pen.color = GetOptionChoice(frame_color_choice_item); f.pen.pattern = GetOptionChoice(frame_pattern_choice_item); f.linew = GetSpinChoice(frame_linew_choice_item); f.lines = GetOptionChoice(frame_lines_choice_item); f.fillpen.color = GetOptionChoice(frame_fillcolor_choice_item); f.fillpen.pattern = GetOptionChoice(frame_fillpattern_choice_item); ! l.charsize = GetCharSizeChoice(legend_charsize_item); l.active = GetToggleButtonState(toggle_legends_item); l.vgap = GetChoice(legends_vgap_item); l.hgap = GetChoice(legends_hgap_item); l.len = GetChoice(legends_len_item); l.invert = GetToggleButtonState(legends_invert_item); l.loctype = GetChoice(toggle_legendloc_item) ? COORD_VIEW : COORD_WORLD; xv_evalexpr(legend_x_item, &l.legx); xv_evalexpr(legend_y_item, &l.legy); l.font = GetOptionChoice(legend_font_item); l.color = GetOptionChoice(legend_color_item); l.boxfillpen.color = GetOptionChoice(legend_boxfillcolor_item); l.boxfillpen.pattern = GetOptionChoice(legend_boxfillpat_item); l.boxpen.color = GetOptionChoice(legend_boxcolor_item); l.boxpen.pattern = GetOptionChoice(legend_boxpattern_item); l.boxlinew = GetSpinChoice(legend_boxlinew_item); l.boxlines = GetOptionChoice(legend_boxlines_item); ! stacked = GetToggleButtonState(stacked_item); ! ! bargap = GetSpinChoice(bargap_item); ! ! xv_evalexpr(znorm_item, &znorm); ! ! /* ! * flipxy = GetToggleButtonState(graph_flipxy_item); */ - - n = GetListChoices(graph_selector, &values); - for (j = 0; j < n; j++) { - gno = values[j]; - if (is_valid_gno(gno)) { - set_graph_type(gno, graphtype); - set_graph_stacked(gno, stacked); - set_graph_bargap(gno, bargap); - set_graph_znorm(gno, znorm); set_graph_viewport(gno, v); set_graph_labels(gno, &labs); set_graph_framep(gno, &f); set_graph_legend(gno, &l); - /* - * g[gno].xyflip = flipxy; - */ } } --- 476,642 ---- labels labs; framep f; legend l; double znorm; /* * int flipxy; */ ! if(!instantupdate && data != NULL) ! return RETURN_SUCCESS; ! ! if(data==znorm_item || data==NULL){ ! xv_evalexpr(znorm_item, &znorm); ! } ! ! /* ! * flipxy = GetToggleButtonState(graph_flipxy_item); ! */ ! ! n = GetListChoices(graph_selector, &values); ! for (j = 0; j < n; j++) { ! gno = values[j]; ! if (is_valid_gno(gno)) { ! ! get_graph_viewport(gno, &v); ! get_graph_labels(gno, &labs); ! labs.title.s = copy_string(NULL,labs.title.s); ! labs.stitle.s = copy_string(NULL,labs.stitle.s); ! get_graph_framep(gno, &f); ! get_graph_legend(gno, &l); + if(data==define_view_xv1 || data==NULL) { xv_evalexpr(define_view_xv1, &v.xv1); + } + if(data==define_view_xv2 || data==NULL) { xv_evalexpr(define_view_xv2, &v.xv2); + } + if(data==define_view_yv1 || data==NULL) { xv_evalexpr(define_view_yv1, &v.yv1); + } + if(data==define_view_yv2 || data==NULL) { xv_evalexpr(define_view_yv2, &v.yv2); ! } ! if (isvalid_viewport(v)==FALSE) { errmsg("Invalid viewport coordinates"); return RETURN_FAILURE; } ! if(data==graph_type_choice_item || data==NULL) { ! set_graph_type(gno, GetChoice(graph_type_choice_item)); ! } ! if(data==stacked_item || data==NULL) { ! set_graph_stacked(gno,GetToggleButtonState(stacked_item) ); ! } ! if(data==bargap_item || data==NULL) { ! set_graph_bargap(gno, GetSpinChoice(bargap_item)); ! } ! if(data==znorm_item || data==NULL) { ! set_graph_znorm(gno, znorm); ! } ! if(data==label_title_text_item || data==NULL){ set_plotstr_string(&labs.title, GetTextString(label_title_text_item)); + } + if(data==title_size_item || data==NULL){ labs.title.charsize = GetCharSizeChoice(title_size_item); + } + if(data==title_color_item || data==NULL){ labs.title.color = GetOptionChoice(title_color_item); + } + if(data==title_font_item || data==NULL){ labs.title.font = GetOptionChoice(title_font_item); ! } ! if(data==label_subtitle_text_item || data==NULL){ set_plotstr_string(&labs.stitle, GetTextString(label_subtitle_text_item)); + } + if(data==stitle_size_item || data==NULL){ labs.stitle.charsize = GetCharSizeChoice(stitle_size_item); + } + if(data==stitle_color_item || data==NULL){ labs.stitle.color = GetOptionChoice(stitle_color_item); + } + if(data==stitle_font_item || data==NULL){ labs.stitle.font = GetOptionChoice(stitle_font_item); ! } ! if(data==frame_framestyle_choice_item || data==NULL){ f.type = GetChoice(frame_framestyle_choice_item); + } + if(data==frame_color_choice_item || data==NULL){ f.pen.color = GetOptionChoice(frame_color_choice_item); + } + if(data==frame_pattern_choice_item || data==NULL){ f.pen.pattern = GetOptionChoice(frame_pattern_choice_item); + } + if(data==frame_linew_choice_item || data==NULL){ f.linew = GetSpinChoice(frame_linew_choice_item); + } + if(data==frame_lines_choice_item || data==NULL){ f.lines = GetOptionChoice(frame_lines_choice_item); + } + if(data==frame_fillcolor_choice_item || data==NULL){ f.fillpen.color = GetOptionChoice(frame_fillcolor_choice_item); + } + if(data==frame_fillpattern_choice_item || data==NULL){ f.fillpen.pattern = GetOptionChoice(frame_fillpattern_choice_item); ! } ! if(data==legend_charsize_item || data==NULL){ l.charsize = GetCharSizeChoice(legend_charsize_item); + } + if(data==toggle_legends_item || data==NULL){ l.active = GetToggleButtonState(toggle_legends_item); + } + if(data==legends_vgap_item || data==NULL){ l.vgap = GetChoice(legends_vgap_item); + } + if(data==legends_hgap_item || data==NULL){ l.hgap = GetChoice(legends_hgap_item); + } + if(data==legends_len_item || data==NULL){ l.len = GetChoice(legends_len_item); + } + if(data==legends_invert_item || data==NULL){ l.invert = GetToggleButtonState(legends_invert_item); + } + if(data==toggle_legendloc_item || data==NULL){ l.loctype = GetChoice(toggle_legendloc_item) ? COORD_VIEW : COORD_WORLD; + } + if(data==legend_x_item || data==NULL){ xv_evalexpr(legend_x_item, &l.legx); + } + if(data==legend_y_item || data==NULL){ xv_evalexpr(legend_y_item, &l.legy); + } + if(data==legend_font_item || data==NULL){ l.font = GetOptionChoice(legend_font_item); + } + if(data==legend_color_item || data==NULL){ l.color = GetOptionChoice(legend_color_item); + } + if(data==legend_boxfillcolor_item || data==NULL){ l.boxfillpen.color = GetOptionChoice(legend_boxfillcolor_item); + } + if(data==legend_boxfillpat_item || data==NULL){ l.boxfillpen.pattern = GetOptionChoice(legend_boxfillpat_item); + } + if(data==legend_boxcolor_item || data==NULL){ l.boxpen.color = GetOptionChoice(legend_boxcolor_item); + } + if(data==legend_boxpattern_item || data==NULL){ l.boxpen.pattern = GetOptionChoice(legend_boxpattern_item); + } + if(data==legend_boxlinew_item || data==NULL){ l.boxlinew = GetSpinChoice(legend_boxlinew_item); + } + if(data==legend_boxlines_item || data==NULL){ l.boxlines = GetOptionChoice(legend_boxlines_item); + } ! /* ! * g[gno].xyflip = flipxy; */ set_graph_viewport(gno, v); set_graph_labels(gno, &labs); set_graph_framep(gno, &f); set_graph_legend(gno, &l); } } *************** *** 592,594 **** --- 774,777 ---- } } + diff -C 3 -P --exclude-from=/home/ed/src/exclude-iu-file -r ./src/hotwin.c ../grace-5.1.13iu/src/hotwin.c *** ./src/hotwin.c 2002-12-11 14:29:14.000000000 -0700 --- ../grace-5.1.13iu/src/hotwin.c 2003-12-03 16:34:20.000000000 -0700 *************** *** 54,60 **** static SetChoiceItem hotlink_set_item; static Widget hotlink_list_item; static Widget hotlink_file_item; ! static Widget *hotlink_source_item; void create_hotfiles_popup(Widget w, XtPointer client_data, XtPointer call_data); --- 54,60 ---- static SetChoiceItem hotlink_set_item; static Widget hotlink_list_item; static Widget hotlink_file_item; ! static OptionStructure *hotlink_source_item; void create_hotfiles_popup(Widget w, XtPointer client_data, XtPointer call_data); diff -C 3 -P --exclude-from=/home/ed/src/exclude-iu-file -r ./src/locatewin.c ../grace-5.1.13iu/src/locatewin.c *** ./src/locatewin.c 2000-04-20 13:58:26.000000000 -0600 --- ../grace-5.1.13iu/src/locatewin.c 2003-12-03 16:34:20.000000000 -0700 *************** *** 46,56 **** /* * Panel item declarations */ ! static Widget *delta_item; static OptionStructure *loc_formatx; static OptionStructure *loc_formaty; ! static Widget *loc_precx; ! static Widget *loc_precy; static Widget locx_item; static Widget locy_item; static Widget fixedp_item; --- 46,56 ---- /* * Panel item declarations */ ! static OptionStructure *delta_item; static OptionStructure *loc_formatx; static OptionStructure *loc_formaty; ! static OptionStructure *loc_precx; ! static OptionStructure *loc_precy; static Widget locx_item; static Widget locy_item; static Widget fixedp_item; diff -C 3 -P --exclude-from=/home/ed/src/exclude-iu-file -r ./src/miscwin.c ../grace-5.1.13iu/src/miscwin.c *** ./src/miscwin.c 2002-05-22 14:48:16.000000000 -0600 --- ../grace-5.1.13iu/src/miscwin.c 2003-12-03 16:34:20.000000000 -0700 *************** *** 61,67 **** static Widget noask_item; static Widget dc_item; ! static Widget *graph_focus_choice_item; static Widget graph_drawfocus_choice_item; static Widget autoredraw_type_item; --- 61,67 ---- static Widget noask_item; static Widget dc_item; ! static OptionStructure *graph_focus_choice_item; static Widget graph_drawfocus_choice_item; static Widget autoredraw_type_item; *************** *** 72,78 **** static Widget shexper_item; static Widget linkscroll_item; ! static Widget *hint_item; static Widget date_item; static Widget wrap_year_item; static Widget two_digits_years_item; --- 72,78 ---- static Widget shexper_item; static Widget linkscroll_item; ! static OptionStructure *hint_item; static Widget date_item; static Widget wrap_year_item; static Widget two_digits_years_item; diff -C 3 -P --exclude-from=/home/ed/src/exclude-iu-file -r ./src/motifinc.h ../grace-5.1.13iu/src/motifinc.h *** ./src/motifinc.h 2001-11-15 01:29:41.000000000 -0700 --- ../grace-5.1.13iu/src/motifinc.h 2003-12-03 16:34:20.000000000 -0700 *************** *** 57,62 **** --- 57,64 ---- #define CreateMenuSeparator(w) CreateSeparator(w) + #define AddTextItem2CB AddButtonCB + extern Widget app_shell; /* defined in xmgrace.c */ /* set selection gadget */ *************** *** 228,238 **** --- 230,253 ---- void * /* data the application registered */ ); + /* Spin Button CB procedure */ + typedef void (*Spin_CBProc)( + double, /* value of spinner */ + void * /* data the application registered */ + ); + /* Text input CB procedure */ typedef void (*Text_CBProc)( void * /* data the application registered */ ); + /* + * Scale input CB procedure */ + typedef void (*Scale_CBProc )( + int, /* scale value */ + void * /* data the application registered */ + ); + /* AAC Dialog CB procedure */ typedef int (*AACDialog_CBProc)( void * /* data the application registered */ *************** *** 270,275 **** --- 285,291 ---- void SetScaleValue(Widget w, int value); int GetScaleValue(Widget w); void SetScaleWidth(Widget w, int width); + void AddScaleCB( Widget w, OC_CBProc, void * ); Widget CreateCharSizeChoice(Widget parent, char *s); double GetCharSizeChoice(Widget w); *************** *** 322,327 **** --- 338,344 ---- int type, double min, double max, double incr); double GetSpinChoice(SpinStructure *spinp); void SetSpinChoice(SpinStructure *spinp, double value); + void AddSpinButtonCB(SpinStructure *spinp, Spin_CBProc, void *); TextStructure *CreateTextInput(Widget parent, char *s); TextStructure *CreateCSText(Widget parent, char *s); *************** *** 400,408 **** int SetSelectedSet(int gno, int setno, SetChoiceItem l); ! Widget *CreatePanelChoice(Widget parent, char *labstr, int nchoices, ...); ! void SetChoice(Widget * w, int value); ! int GetChoice(Widget * w); Widget CreateTextItem2(Widget parent, int len, char *s); Widget CreateTextItem4(Widget parent, int len, char *s); --- 417,427 ---- int SetSelectedSet(int gno, int setno, SetChoiceItem l); ! OptionStructure *CreatePanelChoice(Widget parent, char *labstr, int nchoices, ...); ! void SetChoice(OptionStructure * w, int value); ! int GetChoice(OptionStructure * w); ! void AddChoiceCB(OptionStructure * w, OC_CBProc cbproc, void *anydata); ! OptionStructure *CreatePrecisionChoice(Widget parent, char *s); Widget CreateTextItem2(Widget parent, int len, char *s); Widget CreateTextItem4(Widget parent, int len, char *s); *************** *** 411,417 **** Widget CreateCommandButtons(Widget parent, int n, Widget * buts, char **l); Widget CreateCommandButtonsNoDefault(Widget parent, int n, Widget * buts, char **l); ! Widget *CreatePrecisionChoice(Widget parent, char *s); TransformStructure *CreateTransformDialogForm(Widget parent, char *s, int sel_type); --- 430,436 ---- Widget CreateCommandButtons(Widget parent, int n, Widget * buts, char **l); Widget CreateCommandButtonsNoDefault(Widget parent, int n, Widget * buts, char **l); ! /*Widget *CreatePrecisionChoice(Widget parent, char *s);*/ TransformStructure *CreateTransformDialogForm(Widget parent, char *s, int sel_type); diff -C 3 -P --exclude-from=/home/ed/src/exclude-iu-file -r ./src/motifutils.c ../grace-5.1.13iu/src/motifutils.c *** ./src/motifutils.c 2003-01-26 14:16:33.000000000 -0700 --- ../grace-5.1.13iu/src/motifutils.c 2003-12-03 16:34:20.000000000 -0700 *************** *** 427,432 **** --- 427,450 ---- void *anydata; } OC_CBdata; + typedef struct { + Widget *opt; + void (*cbproc)(); + void *anydata; + } CH_CBdata; + + typedef struct { + SpinStructure *opt; + void (*cbproc)(); + void *anydata; + } SPIN_CBdata; + + typedef struct { + Widget opt; + void (*cbproc)(); + void *anydata; + } SCALE_CBdata; + static void oc_int_cb_proc(Widget w, XtPointer client_data, XtPointer call_data) { int value; *************** *** 679,684 **** --- 697,730 ---- SetSpinChoice(spinp, value); } + static void sp_double_cb_proc(Widget w, XtPointer client_data, XtPointer call_data) + { + SPIN_CBdata *cbdata = (SPIN_CBdata *) client_data; + XmAnyCallbackStruct* xmcb = call_data; + + if(w==cbdata->opt->arrow_up || w==cbdata->opt->arrow_down || + xmcb->reason == XmCR_ACTIVATE ) + cbdata->cbproc( GetSpinChoice(cbdata->opt), cbdata->anydata ); + } + + + void AddSpinButtonCB( SpinStructure *opt, Spin_CBProc cbproc, void *anydata ) + { + SPIN_CBdata *cbdata; + + cbdata = xmalloc(sizeof(OC_CBdata)); + + cbdata->opt = opt; + cbdata->cbproc = cbproc; + cbdata->anydata = anydata; + XtAddCallback(opt->text, XmNactivateCallback, + sp_double_cb_proc, (XtPointer) cbdata); + XtAddCallback(opt->arrow_up, XmNactivateCallback, + sp_double_cb_proc, (XtPointer) cbdata); + XtAddCallback(opt->arrow_down, XmNactivateCallback, + sp_double_cb_proc, (XtPointer) cbdata); + } + SpinStructure *CreateSpinChoice(Widget parent, char *s, int len, int type, double min, double max, double incr) { *************** *** 2599,2604 **** --- 2645,2656 ---- color_selectors[ncolor_selectors - 1] = retvalp; + /* + >>>>>>>>>>>>>>>>>>>> File 1 + >>>>>>>>>>>>>>>>>>>> File 2 + */ + UpdateOptionChoice(retvalp, ncolor_option_items, color_option_items); + paint_color_selector(retvalp); return retvalp; *************** *** 2611,2694 **** ! Widget *CreatePanelChoice(Widget parent, char *labelstr, int nchoices,...) { va_list var; int i = 0; ! XmString str; char *s; ! Widget *retval; nchoices--; ! retval = (Widget *) XtMalloc((nchoices + 2) * sizeof(Widget)); ! ! retval[1] = XmCreatePulldownMenu(parent, "pulldown", NULL, 0); ! va_start(var, nchoices); i = 0; while ((s = va_arg(var, char *)) != NULL) { ! retval[i + 2] = XmCreatePushButton(retval[1], s, NULL, 0); i++; } - if (i != nchoices) { - errmsg("Incorrect number of selections in CreatePanelChoice()"); - } - va_end(var); - - XtManageChildren(retval + 2, nchoices); - - retval[0] = XmCreateOptionMenu(parent, "optionmenu", NULL, 0); - str = XmStringCreateLocalized(labelstr); - XtVaSetValues(retval[0], - XmNlabelString, str, - XmNsubMenuId, retval[1], - NULL); - XmStringFree(str); - XtManageChild(retval[0]); return retval; } ! void SetChoice(Widget * w, int value) { ! Arg a; ! ! if (w == (Widget *) NULL) { ! return; ! } ! if (w[value + 2] == (Widget) NULL) { ! errwin("Internal error, SetChoice: Attempt to set NULL Widget"); ! return; ! } ! XtSetArg(a, XmNmenuHistory, w[value + 2]); ! XtSetValues(w[0], &a, 1); } ! int GetChoice(Widget * w) { ! Arg a; ! Widget warg; ! int i; ! if (w == NULL) { ! errwin("Internal error, GetChoice called with NULL argument"); ! return 0; ! } ! XtSetArg(a, XmNmenuHistory, &warg); ! XtGetValues(w[0], &a, 1); ! i = 0; ! while (w[i + 2] != warg) { ! if (w[i + 2] == NULL) { ! errwin("Internal error, GetChoice: Found NULL in Widget list"); ! return 0; ! } ! i++; ! } ! return i; } static OptionItem fmt_option_items[31] = { {FORMAT_DECIMAL, "Decimal" }, --- 2663,2709 ---- ! OptionStructure *CreatePanelChoice(Widget parent, char *labelstr, int nchoices,...) { + OptionItem *oi; va_list var; int i = 0; ! char *s; ! OptionStructure *retval; nchoices--; ! oi = (OptionItem *)calloc( nchoices, sizeof(OptionItem) ); va_start(var, nchoices); i = 0; while ((s = va_arg(var, char *)) != NULL) { ! oi[i].value = i; ! oi[i].label = strdup(s); i++; } + retval = CreateOptionChoice(parent, labelstr, 1, nchoices, oi ); return retval; } ! void SetChoice(OptionStructure *w, int value) { ! SetOptionChoice( w, value ); } ! int GetChoice(OptionStructure *w) { ! return GetOptionChoice( w ); ! } ! void AddChoiceCB( OptionStructure *opt, OC_CBProc cbproc, void *anydata) ! { ! AddOptionChoiceCB( opt, cbproc, anydata ); } + static OptionItem fmt_option_items[31] = { {FORMAT_DECIMAL, "Decimal" }, *************** *** 2752,2769 **** return(retval); } ! Widget *CreatePrecisionChoice(Widget parent, char *s) { ! Widget *w; ! ! w = CreatePanelChoice(parent, s, 11, "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL, 0); - - return(w); } --- 2767,2780 ---- return(retval); } ! OptionStructure *CreatePrecisionChoice(Widget parent, char *s) { ! return CreatePanelChoice(parent, s, 11, "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL, 0); } *************** *** 2794,2799 **** --- 2805,2831 ---- return w; } + void scale_int_cb_proc( Widget w, XtPointer client_data, XtPointer call_data) + { + SCALE_CBdata *cbdata = (SCALE_CBdata *) client_data; + + cbdata->cbproc( GetScaleValue(cbdata->opt), cbdata->anydata ); + } + + void AddScaleCB( Widget w, OC_CBProc cbproc, void *anydata ) + { + SCALE_CBdata *cbdata; + + cbdata = xmalloc(sizeof(SCALE_CBdata)); + + cbdata->opt = w; + cbdata->cbproc = cbproc; + cbdata->anydata = anydata; + XtAddCallback(w, XmNvalueChangedCallback, + scale_int_cb_proc, (XtPointer) cbdata); + } + + void SetScaleValue(Widget w, int value) { XtVaSetValues(w, XmNvalue, value, NULL); *************** *** 3080,3086 **** } /* check for mutually exclusive selections */ ! if (exclusive && *gsrc == *gdest && *nsdest != 0) { int i; for (i = 0; i < *nssrc; i++) { if ((*svaluessrc)[i] == (*svaluesdest)[i]) { --- 3112,3118 ---- } /* check for mutually exclusive selections */ ! if (exclusive && *gsrc != *gdest && *nsdest != 0) { int i; for (i = 0; i < *nssrc; i++) { if ((*svaluessrc)[i] == (*svaluesdest)[i]) { diff -C 3 -P --exclude-from=/home/ed/src/exclude-iu-file -r ./src/plotwin.c ../grace-5.1.13iu/src/plotwin.c *** ./src/plotwin.c 2000-07-12 16:31:48.000000000 -0600 --- ../grace-5.1.13iu/src/plotwin.c 2003-12-03 16:34:20.000000000 -0700 *************** *** 57,71 **** --- 57,84 ---- static OptionStructure *timestamp_color_item; Widget timestamp_x_item; Widget timestamp_y_item; + static Widget instantupdate_item; + static int instantupdate=0; static int plot_define_notify_proc(void *data); static void update_plot_items(void); + + void oc_plot_cb( int a, void *data ) + { + plot_define_notify_proc( data ); + } + void create_plot_frame_cb(void *data) { create_plot_frame(); } + void plotwin_iu(int a, void *data) + { + instantupdate = a; + } + void create_plot_frame(void) { set_wait_cursor(); *************** *** 77,97 **** --- 90,132 ---- panel = CreateVContainer(plot_frame); + instantupdate_item = CreateToggleButton(panel, "Instant update"); + SetToggleButtonState( instantupdate_item, instantupdate ); + AddToggleButtonCB(instantupdate_item, (TB_CBProc)plotwin_iu, NULL); + fr = CreateFrame(panel, "Page background"); rc = CreateHContainer(fr); bg_color_item = CreateColorChoice(rc, "Color:"); + AddOptionChoiceCB( bg_color_item, (TB_CBProc)oc_plot_cb, + (void *)bg_color_item); bg_fill_item = CreateToggleButton(rc, "Fill"); + AddToggleButtonCB( bg_fill_item, (TB_CBProc)oc_plot_cb, + (void *)bg_fill_item); fr = CreateFrame(panel, "Time stamp"); rc = CreateVContainer(fr); timestamp_active_item = CreateToggleButton(rc, "Enable"); + AddToggleButtonCB( timestamp_active_item, (TB_CBProc)oc_plot_cb, + (void *)timestamp_active_item); timestamp_font_item = CreateFontChoice(rc, "Font:"); + AddOptionChoiceCB( timestamp_font_item, (TB_CBProc)oc_plot_cb, + (void *)timestamp_font_item); timestamp_color_item = CreateColorChoice(rc, "Color:"); + AddOptionChoiceCB( timestamp_color_item, (TB_CBProc)oc_plot_cb, + (void *)timestamp_color_item); timestamp_size_item = CreateCharSizeChoice(rc, "Character size"); + AddScaleCB( timestamp_size_item, (Scale_CBProc)oc_plot_cb, + (void *)timestamp_size_item); timestamp_rotate_item = CreateAngleChoice(rc, "Angle"); + AddScaleCB( timestamp_rotate_item, (Scale_CBProc)oc_plot_cb, + (void *)timestamp_rotate_item); timestamp_x_item = CreateTextItem2(rc, 10, "Timestamp X:"); + AddTextItem2CB( timestamp_x_item, (Button_CBProc)plot_define_notify_proc, + (void *)timestamp_x_item); timestamp_y_item = CreateTextItem2(rc, 10, "Timestamp Y:"); + AddTextItem2CB( timestamp_y_item, (Button_CBProc)plot_define_notify_proc, + (void *)timestamp_y_item); CreateAACDialog(plot_frame, panel, plot_define_notify_proc, NULL); } *************** *** 126,143 **** static int plot_define_notify_proc(void *data) { setbgcolor(GetOptionChoice(bg_color_item)); setbgfill(GetToggleButtonState(bg_fill_item)); timestamp.active = GetToggleButtonState(timestamp_active_item); timestamp.font = GetOptionChoice(timestamp_font_item); timestamp.color = GetOptionChoice(timestamp_color_item); timestamp.charsize = GetCharSizeChoice(timestamp_size_item); ! timestamp.rot = GetAngleChoice(timestamp_rotate_item); xv_evalexpr(timestamp_x_item, ×tamp.x); xv_evalexpr(timestamp_y_item, ×tamp.y); set_dirtystate(); xdrawgraph(); --- 161,190 ---- static int plot_define_notify_proc(void *data) { + if(!instantupdate && data!=NULL) + return RETURN_SUCCESS; + + if(data==bg_color_item || data==NULL) setbgcolor(GetOptionChoice(bg_color_item)); + if(data==bg_fill_item || data==NULL) setbgfill(GetToggleButtonState(bg_fill_item)); + if(data==timestamp_active_item || data==NULL) timestamp.active = GetToggleButtonState(timestamp_active_item); + if(data==timestamp_font_item || data==NULL) timestamp.font = GetOptionChoice(timestamp_font_item); + if(data==timestamp_color_item || data==NULL) timestamp.color = GetOptionChoice(timestamp_color_item); + if(data==timestamp_size_item || data==NULL) timestamp.charsize = GetCharSizeChoice(timestamp_size_item); ! if(data==timestamp_rotate_item || data==NULL) ! timestamp.rot = (double) GetAngleChoice(timestamp_rotate_item); + if(data==timestamp_x_item || data==NULL) xv_evalexpr(timestamp_x_item, ×tamp.x); + if(data==timestamp_y_item || data==NULL) xv_evalexpr(timestamp_y_item, ×tamp.y); set_dirtystate(); xdrawgraph(); diff -C 3 -P --exclude-from=/home/ed/src/exclude-iu-file -r ./src/regionwin.c ../grace-5.1.13iu/src/regionwin.c *** ./src/regionwin.c 2002-08-27 13:58:52.000000000 -0600 --- ../grace-5.1.13iu/src/regionwin.c 2003-12-03 16:34:20.000000000 -0700 *************** *** 60,67 **** static void do_clear_region(Widget w, XtPointer client_data, XtPointer call_data); ! static Widget *define_region_item; ! static Widget *define_type_item; static char buf[256]; --- 60,67 ---- static void do_clear_region(Widget w, XtPointer client_data, XtPointer call_data); ! static OptionStructure *define_region_item; ! static OptionStructure *define_type_item; static char buf[256]; *************** *** 126,132 **** unset_wait_cursor(); } ! static Widget *clear_region_item; static void do_clear_region(Widget w, XtPointer client_data, XtPointer call_data) { --- 126,132 ---- unset_wait_cursor(); } ! static OptionStructure *clear_region_item; static void do_clear_region(Widget w, XtPointer client_data, XtPointer call_data) { *************** *** 216,223 **** unset_wait_cursor(); } ! static Widget *reporton_region_item; ! static Widget *reporton_type_item; static void do_reporton_region(Widget w, XtPointer client_data, XtPointer call_data) { --- 216,223 ---- unset_wait_cursor(); } ! static OptionStructure *reporton_region_item; ! static OptionStructure *reporton_type_item; static void do_reporton_region(Widget w, XtPointer client_data, XtPointer call_data) { diff -C 3 -P --exclude-from=/home/ed/src/exclude-iu-file -r ./src/rstdrv.c ../grace-5.1.13iu/src/rstdrv.c *** ./src/rstdrv.c 2002-12-11 14:24:35.000000000 -0700 --- ../grace-5.1.13iu/src/rstdrv.c 2003-12-03 16:34:20.000000000 -0700 *************** *** 1001,1007 **** static int set_pnm_setup_proc(void *data); static Widget pnm_setup_frame; static Widget pnm_setup_rawbits_item; ! static Widget *pnm_setup_format_item; #ifdef HAVE_LIBPNG static void update_png_setup_frame(void); --- 1001,1007 ---- static int set_pnm_setup_proc(void *data); static Widget pnm_setup_frame; static Widget pnm_setup_rawbits_item; ! static OptionStructure *pnm_setup_format_item; #ifdef HAVE_LIBPNG static void update_png_setup_frame(void); *************** *** 1110,1116 **** static Widget jpg_setup_progressive_item; static SpinStructure *jpg_setup_quality_item; static SpinStructure *jpg_setup_smoothing_item; ! static Widget *jpg_setup_dct_item; void jpg_gui_setup(void) { --- 1110,1116 ---- static Widget jpg_setup_progressive_item; static SpinStructure *jpg_setup_quality_item; static SpinStructure *jpg_setup_smoothing_item; ! static OptionStructure *jpg_setup_dct_item; void jpg_gui_setup(void) { *************** *** 1141,1147 **** "Fast integer", "Slow integer", "Float", ! 0, 0); CreateAACDialog(jpg_setup_frame, jpg_setup_rc, set_jpg_setup_proc, NULL); } --- 1141,1147 ---- "Fast integer", "Slow integer", "Float", ! 0, 0); CreateAACDialog(jpg_setup_frame, jpg_setup_rc, set_jpg_setup_proc, NULL); } diff -C 3 -P --exclude-from=/home/ed/src/exclude-iu-file -r ./src/setappwin.c ../grace-5.1.13iu/src/setappwin.c *** ./src/setappwin.c 2003-02-21 14:36:49.000000000 -0700 --- ../grace-5.1.13iu/src/setappwin.c 2003-12-03 16:34:20.000000000 -0700 *************** *** 64,70 **** static Widget duplegs_item; static OptionStructure *type_item; ! static Widget *toggle_symbols_item; static Widget symsize_item; static SpinStructure *symskip_item; static OptionStructure *symcolor_item; --- 64,70 ---- static Widget duplegs_item; static OptionStructure *type_item; ! static OptionStructure *toggle_symbols_item; static Widget symsize_item; static SpinStructure *symskip_item; static OptionStructure *symcolor_item; *************** *** 81,99 **** static SpinStructure *toggle_width_item; static Widget dropline_item; static OptionStructure *toggle_lines_item; ! static Widget *toggle_linet_item; ! static Widget *toggle_filltype_item; ! static Widget *toggle_fillrule_item; static OptionStructure *toggle_fillpat_item; static OptionStructure *toggle_fillcol_item; static ListStructure *toggle_symset_item; static Widget baseline_item; ! static Widget *baselinetype_item; static TextStructure *legend_str_item; static Widget errbar_active_item; ! static Widget *errbar_ptype_item; static OptionStructure *errbar_color_item; static OptionStructure *errbar_pattern_item; static Widget errbar_size_item; --- 81,99 ---- static SpinStructure *toggle_width_item; static Widget dropline_item; static OptionStructure *toggle_lines_item; ! static OptionStructure *toggle_linet_item; ! static OptionStructure *toggle_filltype_item; ! static OptionStructure *toggle_fillrule_item; static OptionStructure *toggle_fillpat_item; static OptionStructure *toggle_fillcol_item; static ListStructure *toggle_symset_item; static Widget baseline_item; ! static OptionStructure *baselinetype_item; static TextStructure *legend_str_item; static Widget errbar_active_item; ! static OptionStructure *errbar_ptype_item; static OptionStructure *errbar_color_item; static OptionStructure *errbar_pattern_item; static Widget errbar_size_item; *************** *** 105,129 **** static SpinStructure *errbar_cliplen_item; static Widget avalue_active_item; ! static Widget *avalue_type_item; static OptionStructure *avalue_font_item; static OptionStructure *avalue_color_item; static Widget avalue_charsize_item ; static Widget avalue_angle_item; static OptionStructure *avalue_format_item; ! static Widget *avalue_precision_item; static Widget avalue_offsetx; static Widget avalue_offsety; static Widget avalue_prestr; static Widget avalue_appstr; static Widget csync_item; static void UpdateSymbols(int gno, int value); static void set_cset_proc(int n, int *values, void *data); static int setapp_aac_cb(void *data); static void setapp_data_proc(void *data); static void csync_cb(int value, void *data); /* * create the symbols popup --- 105,151 ---- static SpinStructure *errbar_cliplen_item; static Widget avalue_active_item; ! static OptionStructure *avalue_type_item; static OptionStructure *avalue_font_item; static OptionStructure *avalue_color_item; static Widget avalue_charsize_item ; static Widget avalue_angle_item; static OptionStructure *avalue_format_item; ! static OptionStructure *avalue_precision_item; static Widget avalue_offsetx; static Widget avalue_offsety; static Widget avalue_prestr; static Widget avalue_appstr; static Widget csync_item; + static Widget instantupdate_item; + static int instantupdate=0; static void UpdateSymbols(int gno, int value); static void set_cset_proc(int n, int *values, void *data); static int setapp_aac_cb(void *data); static void setapp_data_proc(void *data); static void csync_cb(int value, void *data); + static int oc_setapp_cb( int c, void *data ); + int sp_setapp_cb( double a, void *data ); + + /* + * callback functions to do incremental set appearance updates + */ + static int oc_setapp_cb( int c, void *data ) + { + return setapp_aac_cb( data ); + } + + int sp_setapp_cb( double a, void *data ) + { + return setapp_aac_cb( data ); + } + + void setwin_iu( int a, void *data ) + { + instantupdate = a; + } /* * create the symbols popup *************** *** 175,180 **** --- 197,205 ---- "Duplicate legends", 'D', NULL, NULL); csync_item = CreateMenuToggle(menupane, "Color sync", 's', NULL, NULL); SetToggleButtonState(csync_item, TRUE); + instantupdate_item = CreateMenuToggle(menupane, "Instantaneous update", + 'u', setwin_iu, NULL); + SetToggleButtonState(instantupdate_item, instantupdate); menupane = CreateMenu(menubar, "Help", 'H', TRUE); CreateMenuHelpButton(menupane, "On set appearance", 's', *************** *** 196,202 **** setapp_main = CreateTabPage(setapp_tab, "Main"); fr = CreateFrame(setapp_main, "Set presentation"); ! type_item = CreateSetTypeChoice(fr, "Type:"); rc2 = CreateHContainer(setapp_main); --- 221,229 ---- setapp_main = CreateTabPage(setapp_tab, "Main"); fr = CreateFrame(setapp_main, "Set presentation"); ! type_item = CreateSetTypeChoice(fr, "Type:"); ! AddOptionChoiceCB( type_item, (OC_CBProc)oc_setapp_cb, ! type_item ); rc2 = CreateHContainer(setapp_main); *************** *** 219,228 **** --- 246,263 ---- "Char", /* 11 */ NULL, 0); + AddChoiceCB( toggle_symbols_item, (OC_CBProc)oc_setapp_cb, + (void *)toggle_symbols_item); symsize_item = CreateCharSizeChoice(rc, "Size"); + AddScaleCB( symsize_item, (Scale_CBProc)oc_setapp_cb, + (void *)symsize_item); symcolor_item = CreateColorChoice(rc, "Color:"); AddOptionChoiceCB(symcolor_item, csync_cb, (void *) CSYNC_SYM); + AddOptionChoiceCB(symcolor_item, (OC_CBProc)oc_setapp_cb, + (void *)symcolor_item ); symchar_item = CreateTextItem2(rc, 3, "Symbol char:"); + AddTextItem2CB( symchar_item, (Button_CBProc)setapp_aac_cb, + (void *)symchar_item ); fr = CreateFrame(rc2, "Line properties"); rc = CreateVContainer(fr); *************** *** 236,253 **** "3-Segments", NULL, 0); toggle_lines_item = CreateLineStyleChoice(rc, "Style:"); toggle_width_item = CreateLineWidthChoice(rc, "Width:"); toggle_color_item = CreateColorChoice(rc, "Color:"); ! AddOptionChoiceCB(toggle_color_item, csync_cb, (void *) CSYNC_LINE); fr = CreateFrame(setapp_main, "Legend"); legend_str_item = CreateCSText(fr, "String:"); fr = CreateFrame(setapp_main, "Display options"); rc2 = CreateHContainer(fr); avalue_active_item = CreateToggleButton(rc2, "Annotate values"); errbar_active_item = CreateToggleButton(rc2, "Display error bars"); /* ------------ Symbols tab -------------- */ --- 271,302 ---- "3-Segments", NULL, 0); + AddChoiceCB(toggle_linet_item, (OC_CBProc)oc_setapp_cb, + (void *)toggle_linet_item); toggle_lines_item = CreateLineStyleChoice(rc, "Style:"); + AddOptionChoiceCB( toggle_lines_item, (OC_CBProc)oc_setapp_cb, + (void *)toggle_lines_item); toggle_width_item = CreateLineWidthChoice(rc, "Width:"); + AddSpinButtonCB( toggle_width_item, (Spin_CBProc)sp_setapp_cb, + (void *)toggle_width_item); toggle_color_item = CreateColorChoice(rc, "Color:"); ! AddOptionChoiceCB( toggle_color_item, csync_cb, (void *)CSYNC_LINE); ! AddOptionChoiceCB( toggle_color_item, (OC_CBProc)oc_setapp_cb, ! (void *)toggle_color_item); fr = CreateFrame(setapp_main, "Legend"); legend_str_item = CreateCSText(fr, "String:"); + AddTextInputCB( legend_str_item, (Button_CBProc)setapp_aac_cb, + (void *)legend_str_item); fr = CreateFrame(setapp_main, "Display options"); rc2 = CreateHContainer(fr); avalue_active_item = CreateToggleButton(rc2, "Annotate values"); + AddToggleButtonCB( avalue_active_item, (TB_CBProc)oc_setapp_cb, + avalue_active_item ); errbar_active_item = CreateToggleButton(rc2, "Display error bars"); + AddToggleButtonCB( errbar_active_item, (OC_CBProc)oc_setapp_cb, + &errbar_active_item ); /* ------------ Symbols tab -------------- */ *************** *** 259,278 **** rc2 = CreateHContainer(rc); symlines_item = CreateLineStyleChoice(rc2, "Style:"); symlinew_item = CreateLineWidthChoice(rc2, "Width:"); sympattern_item = CreatePatternChoice(rc, "Pattern:"); fr = CreateFrame(setapp_symbols, "Symbol fill"); rc = CreateHContainer(fr); symfillcolor_item = CreateColorChoice(rc, "Color:"); symfillpattern_item = CreatePatternChoice(rc, "Pattern:"); fr = CreateFrame(setapp_symbols, "Extra"); rc = CreateVContainer(fr); symskip_item = CreateSpinChoice(rc, "Symbol skip:", 5, SPIN_TYPE_INT, (double) 0, (double) 100000, (double) 1); char_font_item = CreateFontChoice(rc, "Font for char symbol:"); ! /* ------------ Line tab -------------- */ --- 308,339 ---- rc2 = CreateHContainer(rc); symlines_item = CreateLineStyleChoice(rc2, "Style:"); + AddOptionChoiceCB( symlines_item, (OC_CBProc)oc_setapp_cb, (void *)symlines_item ); symlinew_item = CreateLineWidthChoice(rc2, "Width:"); + AddSpinButtonCB( symlinew_item, (Spin_CBProc)sp_setapp_cb, + (void *)symlinew_item ); sympattern_item = CreatePatternChoice(rc, "Pattern:"); + AddOptionChoiceCB( sympattern_item, (OC_CBProc)oc_setapp_cb, + (void *)sympattern_item ); fr = CreateFrame(setapp_symbols, "Symbol fill"); rc = CreateHContainer(fr); symfillcolor_item = CreateColorChoice(rc, "Color:"); + AddOptionChoiceCB( symfillcolor_item, (OC_CBProc)oc_setapp_cb, + (void *)symfillcolor_item ); symfillpattern_item = CreatePatternChoice(rc, "Pattern:"); + AddOptionChoiceCB( symfillpattern_item, (OC_CBProc)oc_setapp_cb, + (void *)symfillpattern_item ); fr = CreateFrame(setapp_symbols, "Extra"); rc = CreateVContainer(fr); symskip_item = CreateSpinChoice(rc, "Symbol skip:", 5, SPIN_TYPE_INT, (double) 0, (double) 100000, (double) 1); + AddSpinButtonCB( symskip_item, (Spin_CBProc)sp_setapp_cb, + (void *)(&symskip_item) ); char_font_item = CreateFontChoice(rc, "Font for char symbol:"); ! AddOptionChoiceCB( char_font_item, (OC_CBProc)oc_setapp_cb, ! (void *)char_font_item ); /* ------------ Line tab -------------- */ *************** *** 281,287 **** --- 342,352 ---- fr = CreateFrame(setapp_line, "Line properties"); rc = CreateHContainer(fr); toggle_pattern_item = CreatePatternChoice(rc, "Pattern:"); + AddOptionChoiceCB( toggle_pattern_item, (OC_CBProc)oc_setapp_cb, + (void *)toggle_pattern_item ); dropline_item = CreateToggleButton(rc, "Draw drop lines"); + AddToggleButtonCB( dropline_item, (OC_CBProc)oc_setapp_cb, + (void *)dropline_item ); fr = CreateFrame(setapp_line, "Fill properties"); rc = CreateVContainer(fr); *************** *** 293,307 **** --- 358,380 ---- "To baseline", NULL, 0); + AddChoiceCB(toggle_filltype_item, (OC_CBProc)oc_setapp_cb, + (void *)toggle_filltype_item); toggle_fillrule_item = CreatePanelChoice(rc2, "Rule:", 3, "Winding", "Even-Odd", NULL, 0); + AddChoiceCB(toggle_fillrule_item, (OC_CBProc)oc_setapp_cb, + (void *)toggle_fillrule_item); rc2 = CreateHContainer(rc); toggle_fillpat_item = CreatePatternChoice(rc2, "Pattern:"); + AddOptionChoiceCB( toggle_fillpat_item, (OC_CBProc)oc_setapp_cb, + (void *)toggle_fillpat_item ); toggle_fillcol_item = CreateColorChoice(rc2, "Color:"); + AddOptionChoiceCB( toggle_fillcol_item, (OC_CBProc)oc_setapp_cb, + (void *)toggle_fillcol_item ); fr = CreateFrame(setapp_line, "Base line"); rc = CreateHContainer(fr); *************** *** 315,321 **** --- 388,398 ---- "Set average", NULL, 0); + AddOptionChoiceCB( baselinetype_item, (OC_CBProc)oc_setapp_cb, + (void *)baselinetype_item ); baseline_item = CreateToggleButton(rc, "Draw line"); + AddToggleButtonCB( baseline_item, (OC_CBProc)oc_setapp_cb, + (void *)baseline_item ); /* ------------ AValue tab -------------- */ *************** *** 327,348 **** --- 404,439 ---- rc2 = CreateHContainer(rc); avalue_font_item = CreateFontChoice(rc2, "Font:"); + AddOptionChoiceCB( avalue_font_item, (OC_CBProc)oc_setapp_cb, + avalue_font_item); avalue_charsize_item = CreateCharSizeChoice(rc2, "Char size"); SetScaleWidth(avalue_charsize_item, 120); + AddScaleCB( avalue_charsize_item, (OC_CBProc)oc_setapp_cb, + avalue_charsize_item ); rc2 = CreateHContainer(rc); avalue_color_item = CreateColorChoice(rc2, "Color:"); + AddOptionChoiceCB( avalue_color_item, (OC_CBProc)oc_setapp_cb, + (void *) avalue_color_item); avalue_angle_item = CreateAngleChoice(rc2, "Angle"); SetScaleWidth(avalue_angle_item, 180); + AddScaleCB( avalue_angle_item, (OC_CBProc)oc_setapp_cb, + (void *)avalue_angle_item ); rc2 = CreateHContainer(rc); avalue_prestr = CreateTextItem2(rc2, 10, "Prepend:"); + AddTextItem2CB( avalue_prestr, (Button_CBProc)setapp_aac_cb, + (void *)avalue_prestr ); avalue_appstr = CreateTextItem2(rc2, 10, "Append:"); + AddTextItem2CB( avalue_appstr, (Button_CBProc)setapp_aac_cb, + (void *)avalue_appstr ); fr = CreateFrame(setapp_avalue, "Format options"); rc = CreateVContainer(fr); rc2 = CreateHContainer(rc); avalue_format_item = CreateFormatChoice(rc, "Format:"); + AddOptionChoiceCB( avalue_format_item, (OC_CBProc)oc_setapp_cb, + (void *) avalue_format_item); avalue_type_item = CreatePanelChoice(rc2, "Type:", 7, "None", *************** *** 353,364 **** --- 444,463 ---- "Z", NULL, 0); + AddChoiceCB(avalue_type_item, (OC_CBProc)oc_setapp_cb, + avalue_type_item ); avalue_precision_item = CreatePrecisionChoice(rc2, "Precision:"); + AddChoiceCB(avalue_precision_item, (OC_CBProc)oc_setapp_cb, + avalue_precision_item ); fr = CreateFrame(setapp_avalue, "Placement"); rc2 = CreateHContainer(fr); avalue_offsetx = CreateTextItem2(rc2, 10, "X offset:"); + AddTextItem2CB( avalue_offsetx, (Button_CBProc)setapp_aac_cb, + avalue_offsetx ); avalue_offsety = CreateTextItem2(rc2, 10, "Y offset:"); + AddTextItem2CB( avalue_offsety, (Button_CBProc)setapp_aac_cb, + avalue_offsety ); /* ------------ Errbar tab -------------- */ *************** *** 379,406 **** "Both", NULL, 0); errbar_color_item = CreateColorChoice(rc, "Color:"); errbar_pattern_item = CreatePatternChoice(rc, "Pattern:"); fr = CreateFrame(rc1, "Clipping"); rc = CreateVContainer(fr); errbar_aclip_item = CreateToggleButton(rc, "Arrow clip"); errbar_cliplen_item = CreateSpinChoice(rc, "Max length:", 3, SPIN_TYPE_FLOAT, 0.0, 10.0, 0.1); rc1 = CreateVContainer(rc2); fr = CreateFrame(rc1, "Bar line"); rc = CreateVContainer(fr); errbar_size_item = CreateCharSizeChoice(rc, "Size"); errbar_width_item = CreateLineWidthChoice(rc, "Width:"); errbar_lines_item = CreateLineStyleChoice(rc, "Style:"); fr = CreateFrame(rc1, "Riser line"); rc = CreateVContainer(fr); errbar_riserlinew_item = CreateLineWidthChoice(rc, "Width:"); errbar_riserlines_item = CreateLineStyleChoice(rc, "Style:"); ! SelectTabPage(setapp_tab, setapp_main); --- 478,524 ---- "Both", NULL, 0); + AddChoiceCB(errbar_ptype_item, (OC_CBProc)oc_setapp_cb, + (void *)errbar_ptype_item ); errbar_color_item = CreateColorChoice(rc, "Color:"); + AddOptionChoiceCB( errbar_color_item, (OC_CBProc)oc_setapp_cb, + (void *) errbar_color_item); errbar_pattern_item = CreatePatternChoice(rc, "Pattern:"); + AddOptionChoiceCB( errbar_pattern_item, (OC_CBProc)oc_setapp_cb, + (void *) errbar_pattern_item); fr = CreateFrame(rc1, "Clipping"); rc = CreateVContainer(fr); errbar_aclip_item = CreateToggleButton(rc, "Arrow clip"); + AddToggleButtonCB( errbar_aclip_item, (OC_CBProc)oc_setapp_cb, + (void *) errbar_aclip_item ); errbar_cliplen_item = CreateSpinChoice(rc, "Max length:", 3, SPIN_TYPE_FLOAT, 0.0, 10.0, 0.1); + AddSpinButtonCB( errbar_cliplen_item, (Spin_CBProc)sp_setapp_cb, + (void *)errbar_cliplen_item ); rc1 = CreateVContainer(rc2); fr = CreateFrame(rc1, "Bar line"); rc = CreateVContainer(fr); errbar_size_item = CreateCharSizeChoice(rc, "Size"); + AddScaleCB( errbar_size_item, (OC_CBProc)oc_setapp_cb, + (void *)errbar_size_item ); errbar_width_item = CreateLineWidthChoice(rc, "Width:"); + AddSpinButtonCB( errbar_width_item, (Spin_CBProc)sp_setapp_cb, + (void *) errbar_width_item); errbar_lines_item = CreateLineStyleChoice(rc, "Style:"); + AddOptionChoiceCB( errbar_lines_item, (OC_CBProc)oc_setapp_cb, + (void *) errbar_lines_item); fr = CreateFrame(rc1, "Riser line"); rc = CreateVContainer(fr); errbar_riserlinew_item = CreateLineWidthChoice(rc, "Width:"); + AddSpinButtonCB( errbar_riserlinew_item, (Spin_CBProc)sp_setapp_cb, + (void *) errbar_riserlinew_item); errbar_riserlines_item = CreateLineStyleChoice(rc, "Style:"); ! AddOptionChoiceCB( errbar_riserlines_item, (OC_CBProc)oc_setapp_cb, ! (void *) errbar_riserlines_item); SelectTabPage(setapp_tab, setapp_main); *************** *** 492,536 **** } else { for(i = 0; i < cd; i++) { setno = selset[i]; ! get_graph_plotarr(get_cg(), setno, &p); ! p.symskip = symskip; ! p.symsize = symsize; ! p.symlinew = symlinew; ! p.symlines = symlines; ! p.symchar = symchar; ! p.charfont = charfont; ! p.filltype = filltype; ! p.fillrule = fillrule; ! p.setfillpen.pattern = fillpat; ! p.setfillpen.color = fillcol; ! if (cd == 1 || duplegs) { ! strcpy(p.lstr, GetTextString(legend_str_item)); ! } ! p.sym = sym; ! p.linet = linet; ! p.lines = line; ! p.linew = wid; ! p.linepen.color = color; ! p.linepen.pattern = pattern; ! p.sympen.color = symcolor; ! p.sympen.pattern = sympattern; ! p.symfillpen.color = symfillcolor; ! p.symfillpen.pattern = symfillpattern; ! p.dropline = dropline; ! p.baseline = baseline; ! p.baseline_type = baselinetype; ! ! errbar.ptype = GetChoice(errbar_ptype_item); ! errbar.pen.color = GetOptionChoice(errbar_color_item); ! errbar.pen.pattern = GetOptionChoice(errbar_pattern_item); ! errbar.arrow_clip = GetToggleButtonState(errbar_aclip_item); ! errbar.cliplen = GetSpinChoice(errbar_cliplen_item); ! ! p.errbar = errbar; ! p.avalue = avalue; ! ! set_graph_plotarr(get_cg(), setno, &p); ! set_dataset_type(get_cg(), setno, type); } xfree(selset); } --- 610,763 ---- } else { for(i = 0; i < cd; i++) { setno = selset[i]; ! if(data==type_item || data==NULL){ ! set_dataset_type(get_cg(), setno, GetOptionChoice(type_item)); ! } ! get_graph_plotarr( get_cg(), setno, &p ); ! if(data == &symskip_item || data == NULL){ ! p.symskip = GetSpinChoice(symskip_item); ! } ! if(data == symsize_item || data == NULL){ ! p.symsize = GetCharSizeChoice(symsize_item); ! } ! if(data == symlinew_item || data == NULL){ ! p.symlinew = GetSpinChoice(symlinew_item); ! } ! if(data == symlines_item || data == NULL){ ! p.symlines = GetOptionChoice(symlines_item); ! } ! if(data==symchar_item || data == NULL){ ! p.symchar = atoi(xv_getstr(symchar_item)); ! } ! if(data==char_font_item || data==NULL){ ! p.charfont = GetOptionChoice(char_font_item); ! } ! if(data==toggle_filltype_item || data==NULL){ ! p.filltype = GetChoice(toggle_filltype_item); ! } ! if(data==toggle_fillrule_item || data==NULL){ ! p.fillrule = GetChoice(toggle_fillrule_item); ! } ! if(data==toggle_fillpat_item || data==NULL){ ! p.setfillpen.pattern = GetOptionChoice(toggle_fillpat_item); ! } ! if(data==toggle_fillcol_item || data==NULL){ ! p.setfillpen.color = GetOptionChoice(toggle_fillcol_item); ! } ! if(data==legend_str_item || data==NULL){ ! if (cd==1 || duplegs) { ! strcpy(p.lstr, GetTextString(legend_str_item)); ! } ! } ! if(data==toggle_symbols_item || data==NULL){ ! p.sym = GetChoice(toggle_symbols_item); ! } ! if(data==toggle_linet_item || data==NULL){ ! p.linet = GetChoice(toggle_linet_item); ! } ! if(data==toggle_lines_item || data==NULL){ ! p.lines = GetOptionChoice(toggle_lines_item); ! } ! if(data==toggle_width_item || data==NULL){ ! p.linew = GetSpinChoice(toggle_width_item); ! } ! if(data==toggle_color_item || data==NULL){ ! p.linepen.color = GetOptionChoice(toggle_color_item); ! } ! if(data==toggle_pattern_item || data==NULL){ ! p.linepen.pattern = GetOptionChoice(toggle_pattern_item); ! } ! if(data==symcolor_item || data==NULL){ ! p.sympen.color = GetOptionChoice(symcolor_item); ! } ! if(data==sympattern_item || data==NULL){ ! p.sympen.pattern = GetOptionChoice(sympattern_item); ! } ! if(data==symfillcolor_item || data==NULL){ ! p.symfillpen.color = GetOptionChoice(symfillcolor_item); ! } ! if(data==symfillpattern_item || data==NULL){ ! p.symfillpen.pattern = GetOptionChoice(symfillpattern_item); ! } ! if(data== dropline_item || data==NULL){ ! p.dropline = GetToggleButtonState(dropline_item); ! } ! if(data==baseline_item || data==NULL){ ! p.baseline = GetToggleButtonState(baseline_item); ! } ! if(data== baselinetype_item || data==NULL){ ! p.baseline_type = GetChoice(baselinetype_item); ! } ! if(data==errbar_active_item || data==NULL){ ! p.errbar.active = GetToggleButtonState(errbar_active_item); ! } ! if(data==errbar_size_item || data==NULL){ ! p.errbar.barsize = GetCharSizeChoice(errbar_size_item); ! } ! if(data==errbar_width_item || data==NULL){ ! p.errbar.linew = GetSpinChoice(errbar_width_item); ! } ! if(data==errbar_lines_item || data==NULL){ ! p.errbar.lines = GetOptionChoice(errbar_lines_item); ! } ! if(data==errbar_riserlinew_item || data==NULL){ ! p.errbar.riser_linew = GetSpinChoice(errbar_riserlinew_item); ! } ! if(data==errbar_riserlines_item || data==NULL){ ! p.errbar.riser_lines = GetOptionChoice(errbar_riserlines_item); ! } ! if(data==errbar_ptype_item || data==NULL){ ! p.errbar.ptype = GetChoice(errbar_ptype_item); ! } ! if(data==errbar_color_item || data==NULL){ ! p.errbar.pen.color = GetOptionChoice(errbar_color_item); ! } ! if(data==errbar_pattern_item || data==NULL){ ! p.errbar.pen.pattern = GetOptionChoice(errbar_pattern_item); ! } ! if(data==errbar_aclip_item || data==NULL){ ! p.errbar.arrow_clip = GetToggleButtonState(errbar_aclip_item); ! } ! if(data==errbar_cliplen_item || data==NULL){ ! p.errbar.cliplen = GetSpinChoice(errbar_cliplen_item); ! } ! if(data==avalue_active_item || data==NULL){ ! p.avalue.active = GetToggleButtonState(avalue_active_item); ! } ! if(data==avalue_type_item || data==NULL){ ! p.avalue.type = GetChoice(avalue_type_item); ! } ! if(data==avalue_charsize_item || data==NULL){ ! p.avalue.size = GetCharSizeChoice(avalue_charsize_item); ! } ! if(data==avalue_font_item || data==NULL){ ! p.avalue.font = GetOptionChoice(avalue_font_item); ! } ! if(data==avalue_color_item || data==NULL){ ! p.avalue.color = GetOptionChoice(avalue_color_item); ! } ! if(data==avalue_angle_item || data==NULL){ ! p.avalue.angle = GetAngleChoice(avalue_angle_item); ! } ! if(data==avalue_format_item || data==NULL){ ! p.avalue.format = GetOptionChoice(avalue_format_item); ! } ! if(data==avalue_precision_item || data==NULL){ ! p.avalue.prec = GetChoice(avalue_precision_item); ! } ! if(data==avalue_prestr || data==NULL){ ! strcpy(p.avalue.prestr, xv_getstr(avalue_prestr)); ! } ! if(data==avalue_appstr || data==NULL){ ! strcpy(p.avalue.appstr, xv_getstr(avalue_appstr)); ! } ! if(data==avalue_offsetx || data==NULL){ ! xv_evalexpr(avalue_offsetx, &p.avalue.offset.x ); ! } ! if(data==avalue_offsety || data==NULL){ ! xv_evalexpr(avalue_offsety, &p.avalue.offset.y); ! } ! set_graph_plotarr(get_cg(), setno, &p); } xfree(selset); } *************** *** 601,610 **** case SET_XYDXDX: case SET_XYDYDY: case SET_XYDXDXDYDY: ! SetSensitive(errbar_ptype_item[4], False); break; default: ! SetSensitive(errbar_ptype_item[4], True); break; } SetChoice(errbar_ptype_item, p.errbar.ptype); --- 828,837 ---- case SET_XYDXDX: case SET_XYDYDY: case SET_XYDXDXDYDY: ! SetSensitive(errbar_ptype_item->options[2].widget, False); break; default: ! SetSensitive(errbar_ptype_item->options[2].widget, True); break; } SetChoice(errbar_ptype_item, p.errbar.ptype); *************** *** 680,686 **** return; } else { for(i = 0; i < cd; i++) { ! setno = selset[i]; switch (proc_type) { case SETAPP_STRIP_LEGENDS: set_legend_string(cg, setno, --- 907,915 ---- return; } else { for(i = 0; i < cd; i++) { ! if( get_graph_plotarr( cg, selset[i], &p ) == RETURN_FAILURE ) ! return; ! setno = selset[i]; switch (proc_type) { case SETAPP_STRIP_LEGENDS: set_legend_string(cg, setno, *************** *** 744,746 **** --- 973,976 ---- mask++; } } + diff -C 3 -P --exclude-from=/home/ed/src/exclude-iu-file -r ./src/setwin.c ../grace-5.1.13iu/src/setwin.c *** ./src/setwin.c 2000-06-21 18:03:07.000000000 -0600 --- ../grace-5.1.13iu/src/setwin.c 2003-12-03 16:34:20.000000000 -0700 *************** *** 323,330 **** Widget top; ListStructure *sel; OptionStructure *optype_item; ! Widget *xy_item; ! Widget *up_down_item; Widget length_item; Widget start_item; Widget stop_item; --- 323,330 ---- Widget top; ListStructure *sel; OptionStructure *optype_item; ! OptionStructure *xy_item; ! OptionStructure *up_down_item; Widget length_item; Widget start_item; Widget stop_item; diff -C 3 -P --exclude-from=/home/ed/src/exclude-iu-file -r ./src/strwin.c ../grace-5.1.13iu/src/strwin.c *** ./src/strwin.c 2000-07-12 16:31:48.000000000 -0600 --- ../grace-5.1.13iu/src/strwin.c 2003-12-03 16:34:20.000000000 -0700 *************** *** 61,93 **** static OptionStructure *strings_font_item; static Widget strings_rot_item; static Widget strings_size_item; ! static Widget *strings_loc_item; static OptionStructure *strings_color_item; static OptionStructure *strings_just_item; ! static Widget *lines_arrow_item; static SpinStructure *lines_asize_item; ! static Widget *lines_atype_item; static SpinStructure *lines_a_dL_ff_item; static SpinStructure *lines_a_lL_ff_item; static OptionStructure *lines_color_item; static OptionStructure *lines_style_item; static SpinStructure *lines_width_item; ! static Widget *lines_loc_item; static OptionStructure *boxes_color_item; static OptionStructure *boxes_lines_item; static SpinStructure *boxes_linew_item; static OptionStructure *boxes_fillpat_item; static OptionStructure *boxes_fillcol_item; ! static Widget *boxes_loc_item; static OptionStructure *ellip_color_item; static OptionStructure *ellip_lines_item; static SpinStructure *ellip_linew_item; static OptionStructure *ellip_fillpat_item; static OptionStructure *ellip_fillcol_item; ! static Widget *ellip_loc_item; static void define_ellip_popup(void *data); static void define_strings_popup(void *data); --- 61,93 ---- static OptionStructure *strings_font_item; static Widget strings_rot_item; static Widget strings_size_item; ! static OptionStructure *strings_loc_item; static OptionStructure *strings_color_item; static OptionStructure *strings_just_item; ! static OptionStructure *lines_arrow_item; static SpinStructure *lines_asize_item; ! static OptionStructure *lines_atype_item; static SpinStructure *lines_a_dL_ff_item; static SpinStructure *lines_a_lL_ff_item; static OptionStructure *lines_color_item; static OptionStructure *lines_style_item; static SpinStructure *lines_width_item; ! static OptionStructure *lines_loc_item; static OptionStructure *boxes_color_item; static OptionStructure *boxes_lines_item; static SpinStructure *boxes_linew_item; static OptionStructure *boxes_fillpat_item; static OptionStructure *boxes_fillcol_item; ! static OptionStructure *boxes_loc_item; static OptionStructure *ellip_color_item; static OptionStructure *ellip_lines_item; static SpinStructure *ellip_linew_item; static OptionStructure *ellip_fillpat_item; static OptionStructure *ellip_fillcol_item; ! static OptionStructure *ellip_loc_item; static void define_ellip_popup(void *data); static void define_strings_popup(void *data); *************** *** 511,517 **** OptionStructure *lines_item; OptionStructure *fill_color_item; OptionStructure *fill_pattern_item; ! Widget *loc_item; Widget x1_item; Widget x2_item; Widget y1_item; --- 511,517 ---- OptionStructure *lines_item; OptionStructure *fill_color_item; OptionStructure *fill_pattern_item; ! OptionStructure *loc_item; Widget x1_item; Widget x2_item; Widget y1_item; *************** *** 563,568 **** --- 563,612 ---- } } + void ellipse_edit_proc( Widget w, XtPointer client_data, XtPointer call_data ) + { + EditBoxUI *ui = (EditBoxUI *) client_data; + int ellipno = ui->boxno; + double a, b, c, d; + + if (xv_evalexpr( ui->x1_item, &a ) != RETURN_SUCCESS || + xv_evalexpr( ui->x2_item, &b ) != RETURN_SUCCESS || + xv_evalexpr( ui->y1_item, &c ) != RETURN_SUCCESS || + xv_evalexpr( ui->y2_item, &d ) != RETURN_SUCCESS ) { + return; + } + ellip[ellipno].color = GetOptionChoice(ui->color_item); + ellip[ellipno].loctype = GetChoice(ui->loc_item) ? COORD_VIEW : COORD_WORLD; + ellip[ellipno].lines = GetOptionChoice(ui->lines_item); + ellip[ellipno].linew = GetSpinChoice(ui->linew_item); + ellip[ellipno].fillcolor = GetOptionChoice(ui->fill_color_item); + ellip[ellipno].fillpattern = GetOptionChoice(ui->fill_pattern_item); + ellip[ellipno].x1 = a - b/2.; + ellip[ellipno].x2 = a + b/2.; + ellip[ellipno].y1 = c - d/2.; + ellip[ellipno].y2 = c + d/2.; + + set_dirtystate(); + xdrawgraph(); + } + + + + void sb_ellipse_edit_cb( double s, void *data ) + { + ellipse_edit_proc( NULL, data, NULL ); + } + + void oc_ellipse_edit_cb( int c, void *data ) + { + ellipse_edit_proc( NULL, data, NULL ); + } + + void ti_ellipse_edit_cb( void *data ) + { + ellipse_edit_proc( NULL, data, NULL ); + } + void swap_ellipwv_coords(Widget w, XtPointer client_data, XtPointer call_data) { *************** *** 593,625 **** } - void ellipse_edit_proc(Widget w, XtPointer client_data, XtPointer call_data) - { - EditBoxUI *ui = (EditBoxUI *) client_data; - int ellipno = ui->boxno; - double a, b, c, d; - - if (xv_evalexpr( ui->x1_item, &a ) != RETURN_SUCCESS || - xv_evalexpr( ui->x2_item, &b ) != RETURN_SUCCESS || - xv_evalexpr( ui->y1_item, &c ) != RETURN_SUCCESS || - xv_evalexpr( ui->y2_item, &d ) != RETURN_SUCCESS ) { - return; - } - ellip[ellipno].color = GetOptionChoice(ui->color_item); - ellip[ellipno].loctype = GetChoice(ui->loc_item) ? COORD_VIEW : COORD_WORLD; - ellip[ellipno].lines = GetOptionChoice(ui->lines_item); - ellip[ellipno].linew = GetSpinChoice(ui->linew_item); - ellip[ellipno].fillcolor = GetOptionChoice(ui->fill_color_item); - ellip[ellipno].fillpattern = GetOptionChoice(ui->fill_pattern_item); - ellip[ellipno].x1 = a - b/2.; - ellip[ellipno].x2 = a + b/2.; - ellip[ellipno].y1 = c - d/2.; - ellip[ellipno].y2 = c + d/2.; - - set_dirtystate(); - xdrawgraph(); - } - void swap_boxwv_coords(Widget w, XtPointer client_data, XtPointer call_data) { --- 637,642 ---- *************** *** 668,673 **** --- 685,705 ---- xdrawgraph(); } + void oc_boxedit_cb( int c, void *data ) + { + box_edit_proc( NULL, data, NULL ); + } + + void sb_boxedit_cb( double c, void *data ) + { + box_edit_proc( NULL, data, NULL ); + } + + void ti_boxedit_cb( void *data ) + { + box_edit_proc( NULL, data, NULL ); + } + void box_edit_popup(int boxno) { Widget rc; *************** *** 684,716 **** handle_close(box_ui.top); panel = XmCreateRowColumn(box_ui.top, "boxes_rc", NULL, 0); ! rc = XtVaCreateWidget("rc", xmRowColumnWidgetClass, panel, NULL); box_ui.color_item = CreateColorChoice(rc, "Color: "); box_ui.linew_item = CreateLineWidthChoice(rc, "Line width:"); box_ui.lines_item = CreateLineStyleChoice(rc, "Line style:"); box_ui.fill_pattern_item = CreatePatternChoice(rc, "Fill pattern:"); box_ui.fill_color_item = CreateColorChoice(rc, "Fill color: "); box_ui.loc_item = CreatePanelChoice(rc, "Position in:", 3, "World coordinates", "Viewport coordinates", 0, 0); ! ! XtAddCallback(box_ui.loc_item[2], XmNactivateCallback, ! swap_boxwv_coords, (XtPointer) &box_ui); ! XtAddCallback(box_ui.loc_item[3], XmNactivateCallback, ! swap_boxwv_coords, (XtPointer) &box_ui); ! box_ui.x1_item = CreateTextItem2(rc, 12, "Xmin = "); box_ui.y1_item = CreateTextItem2(rc, 12, "Ymin = "); box_ui.x2_item = CreateTextItem2(rc, 12, "Xmax = "); box_ui.y2_item = CreateTextItem2(rc, 12, "Ymax = "); ManageChild(rc); CreateSeparator(panel); --- 716,753 ---- handle_close(box_ui.top); panel = XmCreateRowColumn(box_ui.top, "boxes_rc", NULL, 0); ! rc = XtVaCreateWidget("rc", xmRowColumnWidgetClass, panel, NULL); box_ui.color_item = CreateColorChoice(rc, "Color: "); + AddOptionChoiceCB(box_ui.color_item, (OC_CBProc)oc_boxedit_cb, &box_ui ); box_ui.linew_item = CreateLineWidthChoice(rc, "Line width:"); + AddSpinButtonCB(box_ui.linew_item, (Spin_CBProc)sb_boxedit_cb, &box_ui ); box_ui.lines_item = CreateLineStyleChoice(rc, "Line style:"); + AddOptionChoiceCB(box_ui.lines_item, (OC_CBProc)oc_boxedit_cb, &box_ui ); box_ui.fill_pattern_item = CreatePatternChoice(rc, "Fill pattern:"); + AddOptionChoiceCB(box_ui.fill_pattern_item, (OC_CBProc)oc_boxedit_cb, &box_ui ); box_ui.fill_color_item = CreateColorChoice(rc, "Fill color: "); + AddOptionChoiceCB(box_ui.fill_color_item,(OC_CBProc)oc_boxedit_cb,&box_ui); box_ui.loc_item = CreatePanelChoice(rc, "Position in:", 3, "World coordinates", "Viewport coordinates", 0, 0); ! AddOptionChoiceCB( box_ui.loc_item, (OC_CBProc)swap_boxwv_coords, ! (void *)&box_ui ); box_ui.x1_item = CreateTextItem2(rc, 12, "Xmin = "); box_ui.y1_item = CreateTextItem2(rc, 12, "Ymin = "); box_ui.x2_item = CreateTextItem2(rc, 12, "Xmax = "); box_ui.y2_item = CreateTextItem2(rc, 12, "Ymax = "); + AddTextItem2CB(box_ui.x1_item,ti_boxedit_cb,&box_ui); + AddTextItem2CB(box_ui.x2_item,ti_boxedit_cb,&box_ui); + AddTextItem2CB(box_ui.y1_item,ti_boxedit_cb,&box_ui); + AddTextItem2CB(box_ui.y2_item,ti_boxedit_cb,&box_ui); ManageChild(rc); CreateSeparator(panel); *************** *** 747,775 **** --- 784,825 ---- rc = XtVaCreateWidget("rc", xmRowColumnWidgetClass, panel, NULL); ellip_ui.color_item = CreateColorChoice(rc, "Color: "); + AddOptionChoiceCB( ellip_ui.color_item, oc_ellipse_edit_cb, &ellip_ui ); ellip_ui.linew_item = CreateLineWidthChoice(rc, "Line width:"); + AddSpinButtonCB( ellip_ui.linew_item, sb_ellipse_edit_cb, &ellip_ui ); ellip_ui.lines_item = CreateLineStyleChoice(rc, "Line style:"); + AddOptionChoiceCB( ellip_ui.lines_item, oc_ellipse_edit_cb, &ellip_ui ); ellip_ui.fill_pattern_item = CreatePatternChoice(rc, "Fill pattern:"); + AddOptionChoiceCB( ellip_ui.fill_pattern_item, oc_ellipse_edit_cb, &ellip_ui ); ellip_ui.fill_color_item = CreateColorChoice(rc, "Fill color: "); + AddOptionChoiceCB( ellip_ui.fill_color_item,oc_ellipse_edit_cb,&ellip_ui ); ellip_ui.loc_item = CreatePanelChoice(rc, "Position in:", 3, "World coordinates", "Viewport coordinates", 0, 0); + /* XtAddCallback(ellip_ui.loc_item[2], XmNactivateCallback, swap_ellipwv_coords, (XtPointer) &ellip_ui ); XtAddCallback(ellip_ui.loc_item[3], XmNactivateCallback, swap_ellipwv_coords, (XtPointer) &ellip_ui ); + */ + AddOptionChoiceCB( ellip_ui.loc_item, (OC_CBProc)swap_ellipwv_coords, + (void *)&ellip_ui ); ellip_ui.x1_item = CreateTextItem2(rc, 12, "Xcentre = "); ellip_ui.y1_item = CreateTextItem2(rc, 12, "Ycentre = "); ellip_ui.x2_item = CreateTextItem2(rc, 12, "Width = "); ellip_ui.y2_item = CreateTextItem2(rc, 12, "Height = "); + AddTextItem2CB( ellip_ui.x1_item, ti_ellipse_edit_cb, &ellip_ui ); + AddTextItem2CB( ellip_ui.x2_item, ti_ellipse_edit_cb, &ellip_ui ); + AddTextItem2CB( ellip_ui.y1_item, ti_ellipse_edit_cb, &ellip_ui ); + AddTextItem2CB( ellip_ui.y2_item, ti_ellipse_edit_cb, &ellip_ui ); ManageChild(rc); CreateSeparator(panel); *************** *** 793,801 **** OptionStructure *color_item; SpinStructure *linew_item; OptionStructure *lines_item; ! Widget *loc_item; ! Widget *arrow_item; ! Widget *atype_item; SpinStructure *asize_item; SpinStructure *dL_ff_item; SpinStructure *lL_ff_item; --- 843,851 ---- OptionStructure *color_item; SpinStructure *linew_item; OptionStructure *lines_item; ! OptionStructure *loc_item; ! OptionStructure *arrow_item; ! OptionStructure *atype_item; SpinStructure *asize_item; SpinStructure *dL_ff_item; SpinStructure *lL_ff_item; *************** *** 880,885 **** --- 930,950 ---- xdrawgraph(); } + void oc_line_edit_cb( int c, void *data ) + { + line_edit_proc( NULL, data, NULL ); + } + + void sb_line_edit_cb( double c, void *data ) + { + line_edit_proc( NULL, data, NULL ); + } + + void ti_line_edit_cb( void *data ) + { + line_edit_proc( NULL, data, NULL ); + } + static EditLineUI line_ui; void line_edit_popup(int lineno) *************** *** 897,909 **** handle_close(line_ui.top); panel = XmCreateRowColumn(line_ui.top, "lines_rc", NULL, 0); ! rc = XtVaCreateWidget("rc", xmRowColumnWidgetClass, panel, NULL); line_ui.color_item = CreateColorChoice(rc, "Color: "); line_ui.linew_item = CreateLineWidthChoice(rc, "Line width:"); line_ui.lines_item = CreateLineStyleChoice(rc, "Line style:"); fr = CreateFrame(rc, "Arrow"); rc2 = XtVaCreateWidget("rc2", xmRowColumnWidgetClass, fr, NULL); --- 962,977 ---- handle_close(line_ui.top); panel = XmCreateRowColumn(line_ui.top, "lines_rc", NULL, 0); ! rc = XtVaCreateWidget("rc", xmRowColumnWidgetClass, panel, NULL); line_ui.color_item = CreateColorChoice(rc, "Color: "); + AddOptionChoiceCB(line_ui.color_item, oc_line_edit_cb, &line_ui ); line_ui.linew_item = CreateLineWidthChoice(rc, "Line width:"); + AddSpinButtonCB(line_ui.linew_item, sb_line_edit_cb, &line_ui ); line_ui.lines_item = CreateLineStyleChoice(rc, "Line style:"); + AddOptionChoiceCB(line_ui.lines_item, oc_line_edit_cb, &line_ui ); fr = CreateFrame(rc, "Arrow"); rc2 = XtVaCreateWidget("rc2", xmRowColumnWidgetClass, fr, NULL); *************** *** 915,920 **** --- 983,989 ---- "Both ends", 0, 0); + AddOptionChoiceCB(line_ui.arrow_item, oc_line_edit_cb, &line_ui ); line_ui.atype_item = CreatePanelChoice(rc2, "Type:", 4, *************** *** 923,935 **** --- 992,1008 ---- "Opaque", 0, 0); + AddOptionChoiceCB(line_ui.atype_item, oc_line_edit_cb, &line_ui ); line_ui.asize_item = CreateSpinChoice(rc2, "Length", 4, SPIN_TYPE_FLOAT, -10.0, 10.0, 0.5); + AddSpinButtonCB(line_ui.asize_item, sb_line_edit_cb, &line_ui ); line_ui.dL_ff_item = CreateSpinChoice(rc2, "d/L form factor", 4, SPIN_TYPE_FLOAT, 0.0, 10.0, 0.1); + AddSpinButtonCB(line_ui.dL_ff_item, sb_line_edit_cb, &line_ui ); line_ui.lL_ff_item = CreateSpinChoice(rc2, "l/L form factor", 4, SPIN_TYPE_FLOAT, -1.0, 1.0, 0.1); + AddSpinButtonCB(line_ui.lL_ff_item, sb_line_edit_cb, &line_ui ); ManageChild(rc2); line_ui.loc_item = CreatePanelChoice(rc, "Position in:", *************** *** 938,953 **** "Viewport coordinates", 0, 0); ! XtAddCallback(line_ui.loc_item[2], XmNactivateCallback, ! swap_linewv_coords, (XtPointer) &line_ui); ! XtAddCallback(line_ui.loc_item[3], XmNactivateCallback, ! swap_linewv_coords, (XtPointer) &line_ui); ! line_ui.x1_item = CreateTextItem2(rc, 12, "X1 = "); line_ui.y1_item = CreateTextItem2(rc, 12, "Y1 = "); line_ui.x2_item = CreateTextItem2(rc, 12, "X2 = "); line_ui.y2_item = CreateTextItem2(rc, 12, "Y2 = "); ManageChild(rc); CreateSeparator(panel); --- 1011,1027 ---- "Viewport coordinates", 0, 0); ! AddOptionChoiceCB( line_ui.loc_item, (OC_CBProc)swap_linewv_coords, ! (void *)&line_ui); line_ui.x1_item = CreateTextItem2(rc, 12, "X1 = "); line_ui.y1_item = CreateTextItem2(rc, 12, "Y1 = "); line_ui.x2_item = CreateTextItem2(rc, 12, "X2 = "); line_ui.y2_item = CreateTextItem2(rc, 12, "Y2 = "); + AddTextItem2CB(line_ui.x1_item, ti_line_edit_cb, &line_ui ); + AddTextItem2CB(line_ui.x2_item, ti_line_edit_cb, &line_ui ); + AddTextItem2CB(line_ui.y1_item, ti_line_edit_cb, &line_ui ); + AddTextItem2CB(line_ui.y2_item, ti_line_edit_cb, &line_ui ); ManageChild(rc); CreateSeparator(panel); *************** *** 970,976 **** Widget top; TextStructure *string_item; OptionStructure *color_item; ! Widget *loc_item; OptionStructure *font_item; Widget size_item; Widget rot_item; --- 1044,1050 ---- Widget top; TextStructure *string_item; OptionStructure *color_item; ! OptionStructure *loc_item; OptionStructure *font_item; Widget size_item; Widget rot_item; *************** *** 1041,1046 **** --- 1115,1135 ---- xdrawgraph(); } + void oc_string_edit_cb( int c, void *data ) + { + string_edit_proc( NULL, data, NULL ); + } + + void sb_string_edit_cb( double c, void *data ) + { + string_edit_proc( NULL, data, NULL ); + } + + void ti_string_edit_cb( void *data ) + { + string_edit_proc( NULL, data, NULL ); + } + static EditStringUI string_ui; void string_edit_popup(int stringno) *************** *** 1059,1093 **** panel = XmCreateRowColumn(string_ui.top, "strings_rc", NULL, 0); string_ui.string_item = CreateCSText(panel, "String:"); ! rc = XtVaCreateWidget("rc", xmRowColumnWidgetClass, panel, NULL); string_ui.color_item = CreateColorChoice(rc, "Color: "); ! string_ui.font_item = CreateFontChoice(rc, "Font:"); ! string_ui.just_item = CreateJustChoice(rc, "Justification:"); ! string_ui.loc_item = CreatePanelChoice(rc, "Position in:", 3, "World coordinates", "Viewport coordinates", 0, 0); ! XtAddCallback(string_ui.loc_item[2], XmNactivateCallback, ! swap_stringwv_coords, (XtPointer) &string_ui); ! XtAddCallback(string_ui.loc_item[3], XmNactivateCallback, ! swap_stringwv_coords, (XtPointer) &string_ui); string_ui.x1_item = CreateTextItem2(rc, 12, "X = "); string_ui.y1_item = CreateTextItem2(rc, 12, "Y = "); ManageChild(rc); string_ui.rot_item = CreateAngleChoice(panel, "Rotation"); string_ui.size_item = CreateCharSizeChoice(panel, "Size"); CreateSeparator(panel); --- 1148,1187 ---- panel = XmCreateRowColumn(string_ui.top, "strings_rc", NULL, 0); string_ui.string_item = CreateCSText(panel, "String:"); + AddTextInputCB( string_ui.string_item, ti_string_edit_cb, &string_ui ); ! rc = XtVaCreateWidget("rc", xmRowColumnWidgetClass, panel, NULL); string_ui.color_item = CreateColorChoice(rc, "Color: "); ! AddOptionChoiceCB( string_ui.color_item, oc_string_edit_cb, &string_ui ); string_ui.font_item = CreateFontChoice(rc, "Font:"); + AddOptionChoiceCB( string_ui.font_item, oc_string_edit_cb, &string_ui ); ! string_ui.just_item = CreateJustChoice(rc, "Justification:"); ! AddOptionChoiceCB( string_ui.just_item, oc_string_edit_cb, &string_ui ); ! string_ui.loc_item = CreatePanelChoice(rc, "Position in:", 3, "World coordinates", "Viewport coordinates", 0, 0); ! AddOptionChoiceCB( string_ui.loc_item, (OC_CBProc)swap_stringwv_coords, ! (void *)&string_ui ); string_ui.x1_item = CreateTextItem2(rc, 12, "X = "); + AddTextItem2CB( string_ui.x1_item, ti_string_edit_cb, &string_ui ); string_ui.y1_item = CreateTextItem2(rc, 12, "Y = "); + AddTextItem2CB( string_ui.y1_item, ti_string_edit_cb, &string_ui ); ManageChild(rc); string_ui.rot_item = CreateAngleChoice(panel, "Rotation"); + AddScaleCB( string_ui.rot_item, oc_string_edit_cb, &string_ui ); string_ui.size_item = CreateCharSizeChoice(panel, "Size"); + AddScaleCB( string_ui.size_item, oc_string_edit_cb, &string_ui ); CreateSeparator(panel); diff -C 3 -P --exclude-from=/home/ed/src/exclude-iu-file -r ./src/tickwin.c ../grace-5.1.13iu/src/tickwin.c *** ./src/tickwin.c 2003-04-23 03:08:56.000000000 -0600 --- ../grace-5.1.13iu/src/tickwin.c 2003-12-03 16:41:41.000000000 -0700 *************** *** 48,55 **** #include "graphutils.h" #include "motifinc.h" - #define cg get_cg() - static int curaxis; static Widget axes_dialog = NULL; --- 48,53 ---- *************** *** 61,105 **** static Widget axis_zero; /* "zero" or "plain" */ static OptionStructure *axis_scale; /* axis scale */ static Widget axis_invert; /* invert axis */ ! static Widget *axis_applyto; /* override */ static Widget offx; /* x offset of axis in viewport coords */ static Widget offy; /* y offset of axis in viewport coords */ static Widget tonoff; /* toggle display of axis ticks */ static Widget tlonoff; /* toggle display of tick labels */ static TextStructure *axislabel; /* axis label */ ! static Widget *axislabellayout; /* axis label layout (perp or parallel) */ static OptionStructure *axislabelplace; /* axis label placement, auto or specified */ static Widget axislabelspec_rc; static Widget axislabelspec_para; /* location of axis label if specified (viewport coords) */ static Widget axislabelspec_perp; /* location of axis label if specified (viewport coords) */ static OptionStructure *axislabelfont; /* axis label font */ static Widget axislabelcharsize;/* axis label charsize */ static OptionStructure *axislabelcolor; /* axis label color */ ! static Widget *axislabelop; /* tick labels normal|opposite|both sides */ static Widget tmajor; /* major tick spacing */ static SpinStructure *nminor; /* # of minor ticks */ ! static Widget *tickop; /* ticks normal|opposite|both sides */ ! static Widget *ticklop; /* tick labels normal|opposite|both sides */ static OptionStructure *tlform; /* format for labels */ ! static Widget *tlprec; /* precision for labels */ static OptionStructure *tlfont; /* tick label font */ static Widget tlcharsize; /* tick label charsize */ static OptionStructure *tlcolor; /* tick label color */ static Widget tlappstr; /* tick label append string */ static Widget tlprestr; /* tick label prepend string */ ! static Widget *tlskip; /* tick marks to skip */ ! static Widget *tlstarttype; /* use graph min or starting value */ static Widget tlstart; /* value to start tick labels */ ! static Widget *tlstoptype; /* use graph max or stop value */ static Widget tlstop; /* value to stop tick labels */ static OptionStructure *tlgaptype; /* tick label placement, auto or specified */ static Widget tlgap_rc; static Widget tlgap_para; /* location of tick label if specified (viewport coords) */ static Widget tlgap_perp; /* location of tick label if specified (viewport coords) */ static Widget tlangle; /* angle */ ! static Widget *tlstagger; /* stagger */ static TextStructure *tlformula; /* transformation if tick labels */ ! static Widget *autonum; /* number of autotick divisions */ static Widget tround; /* place at rounded positions */ static Widget tgrid; /* major ticks grid */ static OptionStructure *tgridcol; --- 59,104 ---- static Widget axis_zero; /* "zero" or "plain" */ static OptionStructure *axis_scale; /* axis scale */ static Widget axis_invert; /* invert axis */ ! static OptionStructure *axis_applyto; /* override */ static Widget offx; /* x offset of axis in viewport coords */ static Widget offy; /* y offset of axis in viewport coords */ static Widget tonoff; /* toggle display of axis ticks */ static Widget tlonoff; /* toggle display of tick labels */ static TextStructure *axislabel; /* axis label */ ! static OptionStructure *axislabellayout; /* axis label layout (perp or parallel) */ static OptionStructure *axislabelplace; /* axis label placement, auto or specified */ static Widget axislabelspec_rc; + static Widget axislabelspec_para; /* location of axis label if specified (viewport coords) */ static Widget axislabelspec_perp; /* location of axis label if specified (viewport coords) */ static OptionStructure *axislabelfont; /* axis label font */ static Widget axislabelcharsize;/* axis label charsize */ static OptionStructure *axislabelcolor; /* axis label color */ ! static OptionStructure *axislabelop; /* tick labels normal|opposite|both sides */ static Widget tmajor; /* major tick spacing */ static SpinStructure *nminor; /* # of minor ticks */ ! static OptionStructure *tickop; /* ticks normal|opposite|both sides */ ! static OptionStructure *ticklop; /* tick labels normal|opposite|both sides */ static OptionStructure *tlform; /* format for labels */ ! static OptionStructure *tlprec; /* precision for labels */ static OptionStructure *tlfont; /* tick label font */ static Widget tlcharsize; /* tick label charsize */ static OptionStructure *tlcolor; /* tick label color */ static Widget tlappstr; /* tick label append string */ static Widget tlprestr; /* tick label prepend string */ ! static OptionStructure *tlskip; /* tick marks to skip */ ! static OptionStructure *tlstarttype; /* use graph min or starting value */ static Widget tlstart; /* value to start tick labels */ ! static OptionStructure *tlstoptype; /* use graph max or stop value */ static Widget tlstop; /* value to stop tick labels */ static OptionStructure *tlgaptype; /* tick label placement, auto or specified */ static Widget tlgap_rc; static Widget tlgap_para; /* location of tick label if specified (viewport coords) */ static Widget tlgap_perp; /* location of tick label if specified (viewport coords) */ static Widget tlangle; /* angle */ ! static OptionStructure *tlstagger; /* stagger */ static TextStructure *tlformula; /* transformation if tick labels */ ! static OptionStructure *autonum; /* number of autotick divisions */ static Widget tround; /* place at rounded positions */ static Widget tgrid; /* major ticks grid */ static OptionStructure *tgridcol; *************** *** 111,117 **** static OptionStructure *tmgridlines; static Widget tlen; /* tick length */ static Widget tmlen; ! static Widget *tinout; /* ticks in out or both */ static Widget baronoff; /* axis bar */ static OptionStructure *barcolor; static SpinStructure *barlinew; --- 110,116 ---- static OptionStructure *tmgridlines; static Widget tlen; /* tick length */ static Widget tmlen; ! static OptionStructure *tinout; /* ticks in out or both */ static Widget baronoff; /* axis bar */ static OptionStructure *barcolor; static SpinStructure *barlinew; *************** *** 130,140 **** --- 129,159 ---- static void axis_scale_cb(int value, void *data); static void auto_spec_cb(int value, void *data); + static Widget instantupdate_item; + static int instantupdate=0; + void create_axes_dialog_cb(void *data) { create_axes_dialog(-1); } + + void oc_axes_cb( int c, void *data ) + { + axes_aac_cb( data ); + } + + + void sp_axes_cb( double c, void *data ) + { + axes_aac_cb( data ); + } + + void axeswin_iu( int a, void *data ) + { + instantupdate=a; + } + /* * Create the ticks popup */ *************** *** 150,156 **** int i; char buf[32]; OptionItem opitems[MAXAXES]; ! Widget rc_head, rc, rc2, rc3, fr, sw, axes_main, axes_label, axes_ticklabel, axes_tickmark,axes_special; axes_dialog = CreateDialogForm(app_shell, "Axes"); --- 169,175 ---- int i; char buf[32]; OptionItem opitems[MAXAXES]; ! Widget rc_head, rc, rc2, rc3, rc4, fr, sw, axes_main, axes_label, axes_ticklabel, axes_tickmark,axes_special; axes_dialog = CreateDialogForm(app_shell, "Axes"); *************** *** 171,180 **** --- 190,205 ---- AddOptionChoiceCB(editaxis, set_axis_proc, NULL); axis_active = CreateToggleButton(rc, "Active"); AddToggleButtonCB(axis_active, set_active_proc, NULL); + AddToggleButtonCB(axis_active, (TB_CBProc)oc_axes_cb, + (void *)axis_active); rc = CreateHContainer(rc_head); axis_world_start = CreateTextItem2(rc, 10, "Start:"); + AddTextItem2CB( axis_world_start, (Button_CBProc)axes_aac_cb, + (void *)axis_world_start); axis_world_stop = CreateTextItem2(rc, 10, "Stop:"); + AddTextItem2CB( axis_world_stop, (Button_CBProc)axes_aac_cb, + (void *)axis_world_stop); rc = CreateHContainer(rc_head); *************** *** 187,195 **** opitems[3].value = SCALE_LOGIT; opitems[3].label = "Logit"; axis_scale = CreateOptionChoice(rc, "Scale:", 0, 4, opitems); ! AddOptionChoiceCB(axis_scale, axis_scale_cb, NULL); axis_invert = CreateToggleButton(rc, "Invert axis"); /* ------------ Tabs --------------*/ --- 212,224 ---- opitems[3].value = SCALE_LOGIT; opitems[3].label = "Logit"; axis_scale = CreateOptionChoice(rc, "Scale:", 0, 4, opitems); ! AddOptionChoiceCB(axis_scale, axis_scale_cb, NULL ); ! AddOptionChoiceCB(axis_scale, (OC_CBProc)oc_axes_cb, ! (void *)axis_scale); axis_invert = CreateToggleButton(rc, "Invert axis"); + AddToggleButtonCB( axis_invert, (TB_CBProc)oc_axes_cb, + (void *)axis_invert); /* ------------ Tabs --------------*/ *************** *** 203,216 **** --- 232,249 ---- fr = CreateFrame(axes_main, "Axis label"); axislabel = CreateCSText(fr, "Label string:"); + AddTextInputCB( axislabel, (Text_CBProc)axes_aac_cb, + (void *)axislabel); fr = CreateFrame(axes_main, "Tick properties"); rc = CreateVContainer(fr); rc2 = CreateHContainer(rc); tmajor = CreateTextItem2(rc2, 8, "Major spacing:"); + AddTextItem2CB( tmajor, (Button_CBProc)axes_aac_cb, (void *)tmajor); nminor = CreateSpinChoice(rc2, "Minor ticks:", 2, SPIN_TYPE_INT, 0.0, (double) MAX_TICKS - 1, 1.0); + AddSpinButtonCB( nminor, (Spin_CBProc)sp_axes_cb, (void *)nminor ); rc2 = CreateHContainer(rc); tlform = CreateFormatChoice(rc2, "Format:"); *************** *** 221,227 **** --- 254,262 ---- rc2 = CreateVContainer(rc); tlonoff = CreateToggleButton(rc2, "Display tick labels"); + AddToggleButtonCB( tlonoff, (TB_CBProc)oc_axes_cb, (void *)tlonoff); tonoff = CreateToggleButton(rc2, "Display tick marks"); + AddToggleButtonCB( tonoff, (TB_CBProc)oc_axes_cb, (void *)tonoff); rc2 = CreateVContainer(rc); baronoff = CreateToggleButton(rc2, "Display axis bar"); *************** *** 230,242 **** --- 265,281 ---- rc = CreateHContainer(fr); axis_zero = CreateToggleButton(rc, "Zero axis"); offx = CreateTextItem2(rc, 6, "Offsets - Normal:"); + AddTextItem2CB( offx, (Button_CBProc)axes_aac_cb, (void *)offx); offy = CreateTextItem2(rc, 6, "Opposite:"); + AddTextItem2CB( offy, (Button_CBProc)axes_aac_cb, (void *)offy); fr = CreateFrame(axes_main, "Tick label properties"); rc = CreateHContainer(fr); tlfont = CreateFontChoice(rc, "Font:"); + AddOptionChoiceCB(tlfont, (OC_CBProc)oc_axes_cb, (void *)tlfont); tlcolor = CreateColorChoice(rc, "Color:"); + AddOptionChoiceCB(tlcolor, (OC_CBProc)oc_axes_cb, (void *)tlcolor); axes_label = CreateTabPage(axes_tab, "Axis label & bar"); *************** *** 246,256 **** --- 285,301 ---- rc2 = CreateHContainer(rc); axislabelfont = CreateFontChoice(rc2, "Font:"); + AddOptionChoiceCB(axislabelfont, (OC_CBProc)oc_axes_cb, + (void *)axislabelfont); axislabelcolor = CreateColorChoice(rc2, "Color:"); + AddOptionChoiceCB(axislabelcolor, (OC_CBProc)oc_axes_cb, + (void *)axislabelcolor); rc2 = CreateHContainer(rc); axislabelcharsize = CreateCharSizeChoice(rc2, "Char size"); SetScaleWidth(axislabelcharsize, 160); + AddScaleCB( axislabelcharsize, (OC_CBProc)oc_axes_cb, + (void *)axislabelcharsize); axislabellayout = CreatePanelChoice(rc2, "Layout:", 3, *************** *** 258,263 **** --- 303,310 ---- "Perpendicular to axis", NULL, NULL); + AddOptionChoiceCB(axislabellayout, (OC_CBProc)oc_axes_cb, + (void *)axislabellayout); rc2 = CreateHContainer(rc); axislabelop = CreatePanelChoice(rc2, "Side:", *************** *** 266,290 **** "Opposite", "Both", 0, 0); opitems[0].value = TYPE_AUTO; opitems[0].label = "Auto"; opitems[1].value = TYPE_SPEC; opitems[1].label = "Specified"; axislabelplace = CreateOptionChoice(rc2, "Location:", 0, 2, opitems); axislabelspec_rc = CreateHContainer(rc); ! axislabelspec_para = CreateTextItem2(axislabelspec_rc, 7, "Parallel offset:"); ! axislabelspec_perp = CreateTextItem2(axislabelspec_rc, 7, "Perpendicular offset:"); AddOptionChoiceCB(axislabelplace, auto_spec_cb, axislabelspec_rc); ! fr = CreateFrame(axes_label, "Bar properties"); rc = CreateVContainer(fr); rc2 = CreateHContainer(rc); barcolor = CreateColorChoice(rc2, "Color:"); barlinew = CreateLineWidthChoice(rc2, "Width:"); barlines = CreateLineStyleChoice(rc, "Line style:"); axes_ticklabel = CreateTabPage(axes_tab, "Tick labels"); --- 313,346 ---- "Opposite", "Both", 0, 0); + AddOptionChoiceCB(axislabelop, (OC_CBProc)oc_axes_cb, + (void *)axislabelop); opitems[0].value = TYPE_AUTO; opitems[0].label = "Auto"; opitems[1].value = TYPE_SPEC; opitems[1].label = "Specified"; axislabelplace = CreateOptionChoice(rc2, "Location:", 0, 2, opitems); axislabelspec_rc = CreateHContainer(rc); ! axislabelspec_para = CreateTextItem2(axislabelspec_rc, 5, "Parallel offset:"); ! AddTextItem2CB( axislabelspec_para, (Button_CBProc)axes_aac_cb, (void *)axislabelspec_para); ! axislabelspec_perp = CreateTextItem2(axislabelspec_rc, 5, "Perpendicular offset:"); ! AddTextItem2CB( axislabelspec_perp, (Button_CBProc)axes_aac_cb, (void *)axislabelspec_perp); AddOptionChoiceCB(axislabelplace, auto_spec_cb, axislabelspec_rc); ! AddOptionChoiceCB(axislabelplace, (OC_CBProc)oc_axes_cb, ! (void *)axislabelplace); fr = CreateFrame(axes_label, "Bar properties"); rc = CreateVContainer(fr); rc2 = CreateHContainer(rc); barcolor = CreateColorChoice(rc2, "Color:"); + AddOptionChoiceCB(barcolor, (OC_CBProc)oc_axes_cb, + (void *)barcolor); barlinew = CreateLineWidthChoice(rc2, "Width:"); + AddSpinButtonCB( barlinew, (Spin_CBProc)sp_axes_cb, (void *)barlinew); barlines = CreateLineStyleChoice(rc, "Line style:"); + AddOptionChoiceCB(barlines, (OC_CBProc)oc_axes_cb, (void *)barlines); axes_ticklabel = CreateTabPage(axes_tab, "Tick labels"); *************** *** 293,300 **** --- 349,358 ---- rc2 = CreateHContainer(fr); tlcharsize = CreateCharSizeChoice(rc2, "Char size"); SetScaleWidth(tlcharsize, 200); + AddScaleCB( tlcharsize, (OC_CBProc)oc_axes_cb, (void *)tlcharsize); tlangle = CreateAngleChoice(rc2, "Angle"); SetScaleWidth(tlangle, 180); + AddScaleCB( tlangle, (OC_CBProc)oc_axes_cb, (void *)tlangle); fr = CreateFrame(axes_ticklabel, "Placement"); rc = CreateHContainer(fr); *************** *** 306,315 **** --- 364,375 ---- "Opposite", "Both", 0, 0); + AddOptionChoiceCB( ticklop, (OC_CBProc)oc_axes_cb, (void *)ticklop); tlstagger = CreatePanelChoice(rc2, "Stagger:", 11, "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", 0, 0); + AddOptionChoiceCB( tlstagger, (OC_CBProc)oc_axes_cb, (void *)tlstagger); rc2 = CreateVContainer(rc); *************** *** 318,331 **** --- 378,397 ---- 3, "Axis min", "Specified:", 0, 0); + AddOptionChoiceCB( tlstarttype, (OC_CBProc)oc_axes_cb, + (void *)tlstarttype); tlstart = CreateTextItem2(rc3, 8, ""); + AddTextItem2CB( tlstart, (Button_CBProc)axes_aac_cb, (void *)tlstart); rc3 = CreateHContainer(rc2); tlstoptype = CreatePanelChoice(rc3, "Stop at:", 3, "Axis max", "Specified:", 0, 0); + AddOptionChoiceCB( tlstoptype, (OC_CBProc)oc_axes_cb, + (void *)tlstoptype); tlstop = CreateTextItem2(rc3, 8, ""); + AddTextItem2CB( tlstop, (Button_CBProc)axes_aac_cb, (void *)tlstop); fr = CreateFrame(axes_ticklabel, "Extra"); rc = CreateVContainer(fr); *************** *** 335,346 **** --- 401,418 ---- 11, "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", 0, 0); + AddOptionChoiceCB( tlskip, (OC_CBProc)oc_axes_cb, (void *)tlskip); tlformula = CreateTextInput(rc2, "Axis transform:"); + AddTextInputCB( tlformula, (Text_CBProc)axes_aac_cb, + (void *)tlformula); rc2 = CreateHContainer(rc); tlprestr = CreateTextItem2(rc2, 13, "Prepend:"); + AddTextItem2CB( tlprestr, (Button_CBProc)axes_aac_cb, + (void *)tlprestr); tlappstr = CreateTextItem2(rc2, 13, "Append:"); + AddTextItem2CB( tlappstr, (Button_CBProc)axes_aac_cb, (void *)tlappstr); opitems[0].value = TYPE_AUTO; opitems[0].label = "Auto"; *************** *** 348,356 **** opitems[1].label = "Specified"; tlgaptype = CreateOptionChoice(rc, "Location:", 0, 2, opitems); tlgap_rc = CreateHContainer(rc); - tlgap_para = CreateTextItem2(tlgap_rc, 7, "Parallel offset:"); - tlgap_perp = CreateTextItem2(tlgap_rc, 7, "Perpendicular offset:"); AddOptionChoiceCB(tlgaptype, auto_spec_cb, tlgap_rc); axes_tickmark = CreateTabPage(axes_tab, "Tick marks"); --- 420,434 ---- opitems[1].label = "Specified"; tlgaptype = CreateOptionChoice(rc, "Location:", 0, 2, opitems); tlgap_rc = CreateHContainer(rc); AddOptionChoiceCB(tlgaptype, auto_spec_cb, tlgap_rc); + AddOptionChoiceCB( tlgaptype, (OC_CBProc)oc_axes_cb, + (void *)tlgaptype); + tlgap_para = CreateTextItem2(tlgap_rc, 5, "Parallel offset:"); + AddTextItem2CB( tlgap_para, (Button_CBProc)axes_aac_cb, + (void *)tlgap_para); + tlgap_perp = CreateTextItem2(tlgap_rc, 5, "Perpendicular offset:"); + AddTextItem2CB( tlgap_perp, (Button_CBProc)axes_aac_cb, + (void *)tlgap_perp); axes_tickmark = CreateTabPage(axes_tab, "Tick marks"); *************** *** 362,375 **** --- 440,456 ---- 4, "In", "Out", "Both", 0, 0); + AddOptionChoiceCB( tinout, (OC_CBProc)oc_axes_cb, (void *)tinout); tickop = CreatePanelChoice(rc, "Draw on:", 4, "Normal side", "Opposite side", "Both sides", 0, 0); + AddOptionChoiceCB( tickop, (OC_CBProc)oc_axes_cb, (void *)tickop); rc = CreateHContainer(rc2); tround = CreateToggleButton(rc, "Place at rounded positions"); + AddToggleButtonCB( tround, (TB_CBProc)oc_axes_cb, (void *)tround); autonum = CreatePanelChoice(rc, "Autotick divisions", 12, "2", *************** *** 385,390 **** --- 466,472 ---- "12", NULL, NULL); + AddOptionChoiceCB( autonum, (OC_CBProc)oc_axes_cb, (void *)autonum); rc2 = CreateHContainer(axes_tickmark); *************** *** 392,409 **** --- 474,506 ---- fr = CreateFrame(rc2, "Major ticks"); rc = CreateVContainer(fr); tgrid = CreateToggleButton(rc, "Draw grid lines"); + AddToggleButtonCB( tgrid, (TB_CBProc)oc_axes_cb, (void *)tgrid); tlen = CreateCharSizeChoice(rc, "Tick length"); + AddScaleCB( tlen, (OC_CBProc)oc_axes_cb, (void *)tlen ); tgridcol = CreateColorChoice(rc, "Color:"); + AddOptionChoiceCB( tgridcol, (OC_CBProc)oc_axes_cb, (void *)tgridcol); tgridlinew = CreateLineWidthChoice(rc, "Line width:"); + AddSpinButtonCB( tgridlinew, (Spin_CBProc)sp_axes_cb, + (void *)tgridlinew); tgridlines = CreateLineStyleChoice(rc, "Line style:"); + AddOptionChoiceCB( tgridlines, (OC_CBProc)oc_axes_cb, + (void *)tgridlines); fr = CreateFrame(rc2, "Minor ticks"); rc = CreateVContainer(fr); tmgrid = CreateToggleButton(rc, "Draw grid lines"); + AddToggleButtonCB( tmgrid, (TB_CBProc)oc_axes_cb, (void *)tmgrid); tmlen = CreateCharSizeChoice(rc, "Tick length"); + AddScaleCB( tmlen, (OC_CBProc)oc_axes_cb, (void *)tmlen); tmgridcol = CreateColorChoice(rc, "Color:"); + AddOptionChoiceCB( tmgridcol, (OC_CBProc)oc_axes_cb, + (void *)tmgridcol); tmgridlinew = CreateLineWidthChoice(rc, "Line width:"); + AddSpinButtonCB( tmgridlinew, (Spin_CBProc)sp_axes_cb, + (void *)tmgridlinew); tmgridlines = CreateLineStyleChoice(rc, "Line style:"); + AddOptionChoiceCB( tmgridlines, (OC_CBProc)oc_axes_cb, + (void *)tmgridlines); axes_special = CreateTabPage(axes_tab, "Special"); *************** *** 415,423 **** --- 512,523 ---- opitems[2].value = TICKS_SPEC_BOTH; opitems[2].label = "Tick marks and labels"; specticks = CreateOptionChoice(axes_special, "Special ticks:", 0, 3, opitems); + AddOptionChoiceCB( specticks, (OC_CBProc)oc_axes_cb, + (void *)specticks); nspec = CreateSpinChoice(axes_special, "Number of user ticks to use:", 3, SPIN_TYPE_INT, 0.0, (double) MAX_TICKS, 1.0); + AddSpinButtonCB( nspec, (Spin_CBProc)sp_axes_cb, (void *)nspec); CreateLabel(axes_special, "Tick location - Label:"); sw = XtVaCreateManagedWidget("sw", *************** *** 431,437 **** --- 531,541 ---- rc3 = CreateHContainer(rc); sprintf(buf, "%2d", i); specloc[i] = CreateTextItem4(rc3, 12, buf); + AddTextItem2CB( specloc[i], (Button_CBProc)axes_aac_cb, + (void *)specloc ); speclabel[i] = CreateTextItem4(rc3, 30, ""); + AddTextItem2CB( speclabel[i], (Button_CBProc)axes_aac_cb, + (void *)specloc ); } *************** *** 439,445 **** rc = CreateVContainer(axes_dialog); ! axis_applyto = CreatePanelChoice(rc, "Apply to:", 5, "Current axis", --- 543,550 ---- rc = CreateVContainer(axes_dialog); ! rc4 = CreateHContainer(rc); ! axis_applyto = CreatePanelChoice(rc4, "Apply to:", 5, "Current axis", *************** *** 448,457 **** "All axes, all graphs", NULL, NULL); CreateAACDialog(axes_dialog, rc, axes_aac_cb, NULL); } ! update_ticks(cg); RaiseWindow(GetParent(axes_dialog)); unset_wait_cursor(); --- 553,565 ---- "All axes, all graphs", NULL, NULL); + instantupdate_item = CreateToggleButton(rc4, "instantly"); + AddToggleButtonCB(instantupdate_item, axeswin_iu, NULL); + SetToggleButtonState(instantupdate_item, instantupdate); CreateAACDialog(axes_dialog, rc, axes_aac_cb, NULL); } ! update_ticks(get_cg()); RaiseWindow(GetParent(axes_dialog)); unset_wait_cursor(); *************** *** 466,694 **** int applyto; int axis_start, axis_stop, graph_start, graph_stop; int scale, invert; ! tickmarks *t; ! double axestart, axestop; ! char *cp; ! world w; ! applyto = GetChoice(axis_applyto); ! ! t = new_graph_tickmarks(); ! if (!t) { ! return RETURN_FAILURE; ! } ! ! t->active = GetToggleButtonState(axis_active); ! ! t->zero = GetToggleButtonState(axis_zero); ! if (xv_evalexpr(tmajor, &t->tmajor) != RETURN_SUCCESS) { ! errmsg( "Specify major tick spacing" ); ! free_graph_tickmarks(t); ! return RETURN_FAILURE; ! } ! t->nminor = (int) GetSpinChoice(nminor); ! ! t->tl_flag = GetToggleButtonState(tlonoff); ! t->t_flag = GetToggleButtonState(tonoff); ! t->t_drawbar = GetToggleButtonState(baronoff); ! set_plotstr_string(&t->label, GetTextString(axislabel)); ! ! xv_evalexpr(offx, &t->offsx); ! xv_evalexpr(offy, &t->offsy); ! ! t->label_layout = GetChoice(axislabellayout) ? LAYOUT_PERPENDICULAR : LAYOUT_PARALLEL; ! t->label_place = GetOptionChoice(axislabelplace); ! if (t->label_place == TYPE_SPEC) { ! xv_evalexpr(axislabelspec_para, &t->label.x); ! xv_evalexpr(axislabelspec_perp, &t->label.y); ! } ! t->label.font = GetOptionChoice(axislabelfont); ! t->label.color = GetOptionChoice(axislabelcolor); ! t->label.charsize = GetCharSizeChoice(axislabelcharsize); /* somehow the value of axislabelop gets automagically correctly applied to all selected axes without checking for the value of applyto directly here (strange...) */ - t->label_op = GetChoice(axislabelop); - - t->tl_font = GetOptionChoice(tlfont); - t->tl_color = GetOptionChoice(tlcolor); - t->tl_skip = GetChoice(tlskip); - t->tl_prec = GetChoice(tlprec); - t->tl_staggered = (int) GetChoice(tlstagger); - strcpy(t->tl_appstr, xv_getstr(tlappstr)); - strcpy(t->tl_prestr, xv_getstr(tlprestr)); - t->tl_starttype = (int) GetChoice(tlstarttype) == 0 ? TYPE_AUTO : TYPE_SPEC; - if (t->tl_starttype == TYPE_SPEC) { - if(xv_evalexpr(tlstart, &t->tl_start) != RETURN_SUCCESS) { - errmsg( "Specify tick label start" ); - free_graph_tickmarks(t); - return RETURN_FAILURE; - } - } - t->tl_stoptype = (int) GetChoice(tlstoptype) == 0 ? TYPE_AUTO : TYPE_SPEC; - if (t->tl_stoptype == TYPE_SPEC) { - if(xv_evalexpr(tlstop, &t->tl_stop) != RETURN_SUCCESS){ - errmsg( "Specify tick label stop" ); - free_graph_tickmarks(t); - return RETURN_FAILURE; - } - } - t->tl_format = GetOptionChoice(tlform); - - t->tl_formula = copy_string(NULL, GetTextString(tlformula)); - - t->tl_gaptype = GetOptionChoice(tlgaptype); - if (t->tl_gaptype == TYPE_SPEC) { - xv_evalexpr(tlgap_para, &t->tl_gap.x); - xv_evalexpr(tlgap_perp, &t->tl_gap.y); - } - - t->tl_angle = GetAngleChoice(tlangle); - - t->tl_charsize = GetCharSizeChoice(tlcharsize); - - switch ((int) GetChoice(tinout)) { - case 0: - t->t_inout = TICKS_IN; - break; - case 1: - t->t_inout = TICKS_OUT; - break; - case 2: - t->t_inout = TICKS_BOTH; - break; - } - - t->props.color = GetOptionChoice(tgridcol); - t->props.linew = GetSpinChoice(tgridlinew); - t->props.lines = GetOptionChoice(tgridlines); - t->mprops.color = GetOptionChoice(tmgridcol); - t->mprops.linew = GetSpinChoice(tmgridlinew); - t->mprops.lines = GetOptionChoice(tmgridlines); - - t->props.size = GetCharSizeChoice(tlen); - t->mprops.size = GetCharSizeChoice(tmlen); - - t->t_autonum = GetChoice(autonum) + 2; - - t->t_round = GetToggleButtonState(tround); - - t->props.gridflag = GetToggleButtonState(tgrid); - t->mprops.gridflag = GetToggleButtonState(tmgrid); - - t->t_drawbarcolor = GetOptionChoice(barcolor); - t->t_drawbarlinew = GetSpinChoice(barlinew); - t->t_drawbarlines = GetOptionChoice(barlines); - - t->t_spec = GetOptionChoice(specticks); - /* only read special info if special ticks used */ - if (t->t_spec != TICKS_SPEC_NONE) { - t->nticks = (int) GetSpinChoice(nspec); - /* ensure that enough tick positions have been specified */ - for (i = 0; i < t->nticks; i++) { - if (xv_evalexpr(specloc[i], &t->tloc[i].wtpos) == RETURN_SUCCESS) { - cp = xv_getstr(speclabel[i]); - if (cp[0] == '\0') { - t->tloc[i].type = TICK_TYPE_MINOR; - } else { - t->tloc[i].type = TICK_TYPE_MAJOR; - } - if (t->t_spec == TICKS_SPEC_BOTH) { - t->tloc[i].label = copy_string(t->tloc[i].label, cp); - } else { - t->tloc[i].label = copy_string(t->tloc[i].label, NULL); - } - } else { - errmsg("Not enough tick locations specified"); - free_graph_tickmarks(t); - return RETURN_FAILURE; - } - } - } 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 = number_of_graphs() - 1; break; case 3: /* all axes, all graphs */ axis_start = 0; axis_stop = MAXAXES - 1; ! graph_start = 0; ! graph_stop = number_of_graphs() - 1; break; default: axis_start = curaxis; axis_stop = curaxis; ! graph_start = cg; ! graph_stop = cg; break; } - if (xv_evalexpr(axis_world_start, &axestart) != RETURN_SUCCESS || - xv_evalexpr(axis_world_stop, &axestop) != RETURN_SUCCESS) { - errmsg("Axis start/stop values undefined"); - free_graph_tickmarks(t); - return RETURN_FAILURE; - } ! for (i = graph_start; i <= graph_stop; i++) { for (j = axis_start; j <= axis_stop; j++) { ! get_graph_world(i, &w); ! if (is_xaxis(j)) { ! w.xg1 = axestart; ! w.xg2 = axestop; } else { ! w.yg1 = axestart; ! w.yg2 = axestop; } - set_graph_world(i, w); scale = GetOptionChoice(axis_scale); if (is_xaxis(j)) { ! set_graph_xscale(i, scale); } else { ! set_graph_yscale(i, scale); } invert = GetToggleButtonState(axis_invert); if (is_xaxis(j)) { ! set_graph_xinvert(i, invert); } else { ! set_graph_yinvert(i, invert); } ! t->tl_op = GetChoice(ticklop); ! ! t->t_op = GetChoice(tickop); ! ! set_graph_tickmarks(i, j, t); } } - free_graph_tickmarks(t); - xdrawgraph(); - update_ticks(cg); - return RETURN_SUCCESS; } --- 574,913 ---- int applyto; int axis_start, axis_stop, graph_start, graph_stop; int scale, invert; ! double axeslim; ! world wo; ! if(!instantupdate && data!=NULL) ! return RETURN_SUCCESS; ! applyto = GetChoice(axis_applyto); /* somehow the value of axislabelop gets automagically correctly applied to all selected axes without checking for the value of applyto directly here (strange...) */ switch (applyto) { case 0: /* current axis */ axis_start = curaxis; axis_stop = curaxis; ! graph_start = get_cg(); ! graph_stop = get_cg(); break; case 1: /* all axes, current graph */ axis_start = 0; axis_stop = MAXAXES - 1; ! graph_start = get_cg(); ! graph_stop = get_cg(); break; case 2: /* current axis, all graphs */ axis_start = curaxis; axis_stop = curaxis; ! graph_start = 0; ! graph_stop = number_of_graphs() - 1; break; case 3: /* all axes, all graphs */ axis_start = 0; axis_stop = MAXAXES - 1; ! graph_start = 0; ! graph_stop = number_of_graphs() - 1; break; default: axis_start = curaxis; axis_stop = curaxis; ! graph_start = get_cg(); ! graph_stop = get_cg(); break; } ! for (i=graph_start; i<=graph_stop; i++) { ! int gno = i; for (j = axis_start; j <= axis_stop; j++) { + tickmarks *ot; ! ot = copy_graph_tickmarks(get_graph_tickmarks( gno, j )); ! ! if (!ot) { ! return RETURN_FAILURE; ! } ! ! if( data==axis_active || data==NULL ){ ! ot->active = GetToggleButtonState( axis_active ); } else { ! if( !(ot->active) ) { ! free_graph_tickmarks(ot); ! continue; ! } ! } ! ! get_graph_world(gno, &wo); ! if(data == axis_world_start || data == NULL){ ! if (xv_evalexpr(axis_world_start, &axeslim) != RETURN_SUCCESS){ ! errmsg("Axis start/stop values undefined"); ! free_graph_tickmarks(ot); ! return RETURN_FAILURE; ! } else if( is_xaxis(j) ){ ! wo.xg1 = axeslim; ! } else if( is_yaxis(j) ){ ! wo.yg1 = axeslim; ! } ! } ! if(data == axis_world_stop || data == NULL){ ! if (xv_evalexpr(axis_world_stop, &axeslim) != RETURN_SUCCESS){ ! errmsg("Axis start/stop values undefined"); ! free_graph_tickmarks(ot); ! return RETURN_FAILURE; ! } else if( is_xaxis(j) ){ ! wo.xg2 = axeslim; ! } else if( is_yaxis(j) ){ ! wo.yg2 = axeslim; ! } ! } ! if(data==axis_world_start || data==axis_world_stop || data==NULL) { ! set_graph_world(gno, wo); } + if(data==axis_scale || data==NULL) { scale = GetOptionChoice(axis_scale); if (is_xaxis(j)) { ! set_graph_xscale(gno, scale); } else { ! set_graph_yscale(gno, scale); ! } } + if(data==&axis_invert || data==NULL) { invert = GetToggleButtonState(axis_invert); if (is_xaxis(j)) { ! set_graph_xinvert(gno, invert); } else { ! set_graph_yinvert(gno, invert); ! } } ! if(data==axislabel || data==NULL){ ! set_plotstr_string(&ot->label, GetTextString(axislabel)); ! } ! if(data==tmajor || data==NULL){ ! if (xv_evalexpr(tmajor, &ot->tmajor) != RETURN_SUCCESS) { ! errmsg( "Specify major tick spacing" ); ! free_graph_tickmarks(ot); ! return RETURN_FAILURE; ! } ! } ! if(data == nminor || data==NULL){ ! ot->nminor = (int) GetSpinChoice(nminor); ! } ! if(data == tlform || data==NULL){ ! ot->tl_format = GetOptionChoice(tlform); ! } ! if(data == tlprec || data==NULL){ ! ot->tl_prec = GetChoice(tlprec); ! } ! if(data == tlonoff || data==NULL){ ! ot->tl_flag = GetToggleButtonState(tlonoff); ! } ! if(data == baronoff || data==NULL){ ! ot->t_drawbar = GetToggleButtonState(baronoff); ! } ! if(data == tonoff || data==NULL){ ! ot->t_flag = GetToggleButtonState(tonoff); ! } ! if(data == axis_zero || data==NULL ){ ! ot->zero = GetToggleButtonState(axis_zero); ! } ! if(data == offx || data==NULL){ ! xv_evalexpr(offx, &ot->offsx); ! } ! if(data == &offy || data==NULL){ ! xv_evalexpr(offy, &ot->offsy); ! } ! if(data == tlfont || data==NULL){ ! ot->tl_font = GetOptionChoice(tlfont); ! } ! if(data == tlcolor || data==NULL){ ! ot->tl_color = GetOptionChoice(tlcolor); ! } ! if(data == axislabelfont || data==NULL ){ ! ot->label.font = GetOptionChoice(axislabelfont); ! } ! if(data == axislabelcolor || data==NULL){ ! ot->label.color = GetOptionChoice(axislabelcolor); ! } ! if(data == axislabelcharsize || data==NULL){ ! ot->label.charsize = GetCharSizeChoice(axislabelcharsize); ! } ! if(data == axislabellayout || data==NULL){ ! ot->label_layout = ! GetChoice(axislabellayout)?LAYOUT_PERPENDICULAR:LAYOUT_PARALLEL; ! } ! if(data == axislabelop || data==NULL){ ! ot->label_op = GetChoice(axislabelop); ! } ! if(data == axislabelplace || data==NULL){ ! ot->label_place = GetOptionChoice(axislabelplace); ! } ! if(data == axislabelspec_para || data==NULL){ ! xv_evalexpr(axislabelspec_para, &ot->label.x); ! } ! if(data == axislabelspec_perp || data==NULL){ ! xv_evalexpr(axislabelspec_perp, &ot->label.y); ! } ! if(data == barcolor || data==NULL){ ! ot->t_drawbarcolor = GetOptionChoice(barcolor); ! } ! if(data == barlinew || data==NULL){ ! ot->t_drawbarlinew = GetSpinChoice(barlinew); ! } ! if(data == barlines || data==NULL){ ! ot->t_drawbarlines = GetOptionChoice(barlines); ! } ! if(data == tlcharsize || data==NULL){ ! ot->tl_charsize = GetCharSizeChoice(tlcharsize); ! } ! if(data == tlangle || data==NULL){ ! ot->tl_angle = GetAngleChoice(tlangle); ! } ! if(data == ticklop || data==NULL){ ! ot->tl_op = GetChoice(ticklop); ! } ! if(data == tlstagger || data==NULL){ ! ot->tl_staggered = (int) GetChoice(tlstagger); ! } ! if(data == tlstarttype || data==NULL){ ! ot->tl_starttype = ! (int) GetChoice(tlstarttype) == 0 ? TYPE_AUTO : TYPE_SPEC; ! } ! if(data == tlstart || data==NULL){ ! if (ot->tl_starttype == TYPE_SPEC) { ! if(xv_evalexpr(tlstart, &ot->tl_start) != RETURN_SUCCESS) { ! errmsg( "Specify tick label start" ); ! free_graph_tickmarks(ot); ! return RETURN_FAILURE; ! } ! } ! } ! if(data == tlstoptype || data==NULL){ ! ot->tl_stoptype = ! (int) GetChoice(tlstoptype) == 0 ? TYPE_AUTO : TYPE_SPEC; ! } ! if(data == tlstop || data==NULL){ ! if (ot->tl_stoptype == TYPE_SPEC) { ! if(xv_evalexpr(tlstop, &ot->tl_stop) != RETURN_SUCCESS){ ! errmsg( "Specify tick label stop" ); ! free_graph_tickmarks(ot); ! return RETURN_FAILURE; ! } ! } ! } ! if(data==tlskip || data==NULL){ ! ot->tl_skip = GetChoice(tlskip); ! } ! if(data==tlformula || data==NULL){ ! SetTextString(tlformula, ot->tl_formula); ! } ! if(data==tlprestr || data==NULL){ ! strcpy( ot->tl_prestr, xv_getstr(tlprestr)); ! } ! if(data==tlappstr || data==NULL){ ! strcpy(ot->tl_appstr, xv_getstr(tlappstr)); ! } ! if(data==tlgaptype || data==NULL){ ! ot->tl_gaptype = GetOptionChoice(tlgaptype); ! } ! if(data==tlgap_para || data==NULL){ ! xv_evalexpr(tlgap_para, &ot->tl_gap.x); ! } ! if(data==tlgap_perp || data==NULL){ ! xv_evalexpr(tlgap_perp, &ot->tl_gap.y); ! } ! if(data==tinout || data==NULL){ ! switch ((int) GetChoice(tinout)) { ! case 0: ! ot->t_inout = TICKS_IN; ! break; ! case 1: ! ot->t_inout = TICKS_OUT; ! break; ! case 2: ! ot->t_inout = TICKS_BOTH; ! break; ! } ! } ! if(data == tickop || data==NULL ){ ! ot->t_op = GetChoice(tickop); ! } ! if(data == tround || data==NULL){ ! ot->t_round = GetToggleButtonState(tround); ! } ! if(data == autonum || data==NULL){ ! ot->t_autonum = GetChoice(autonum) + 2; ! } ! if(data == tgrid || data==NULL){ ! ot->props.gridflag = GetToggleButtonState(tgrid); ! } ! if(data == tlen || data==NULL){ ! ot->props.size = GetCharSizeChoice(tlen); ! } ! if(data == tgridcol || data==NULL){ ! ot->props.color = GetOptionChoice(tgridcol); ! } ! if(data == tgridlinew || data==NULL){ ! ot->props.linew = GetSpinChoice(tgridlinew); ! } ! if(data == tgridlines || data==NULL){ ! ot->props.lines = GetOptionChoice(tgridlines); ! } ! if(data == tmgrid || data==NULL){ ! ot->mprops.gridflag = GetToggleButtonState(tmgrid); ! } ! if(data == tmlen || data==NULL){ ! ot->mprops.size = GetCharSizeChoice(tmlen); ! } ! if(data == tmgridcol || data==NULL){ ! ot->mprops.color = GetOptionChoice(tmgridcol); ! } ! if(data == tmgridlinew || data==NULL){ ! ot->mprops.linew = GetSpinChoice(tmgridlinew); ! } ! if(data == tmgridlines || data==NULL){ ! ot->mprops.lines = GetOptionChoice(tmgridlines); ! } ! if(data == specticks ||data==nspec || ! data == specloc || data==NULL){ ! ot->t_spec = GetOptionChoice(specticks); ! /* only read special info if special ticks used */ ! if (ot->t_spec != TICKS_SPEC_NONE) { ! ot->nticks = (int) GetSpinChoice(nspec); ! /* ensure that enough tick positions have been specified */ ! for (i = 0; i < ot->nticks; i++) { ! if (xv_evalexpr(specloc[i], &ot->tloc[i].wtpos) == ! RETURN_SUCCESS) { ! char *cp; ! cp = xv_getstr(speclabel[i]); ! if (cp[0] == '\0') { ! ot->tloc[i].type = TICK_TYPE_MINOR; ! } else { ! ot->tloc[i].type = TICK_TYPE_MAJOR; ! } ! if (ot->t_spec == TICKS_SPEC_BOTH) { ! ot->tloc[i].label = ! copy_string(ot->tloc[i].label, cp ); ! } else { ! ot->tloc[i].label = ! copy_string(ot->tloc[i].label, NULL); ! } ! } ! } ! } ! } ! set_graph_tickmarks(gno, j, ot); ! free_graph_tickmarks(ot); } } xdrawgraph(); return RETURN_SUCCESS; } *************** *** 929,935 **** static void set_axis_proc(int value, void *data) { curaxis = value; ! update_ticks(cg); } static void auto_spec_cb(int value, void *data) --- 1148,1154 ---- static void set_axis_proc(int value, void *data) { curaxis = value; ! update_ticks(get_cg()); } static void auto_spec_cb(int value, void *data) *************** *** 937,939 **** --- 1156,1159 ---- Widget rc = (Widget) data; SetSensitive(rc, value); } + diff -C 3 -P --exclude-from=/home/ed/src/exclude-iu-file -r ./src/worldwin.c ../grace-5.1.13iu/src/worldwin.c *** ./src/worldwin.c 2002-03-13 15:25:12.000000000 -0700 --- ../grace-5.1.13iu/src/worldwin.c 2003-12-03 16:34:20.000000000 -0700 *************** *** 334,340 **** Widget top; SetChoiceItem sel; OptionStructure *on_item; ! Widget *applyto_item; } Auto_ui; static Auto_ui aui; --- 334,340 ---- Widget top; SetChoiceItem sel; OptionStructure *on_item; ! OptionStructure *applyto_item; } Auto_ui; static Auto_ui aui; diff -C 3 -P --exclude-from=/home/ed/src/exclude-iu-file -r ./src/xmgrace.c ../grace-5.1.13iu/src/xmgrace.c *** ./src/xmgrace.c 2003-08-17 15:37:14.000000000 -0600 --- ../grace-5.1.13iu/src/xmgrace.c 2003-12-03 16:34:20.000000000 -0700 *************** *** 181,186 **** --- 181,187 ---- Boolean toolbar; Boolean statusbar; Boolean locatorbar; + Boolean instantupdate; } ApplicationData, *ApplicationDataPtr; *************** *** 203,209 **** (XtPointer) TRUE}, {"locatorBar", "LocatorBar", XtRBoolean, sizeof(Boolean), XtOffset(ApplicationDataPtr, locatorbar), XtRImmediate, ! (XtPointer) TRUE} }; String fallbackResourcesCommon[] = { --- 204,213 ---- (XtPointer) TRUE}, {"locatorBar", "LocatorBar", XtRBoolean, sizeof(Boolean), XtOffset(ApplicationDataPtr, locatorbar), XtRImmediate, ! (XtPointer) TRUE}, ! {"instantUpdate", "InstantUpdate", XtRBoolean, sizeof(Boolean), ! XtOffset(ApplicationDataPtr, instantupdate), XtRImmediate, ! (XtPointer) FALSE}, }; String fallbackResourcesCommon[] = { *************** *** 443,448 **** --- 447,456 ---- toolbar_visible = rd.toolbar; statusbar_visible = rd.statusbar; locbar_visible = rd.locatorbar; + graphwin_iu(rd.instantupdate, NULL); + setwin_iu(rd.instantupdate, NULL); + plotwin_iu(rd.instantupdate, NULL); + axeswin_iu(rd.instantupdate, NULL); return RETURN_SUCCESS; } diff -C 3 -P --exclude-from=/home/ed/src/exclude-iu-file -r ./src/xprotos.h ../grace-5.1.13iu/src/xprotos.h *** ./src/xprotos.h 2001-09-09 14:15:37.000000000 -0600 --- ../grace-5.1.13iu/src/xprotos.h 2003-12-03 16:34:20.000000000 -0700 *************** *** 197,200 **** --- 197,205 ---- void set_barebones(int onoff); + void setwin_iu(int, void *); + void plotwin_iu(int, void *); + void graphwin_iu(int, void *); + void axeswin_iu(int, void *); + #endif /* __XPROTOS_H_ */