Ejemplo n.º 1
0
void update_hotlinks(void)
{
    int i, j;
    char buf[256];
    XmString xms;

    if (hotlink_frame != NULL)
    {
        set_wait_cursor();
        XmListDeleteAllItems(hotlink_list_item);
        for (i = 0; i < maxgraph; i++)
        {
            for (j = 0; j < g[i].maxplot; j++)
            {
                if (is_hotlinked(i, j))
                {
                    sprintf(buf, "S%02d -> %s -> %s", j,
                            get_hotlink_src(i, j) == DISK ? "DISK" : "PIPE",
                            get_hotlink_file(i, j));
                    xms = XmStringCreateLtoR(buf, charset);
                    XmListAddItemUnselected(hotlink_list_item, xms, 0);
                    XmStringFree(xms);
                }
            }
        }
        unset_wait_cursor();
    }
}
Ejemplo n.º 2
0
void create_points_frame(void *data)
{
    set_wait_cursor();
    
    if (points_frame == NULL) {
        Widget dialog, wbut, rc, fr;
        
	points_frame = CreateDialogForm(app_shell, "Point explorer");
	
	fr = CreateFrame(points_frame, NULL);
        AddDialogFormChild(points_frame, fr);
	locate_point_message = CreateLabel(fr, "Point explorer");
        
        dialog = CreateVContainer(points_frame);
        AddDialogFormChild(points_frame, dialog);

        track_set_sel = CreateSetChoice(dialog,
            "Restrict to set:", LIST_TYPE_SINGLE, TRUE);
        AddListChoiceCB(track_set_sel, track_set_cbproc, NULL);
        
	rc = CreateHContainer(dialog);
	goto_index_item = CreateTextItem(rc, 6, "Point location:");
	wbut = CreateButton(rc, "Goto point");
	AddButtonCB(wbut, do_gotopt_proc, NULL);

	locate_point_item = CreateTextInput(dialog, "Point data:");

	CreateSeparator(dialog);

	rc = CreateHContainer(dialog);

	wbut = CreateButton(rc, "Track");
	AddButtonCB(wbut, do_track_proc, NULL);

	wbut = CreateButton(rc, "Move");
	AddButtonCB(wbut, do_ptsmove_proc, (void *) MOVE_POINT_XY);
	wbut = CreateButton(rc, "Move X");
	AddButtonCB(wbut, do_ptsmove_proc,  (void *) MOVE_POINT_X);
	wbut = CreateButton(rc, "Move Y");
	AddButtonCB(wbut, do_ptsmove_proc,  (void *) MOVE_POINT_Y);

	wbut = CreateButton(rc, "Prepend");
	AddButtonCB(wbut, do_add_proc, (void *) ADD_POINT_BEGINNING);
	wbut = CreateButton(rc, "Append");
	AddButtonCB(wbut, do_add_proc, (void *) ADD_POINT_END);
	wbut = CreateButton(rc, "Insert");
	AddButtonCB(wbut, do_add_proc, (void *) ADD_POINT_NEAREST);

	wbut = CreateButton(rc, "Delete");
	AddButtonCB(wbut, do_del_proc, NULL);

	wbut = CreateButton(rc, "Close");
	AddButtonCB(wbut, points_done_proc, (void *) points_frame);
        
        ManageChild(points_frame);
    }
    
    RaiseWindow(GetParent(points_frame));
    unset_wait_cursor();
}
Ejemplo n.º 3
0
static void do_axis_proc(Widget w, XtPointer client_data, XtPointer call_data)
{
    Widget wlabel;
    int x, y;
    set_wait_cursor();
    if (axis_frame == NULL) {
	char *label1[2];
	label1[0] = "Accept";
	label1[1] = "Close";
	XmGetPos(app_shell, 0, &x, &y);
	axis_frame = XmCreateDialogShell(app_shell, "Axis props", NULL, 0);
	handle_close(axis_frame);
	XtVaSetValues(axis_frame, XmNx, x, XmNy, y, NULL);
	axis_panel = XmCreateRowColumn(axis_frame, "axis_rc", NULL, 0);


	wlabel = XtVaCreateManagedWidget("Axis offset (viewport coordinates):",
					 xmLabelWidgetClass, axis_panel,
					 NULL);
	offx = CreateTextItem2(axis_panel, 10, "Left or bottom:");
	offy = CreateTextItem2(axis_panel, 10, "Right or top:");

	XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, axis_panel, NULL);

	CreateCommandButtons(axis_panel, 2, but1, label1);
	XtAddCallback(but1[0], XmNactivateCallback, (XtCallbackProc) accept_axis_proc, (XtPointer) 0);
	XtAddCallback(but1[1], XmNactivateCallback, (XtCallbackProc) destroy_dialog, (XtPointer) axis_frame);

	XtManageChild(axis_panel);
    }
    XtRaise(axis_frame);
    update_axis_items(cg);
    unset_wait_cursor();
}
Ejemplo n.º 4
0
static void do_hotunlink_proc(Widget, XtPointer, XtPointer)
{
    XmString *s, cs;
    int *pos_list;
    int pos_cnt, cnt;
    char *cstr;
    int setno;

    set_wait_cursor();

    if (XmListGetSelectedPos(hotlink_list_item, &pos_list, &pos_cnt))
    {
        //j = pos_list[0];
        XtVaGetValues(hotlink_list_item,
                      XmNselectedItemCount, &cnt,
                      XmNselectedItems, &s,
                      NULL);
        cs = XmStringCopy(*s);
        if (XmStringGetLtoR(cs, charset, &cstr))
        {
            sscanf(cstr, "S%d", &setno);
            if (setno >= 0 && setno < g[cg].maxplot)
            {
                set_hotlink(cg, setno, FALSE, NULL, 0);
            }
            XtFree(cstr);
        }
        XmStringFree(cs);
        update_hotlinks();
    }

    unset_wait_cursor();
}
Ejemplo n.º 5
0
static void xmonitor_rti(XtPointer ib, int *ptrFd, XtInputId *ptrId)
{
    set_wait_cursor();
    
    monitor_input(gapp, (Input_buffer *) ib, 1, 1);
    
    unset_wait_cursor();
}
Ejemplo n.º 6
0
static void do_netcdfupdate_proc(Widget, XtPointer, XtPointer)
{
    int i;
    char buf[256];

    set_wait_cursor();
    update_netcdfs();
    unset_wait_cursor();
}
Ejemplo n.º 7
0
/*
 * Create the draw Frame and the draw Panel
 */
void create_draw_frame(Widget w, XtPointer client_data, XtPointer call_data)
{
    int x, y;
    Widget buts[2];
    Widget wlabel;

    set_wait_cursor();
    if (draw_frame == NULL) {
	char *label1[2];
	label1[0] = "Accept";
	label1[1] = "Close";
	XmGetPos(app_shell, 0, &x, &y);
	draw_frame = XmCreateDialogShell(app_shell, "Draw options", NULL, 0);
	handle_close(draw_frame);
	XtVaSetValues(draw_frame,
		      XmNx, x,
		      XmNy, y,
		      NULL);
	draw_panel = XmCreateRowColumn(draw_frame, "draw_rc", NULL, 0);

	wlabel = XtVaCreateManagedWidget("Scroll %:", xmLabelWidgetClass, draw_panel, NULL);
	scrollper_item = XtVaCreateManagedWidget("scroll", xmScaleWidgetClass, draw_panel,
						 XmNwidth, 200,
						 XmNminimum, 0,
						 XmNmaximum, 200,
						 XmNvalue, 0,
						 XmNshowValue, True,
				     XmNprocessingDirection, XmMAX_ON_RIGHT,
					       XmNorientation, XmHORIZONTAL,
						 NULL);
	linkscroll_item = XtVaCreateManagedWidget("Linked scrolling",
				      xmToggleButtonWidgetClass, draw_panel,
						  NULL);
	autoredraw_type_item = XtVaCreateManagedWidget("Auto redraw",
				      xmToggleButtonWidgetClass, draw_panel,
						       NULL);
	autorefresh_type_item = XtVaCreateManagedWidget("Auto refresh",
				      xmToggleButtonWidgetClass, draw_panel,
						       NULL);
	cursor_type_item = XtVaCreateManagedWidget("Crosshair cursor",
				      xmToggleButtonWidgetClass, draw_panel,
						   NULL);

	XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, draw_panel, NULL);

	CreateCommandButtons(draw_panel, 2, buts, label1);
	XtAddCallback(buts[0], XmNactivateCallback,
		      (XtCallbackProc) define_draw_proc, (XtPointer) 0);
	XtAddCallback(buts[1], XmNactivateCallback,
		   (XtCallbackProc) destroy_dialog, (XtPointer) draw_frame);

	XtManageChild(draw_panel);
    }
    XtRaise(draw_frame);
    update_draw();
    unset_wait_cursor();
}
Ejemplo n.º 8
0
Archivo: edit.c Proyecto: jff/mathspad
static void handle_view_filename(void *data, Char *name)
{
    EDITINFO *einf = (EDITINFO *) data;

    if (name) {
	FILE *f;
	int i;

	if (!(f = fopen((char*)UstrtoFilename(name),"rb"))) {
	    message2(MP_CLICKREMARK, translate("Unable to open file "), name);
	    free(name);
	    failure=MP_True;
	    return;
	}
	i=test_file(f);
	set_wait_cursor(einf->win_id);
	switch (i) {
	case BINDOC:
	    message(MP_MESSAGE, translate("Viewing ascii file."));
	    read_file(f,BINARYFILE);
	    unset_file();
	    load_editwindow(einf->info);
	    break;
	case OLDDOC:
	    i = edit_fnr;
	    edit_fnr = 0;
	    view_notation_filenames(f);
	    old_load_editwindow(einf->info,f);
	    edit_fnr = i;
	    break;
	case NEWDOC:
	    i = edit_fnr;
	    edit_fnr = 0;
	    read_file(f,DOCUMENTFILE);
	    unset_file();
	    load_editwindow(einf->info);
	    edit_fnr = i;
	    break;
	default: break;
	}
	fclose(f);
	cleanup_filestack();
	cleanup_stencilstack();
	cleanup_nodestack();
	einf->saved = MP_True;
	einf->auto_saved = MP_True;
	einf->view_mode = MP_True;
	set_name(einf, name);
	set_output_name(einf);
	remove_wait_cursor();
	return;
    }
    free(name);
}
Ejemplo n.º 9
0
void create_rparams_popup(Widget, XtPointer, XtPointer)
{
    set_wait_cursor();
    if (rparams_dialog == NULL)
    {
        rparams_dialog = XmCreateFileSelectionDialog(app_shell, (char *)"rparams_dialog", NULL, 0);
        XtVaSetValues(XtParent(rparams_dialog), XmNtitle, "Read parameters", NULL);
        XtAddCallback(rparams_dialog, XmNcancelCallback, (XtCallbackProc)destroy_dialog, rparams_dialog);
        XtAddCallback(rparams_dialog, XmNokCallback, (XtCallbackProc)do_rparams_proc, 0);
    }
    XtRaise(rparams_dialog);
    unset_wait_cursor();
}
Ejemplo n.º 10
0
void create_editp_frame(Widget w, XtPointer client_data, XtPointer call_data)
{
    int x, y;
    static Widget top;
    Widget dialog;

    set_wait_cursor();

    if (top == NULL) {
		Widget but1[3];
		char *label1[3];
		label1[0] = "Edit";
		label1[1] = "Formula";
		label1[2] = "Close";
		XmGetPos(app_shell, 0, &x, &y);
		top = XmCreateDialogShell(app_shell, "Edit/Create set", NULL, 0);
		handle_close(top);
		XtVaSetValues(top, XmNx, x, XmNy, y, NULL);
		dialog = XmCreateRowColumn(top, "dialog_rc", NULL, 0);
		editp_set_item = CreateSetSelector(dialog, "Edit set:",
										   SET_SELECT_NEXT,
										   FILTER_SELECT_NONE,
										   GRAPH_SELECT_CURRENT,
										   SELECTION_TYPE_SINGLE);

		XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, dialog, NULL);

#ifdef HAVE_LIBXBAE
		ext_editor_item = XtVaCreateManagedWidget("Use external editor", 
                        xmToggleButtonWidgetClass, dialog, 
                        NULL);
		XmToggleButtonSetState( ext_editor_item, False, False );
		XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, dialog, NULL);
#endif
		CreateCommandButtons(dialog, 3, but1, label1);
		
		XtAddCallback(but1[0], XmNactivateCallback,
				(XtCallbackProc) edit_set_proc, NULL);
		XtAddCallback(but1[1], XmNactivateCallback,
				(XtCallbackProc) create_leval_frame, NULL);
		XtAddCallback(but1[2], XmNactivateCallback,
				(XtCallbackProc) destroy_dialog, (XtPointer) top);

		XtAddCallback(editp_set_item.list, XmNsingleSelectionCallback,
				(XtCallbackProc) setsel_cred_cb, (XtPointer)but1[1] );

	XtManageChild(dialog);
    }
    XtRaise(top);
    unset_wait_cursor();
}
Ejemplo n.º 11
0
static void do_rparams_proc(Widget, XtPointer, XtPointer)
{
    Arg args;
    XmString list_item;
    char *s;

    XtSetArg(args, XmNtextString, &list_item);
    XtGetValues(rparams_dialog, &args, 1);
    XmStringGetLtoR(list_item, charset, &s);
    set_wait_cursor();
    getparms(cg, s);
    unset_wait_cursor();
    XtFree(s);
}
Ejemplo n.º 12
0
/*
 * create file selection pop up to choose the file for hotlink
 */
static void create_hotfiles_popup(Widget but, void *data)
{
    static FSBStructure *fsb = NULL;

    set_wait_cursor();

    if (fsb == NULL) {
        fsb = CreateFileSelectionBox(app_shell, "Hotlinked file");
        AddFileSelectionBoxCB(fsb, do_hotlinkfile_proc, data);
        ManageChild(fsb->FSB);
    }
    
    RaiseWindow(fsb->dialog);

    unset_wait_cursor();
}
Ejemplo n.º 13
0
void create_hotfiles_popup(Widget, XtPointer, XtPointer)
{
    static Widget top;

    set_wait_cursor();
    if (top == NULL)
    {
        top = XmCreateFileSelectionDialog(app_shell, (char *)"hotlinks", NULL, 0);
        XtVaSetValues(XtParent(top), XmNtitle, "Select hot link file", NULL);

        XtAddCallback(top, XmNokCallback, (XtCallbackProc)do_hotlinkfile_proc, (XtPointer)top);
        XtAddCallback(top, XmNcancelCallback, (XtCallbackProc)destroy_dialog, (XtPointer)top);
    }
    XtRaise(top);
    unset_wait_cursor();
}
Ejemplo n.º 14
0
static void do_hotupdate_proc(Widget, XtPointer, XtPointer)
{
    int i;

    set_wait_cursor();

    for (i = 0; i < g[cg].maxplot; i++)
    {
        if (is_hotlinked(cg, i))
        {
            do_update_hotlink(cg, i);
        }
    }

    unset_wait_cursor();
    drawgraph();
}
Ejemplo n.º 15
0
static void wparam_apply_notify_proc(Widget, XtPointer, XtPointer)
{
    char fname[256], *s;
    Arg args;
    XmString list_item;
    int wparamno = (int)GetChoice(wparam_choice_item);

    XtSetArg(args, XmNtextString, &list_item);
    XtGetValues(wparam_frame, &args, 1);
    XmStringGetLtoR(list_item, charset, &s);

    wparamno--;

    strcpy(fname, s);

    if (!fexists(fname))
    {
        FILE *pp = fopen(fname, "w");

        if (pp != NULL)
        {
            set_wait_cursor();
            if (wparamno == -1)
            {
                wparamno = cg;
                putparms(wparamno, pp, 0);
                fclose(pp);
            }
            else if (wparamno == maxgraph)
            {
                putparms(-1, pp, 0);
                fclose(pp);
            }
            else
            {
                putparms(wparamno, pp, 0);
                fclose(pp);
            }
            unset_wait_cursor();
        }
        else
        {
            errwin("Unable to open file");
        }
    }
}
Ejemplo n.º 16
0
static void do_openfit_proc(Widget w, XtPointer client_data, XtPointer call_data)
{
    char *s;
    XmFileSelectionBoxCallbackStruct *cbs = (XmFileSelectionBoxCallbackStruct *) call_data;
    if (!XmStringGetLtoR(cbs->value, charset, &s)) {
	errmsg("Error converting XmString to char string in do_openfit_proc()");
	return;
    }
    
    set_wait_cursor();
    
    reset_nonl();
    getparms(s);
    XtFree(s);
    update_nonl_frame();
    
    unset_wait_cursor();
}
Ejemplo n.º 17
0
static void do_axisbar_proc(Widget w, XtPointer client_data, XtPointer call_data)
{
    int x, y;
    set_wait_cursor();
    if (axisbar_frame == NULL) {
	char *label1[2];
	label1[0] = "Accept";
	label1[1] = "Close";
	XmGetPos(app_shell, 0, &x, &y);
	axisbar_frame = XmCreateDialogShell(app_shell, "Axis bar", NULL, 0);
	handle_close(axisbar_frame);
	XtVaSetValues(axisbar_frame, XmNx, x, XmNy, y, NULL);
	axisbar_panel = XmCreateRowColumn(axisbar_frame, "axisbar_rc", NULL, 0);

	barcolor = CreateColorChoice(axisbar_panel, "Color:", 0);

	barlinew = CreatePanelChoice(axisbar_panel, "Line width:",
				     10,
			     "1", "2", "3", "4", "5", "6", "7", "8", "9", 0,
				     0);

	barlines = (Widget *) CreatePanelChoice(axisbar_panel, "Line style:",
						6,
						"Solid line",
						"Dotted line",
						"Dashed line",
						"Long Dashed",
						"Dot-dashed",
						NULL,
						NULL);

	XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, axisbar_panel, NULL);

	CreateCommandButtons(axisbar_panel, 2, but1, label1);

	XtAddCallback(but1[0], XmNactivateCallback, (XtCallbackProc) accept_axisbar_proc, (XtPointer) 0);
	XtAddCallback(but1[1], XmNactivateCallback, (XtCallbackProc) destroy_dialog, (XtPointer) axisbar_frame);

	XtManageChild(axisbar_panel);
    }
    XtRaise(axisbar_frame);
    update_axisbar_items(cg);
    unset_wait_cursor();
}
Ejemplo n.º 18
0
void create_netcdffiles_popup(Widget, XtPointer, XtPointer)
{
    int x, y;
    static Widget top;
    Widget dialog;
    Widget wbut, rc, fr;
    Arg args[2];

    set_wait_cursor();
    if (top == NULL)
    {
        top = XmCreateFileSelectionDialog(app_shell, "netcdfs", NULL, 0);
        XtVaSetValues(XtParent(top), XmNtitle, "Select netCDF file", NULL);

        XtAddCallback(top, XmNokCallback, (XtCallbackProc)do_netcdffile_proc, (XtPointer)top);
        XtAddCallback(top, XmNcancelCallback, (XtCallbackProc)destroy_dialog, (XtPointer)top);
    }
    XtRaise(top);
    unset_wait_cursor();
}
Ejemplo n.º 19
0
static void do_hotlinkfile_proc(Widget, XtPointer client_data, XtPointer)
{
    Widget dialog = (Widget)client_data;
    Arg args;
    XmString list_item;
    char *s;

    set_wait_cursor();

    XtSetArg(args, XmNtextString, &list_item);
    XtGetValues(dialog, &args, 1);
    XmStringGetLtoR(list_item, charset, &s);

    xv_setstr(hotlink_file_item, s);

    XtFree(s);

    unset_wait_cursor();

    XtUnmanageChild(dialog);
}
Ejemplo n.º 20
0
void create_workingdir_popup(Widget w, XtPointer, XtPointer)
{
    XmString str;

    set_wait_cursor();
    if (workingd_dialog == NULL)
    {
        workingd_dialog = XmCreateFileSelectionDialog(app_shell, (char *)"workingd_dialog", NULL, 0);
        XtVaSetValues(XtParent(workingd_dialog), XmNtitle, "Set working directory", NULL);
        XtAddCallback(workingd_dialog, XmNcancelCallback, (XtCallbackProc)destroy_dialog, (XtPointer)workingd_dialog);
        XtAddCallback(workingd_dialog, XmNokCallback, (XtCallbackProc)workingdir_apply_notify_proc, (XtPointer)0);

        /* unmanage unneeded items */
        w = XmFileSelectionBoxGetChild(workingd_dialog, XmDIALOG_LIST);
        XtUnmanageChild(XtParent(w));
        w = XmFileSelectionBoxGetChild(workingd_dialog, XmDIALOG_LIST_LABEL);
        XtUnmanageChild(w);
        w = XmFileSelectionBoxGetChild(workingd_dialog, XmDIALOG_FILTER_LABEL);
        XtUnmanageChild(w);
        w = XmFileSelectionBoxGetChild(workingd_dialog, XmDIALOG_FILTER_TEXT);
        XtUnmanageChild(w);
        w = XmFileSelectionBoxGetChild(workingd_dialog, XmDIALOG_APPLY_BUTTON);
        XtUnmanageChild(w);

        /* save the name of the text item used for definition */
        dir_item = XmFileSelectionBoxGetChild(workingd_dialog, XmDIALOG_TEXT);

        /* Add a callback to the dir list */
        w = XmFileSelectionBoxGetChild(workingd_dialog, XmDIALOG_DIR_LIST);
        XtAddCallback(w, XmNsingleSelectionCallback, (XtCallbackProc)select_dir, (XtPointer)0);
        XtVaSetValues(w, XmNselectionPolicy, XmSINGLE_SELECT, NULL);
    }
    xv_setstr(dir_item, workingdir);
    XtVaSetValues(workingd_dialog, XmNdirectory,
                  str = XmStringCreateLtoR(workingdir, charset), NULL);
    XmFileSelectionDoSearch(workingd_dialog, NULL);
    XmStringFree(str);
    XtRaise(workingd_dialog);
    unset_wait_cursor();
}
Ejemplo n.º 21
0
Archivo: edit.c Proyecto: jff/mathspad
static void edit_handle_fileselc_save(void *data, Char *name)
{
    EDITINFO *einf = (EDITINFO *) data;

    if (name) {
	FILE *f;
	int check_found = check_name(einf, name);

	f = fopen((char*)UstrtoFilename(name),"wb");
	if (f) {
	    set_wait_cursor(einf->win_id);
	    set_file(f);
	    put_filecode(DOCUMENTFILE);
	    save_editwindow(einf->info);
	    unset_file();
	    cleanup_stencilstack();
	    fclose(f);
	    remove_auto_save(einf);
	    einf->auto_saved = MP_True;
	    einf->saved = MP_True;
	    if (check_found) {
		einf->view_mode = MP_True;
		message(MP_CLICKREMARK, translate("You have saved the document under a name\n"
			"which is already used by a different window.\n"
			"To make sure that your backups are\n"
			"correct, this copy will be in view mode."));
	    }
	    set_name(einf,name);
	    message(MP_MESSAGE,translate("File saved."));
	    remove_wait_cursor();
	} else {
	    message(MP_ERROR, translate("Can't save file! "));
	    free(newname);
	    failure=MP_True;
	}
    } else
	free(newname);
    kind_of_remark = NO_REMARK;
}
Ejemplo n.º 22
0
static void jpg_gui_setup(const Canvas *canvas, void *data)
{
    JPG_UI_data *ui = (JPG_UI_data *) data;

    set_wait_cursor();
    
    if (ui->frame == NULL) {
        Widget rc, fr, rc1;
        
	ui->frame = CreateDialog(app_shell, "JPEG options");

        rc = CreateVContainer(ui->frame);

	fr = CreateFrame(rc, "JPEG options");
        rc1 = CreateVContainer(fr);
	ui->quality = CreateSpinChoice(rc1,
            "Quality:", 3, SPIN_TYPE_INT, 0.0, 100.0, 5.0);
	ui->optimize = CreateToggleButton(rc1, "Optimize");
	ui->progressive = CreateToggleButton(rc1, "Progressive");
	ui->grayscale = CreateToggleButton(rc1, "Grayscale");

	fr = CreateFrame(rc, "JPEG advanced options");
        rc1 = CreateVContainer(fr);
	ui->smoothing = CreateSpinChoice(rc1,
            "Smoothing:", 3, SPIN_TYPE_INT, 0.0, 100.0, 10.0);
	ui->baseline = CreateToggleButton(rc1, "Force baseline");
	ui->dct = CreateOptionChoiceVA(rc, "DCT: ",
            "Fast integer", JPEG_DCT_IFAST,
            "Slow integer", JPEG_DCT_ISLOW,
            "Float",        JPEG_DCT_FLOAT,
            NULL);

	CreateAACDialog(ui->frame, rc, set_jpg_setup_proc, ui);
    }
    update_jpg_setup_frame(ui);

    DialogRaise(ui->frame);
    unset_wait_cursor();
}
Ejemplo n.º 23
0
/*
 * Create the label Frame and the label Panel
 */
void create_label_frame(Widget, XtPointer, XtPointer)
{
    int x, y;
    set_wait_cursor();
    if (label_frame == NULL)
    {
        Widget buts[3];
        char *label1[3];
        label1[0] = (char *)"Accept";
        label1[1] = (char *)"Props...";
        label1[2] = (char *)"Close";
        XmGetPos(app_shell, 0, &x, &y);
        label_frame = XmCreateDialogShell(app_shell, (char *)"Title/Subtitle", NULL, 0);
        handle_close(label_frame);
        XtVaSetValues(label_frame, XmNx, x, XmNy, y, NULL);
        label_panel = XtVaCreateWidget("label panel", xmRowColumnWidgetClass, label_frame,
                                       NULL);

        label_title_text_item = CreateTextItem2(label_panel, 30, "Title:");
        label_subtitle_text_item = CreateTextItem2(label_panel, 30, "Subtitle:");

        XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, label_panel,
                                NULL);

        CreateCommandButtons(label_panel, 3, buts, label1);
        XtAddCallback(buts[0], XmNactivateCallback,
                      (XtCallbackProc)label_define_notify_proc, (XtPointer)NULL);
        XtAddCallback(buts[1], XmNactivateCallback,
                      (XtCallbackProc)label_props_notify_proc, (XtPointer)NULL);
        XtAddCallback(buts[2], XmNactivateCallback,
                      (XtCallbackProc)destroy_dialog, (XtPointer)label_frame);

        XtManageChild(label_panel);
    }
    XtRaise(label_frame);
    update_label_proc();
    unset_wait_cursor();
}
Ejemplo n.º 24
0
void pdf_gui_setup(const Canvas *canvas, void *data)
{
    PDF_UI_data *ui = (PDF_UI_data *) data;

    set_wait_cursor();
    
    if (ui->frame == NULL) {
        Widget fr, rc;
        OptionItem compat_ops[3] = {
            {PDF_1_3, "PDF-1.3"},
            {PDF_1_4, "PDF-1.4"},
            {PDF_1_5, "PDF-1.5"}
        };
        OptionItem colorspace_ops[3] = {
            {PDF_COLORSPACE_GRAYSCALE, "Grayscale"},
            {PDF_COLORSPACE_RGB,       "RGB"      },
            {PDF_COLORSPACE_CMYK,      "CMYK"     }
        };
    
	ui->frame = CreateDialog(app_shell, "PDF options");

	fr = CreateFrame(ui->frame, "PDF options");
        rc = CreateVContainer(fr);
	ui->compat =
            CreateOptionChoice(rc, "Compatibility:", 1, 3, compat_ops);
        ui->colorspace =
            CreateOptionChoice(rc, "Colorspace:", 1, 3, colorspace_ops);
	ui->compression = CreateSpinChoice(rc,
            "Compression:", 1, SPIN_TYPE_INT, 0.0, 9.0, 1.0);
	ui->fpprec = CreateSpinChoice(rc,
            "FP precision:", 1, SPIN_TYPE_INT, 4.0, 6.0, 1.0);

	CreateAACDialog(ui->frame, fr, set_pdf_setup_proc, ui);
    }
    update_pdf_setup_frame(ui);
    DialogRaise(ui->frame);
    unset_wait_cursor();
}
Ejemplo n.º 25
0
static void do_netcdffile_proc(Widget, XtPointer, XtPointer)
{
    Widget dialog = (Widget)client_data;
    Arg args;
    XmString list_item;
    char *s;
    char fname[256];

    set_wait_cursor();

    XtSetArg(args, XmNtextString, &list_item);
    XtGetValues(dialog, &args, 1);
    XmStringGetLtoR(list_item, charset, &s);

    xv_setstr(netcdf_file_item, s);

    XtFree(s);

    unset_wait_cursor();

    XtUnmanageChild(dialog);
    update_netcdfs();
}
Ejemplo n.º 26
0
static void rdata_proc(Widget, XtPointer, XtPointer)
{
    int graphno, autoflag;
    Arg args;
    XmString list_item;
    char *s;

    XtSetArg(args, XmNtextString, &list_item);
    XtGetValues(rdata_dialog, &args, 1);
    XmStringGetLtoR(list_item, charset, &s);
    graphno = GetChoice(read_graph_item) - 1;
    autoflag = XmToggleButtonGetState(read_auto_item);
    if (graphno == -1)
    {
        graphno = cg;
    }
    if (g[graphno].active == OFF)
    {
        set_graph_active(graphno);
    }
    set_type_proc(GetChoice(read_ftype_item));
    set_wait_cursor();
    if (getdata(graphno, s, cursource, curtype))
    {
        if (autoscale_onread || autoflag)
        {
            autoscale_proc((Widget)NULL, (XtPointer)0, (XtPointer)NULL);
        }
        else
        {
            drawgraph();
        }
    }
    XtFree(s);
    unset_wait_cursor();
}
Ejemplo n.º 27
0
void create_openfit_popup(Widget w, XtPointer client_data, XtPointer call_data)
{
    XmString dirmask;
    
    set_wait_cursor();
    
    if (openfit_dialog == NULL) {
	openfit_dialog = XmCreateFileSelectionDialog(app_shell, "openfit_dialog", NULL, 0);
	XtVaSetValues(XtParent(openfit_dialog), XmNtitle, "Open fit parameter file", NULL);
	XtAddCallback(openfit_dialog, XmNcancelCallback, (XtCallbackProc) destroy_dialog, openfit_dialog);
	XtAddCallback(openfit_dialog, XmNokCallback, (XtCallbackProc) do_openfit_proc, 0);
	XtAddCallback(openfit_dialog, XmNhelpCallback, (XtCallbackProc) HelpCB, 
	              (XtPointer) NULL);
    }
    
    XtManageChild(openfit_dialog);
    XtRaise(XtParent(openfit_dialog));

    dirmask = XmStringCreateSimple(workingdir);
    XmFileSelectionDoSearch(openfit_dialog, dirmask);
    XmStringFree(dirmask);

    unset_wait_cursor();
}
Ejemplo n.º 28
0
static void do_hotlink_proc(Widget, XtPointer, XtPointer)
{
    int setno, src;
    char fname[256];
    char buf[256];
    XmString xms;

    set_wait_cursor();

    setno = GetSelectedSet(hotlink_set_item);
    src = GetChoice(hotlink_source_item);
    strcpy(fname, xv_getstr(hotlink_file_item));

    sprintf(buf, "S%02d -> %s -> %s", setno, src == 0 ? "DISK" : "PIPE", fname);

    xms = XmStringCreateLtoR(buf, charset);
    XmListAddItemUnselected(hotlink_list_item, xms, 0);

    set_hotlink(cg, setno, TRUE, fname, src == 0 ? DISK : PIPE);

    XmStringFree(xms);

    unset_wait_cursor();
}
Ejemplo n.º 29
0
void create_datasetprop_popup(Widget but, void *data)
{
    set_wait_cursor();

    if (tui.top == NULL) {
        Widget menubar, menupane, fr;
        int i, j;
        char *rowlabels[MAX_SET_COLS];
        char *collabels[DATA_STAT_COLS] =
            {"Min", "at", "Max", "at", "Mean", "Stdev"};
        int column_widths[DATA_STAT_COLS] = {12, 6, 12, 6, 12, 12};
        GraceApp *gapp = (GraceApp *) data;

        tui.top = CreateDialogForm(app_shell, "Data set statistics");

        menubar = CreateMenuBar(tui.top);
        ManageChild(menubar);
        AddDialogFormChild(tui.top, menubar);

        tui.sel = CreateGraphSetSelector(tui.top,
            "Data sets:", LIST_TYPE_SINGLE);
        AddDialogFormChild(tui.top, tui.sel->frame);
        AddStorageChoiceCB(tui.sel->set_sel, changetypeCB, tui.sel);


        menupane = CreateMenu(menubar, "File", 'F', FALSE);
        CreateMenuCloseButton(menupane, tui.top);

        menupane = CreateMenu(menubar, "Help", 'H', TRUE);
        CreateMenuHelpButton(menupane, "On data sets", 's',
            tui.top, "doc/UsersGuide.html#data-sets");
        
        for (i = 0; i < MAX_SET_COLS; i++) {
            rowlabels[i] = copy_string(NULL, dataset_col_name(gapp->grace, i));
            for (j = 0; j < DATA_STAT_COLS; j++) {
                tui.rows[i][j] = NULL;
            }
        }

        fr = CreateFrame(tui.top, "Statistics");
        tui.mw = CreateTable("mw", fr, MAX_SET_COLS, DATA_STAT_COLS,
                                 MAX_SET_COLS, 4);
        TableDataSetPropInit(tui.mw);
        TableSetColLabels(tui.mw, collabels);
        TableSetColWidths(tui.mw, column_widths);
        TableSetDefaultColAlignment(tui.mw, ALIGN_END);
        TableSetDefaultColLabelAlignment(tui.mw, ALIGN_CENTER);
        TableSetRowLabels(tui.mw, rowlabels);
        TableSetDefaultRowLabelWidth(tui.mw, 3);
        TableSetDefaultRowLabelAlignment(tui.mw, ALIGN_CENTER);
        TableUpdateVisibleRowsCols(tui.mw);

        AddTableEnterCellCB(tui.mw, enterCB, NULL);

        AddDialogFormChild(tui.top, fr);
        ManageChild(tui.top);
    }
    
    RaiseWindow(GetParent(tui.top));
    unset_wait_cursor();
}
Ejemplo n.º 30
0
void create_leval_frame(Widget but, void *data)
{
    Quark *gr = (Quark *) data;

    if (!gr) {
        return;
    }
    
    set_wait_cursor();

    levalui.gr = gr;

    if (levalui.top == NULL) {
        int i;
        Widget fr, rc1;
        int nscols;
        char *rows[MAX_SET_COLS][1];
        char **cells[MAX_SET_COLS];
        char *rowlabels[MAX_SET_COLS];
        int column_widths[1] = {50};
        int column_maxlengths[1] = {256};
        Grace *grace = grace_from_quark(gr);

        levalui.top = CreateDialogForm(app_shell, "Load & evaluate");

        fr = CreateFrame(levalui.top, "Parameter mesh ($t)");
        AddDialogFormChild(levalui.top, fr);
        rc1 = CreateHContainer(fr);
        levalui.start = CreateTextItem(rc1, 10, "Start at:");
        levalui.stop = CreateTextItem(rc1, 10, "Stop at:");
        levalui.npts = CreateTextItem(rc1, 6, "Length:");

        levalui.set_type = CreateSetTypeChoice(levalui.top, "Set type:");
        AddDialogFormChild(levalui.top, levalui.set_type->menu);
        AddOptionChoiceCB(levalui.set_type, set_type_cb, (void *) &levalui);
        
        nscols = 2;
        for (i = 0; i < nscols; i++) {
            rowlabels[i] = copy_string(NULL, dataset_col_name(grace, i));
            rowlabels[i] = concat_strings(rowlabels[i], " = ");
            if (i == 0) {
                rows[i][0] = "$t";
            } else {
                rows[i][0] = "";
            }
            cells[i] = &rows[i][0];
        }

        levalui.mw = CreateTable("mw", levalui.top,
                                 nscols, 1,
                                 MAX_SET_COLS, 1);
        TableLevalInit(levalui.mw);
        TableSetColWidths(levalui.mw, column_widths);
        TableSetColMaxlengths(levalui.mw, column_maxlengths);
        TableSetRowLabels(levalui.mw, rowlabels);
        TableSetDefaultRowLabelWidth(levalui.mw, 6);
        TableSetDefaultRowLabelAlignment(levalui.mw, ALIGN_CENTER);
        TableSetCells(levalui.mw, cells);
        TableUpdateVisibleRowsCols(levalui.mw);

        AddTableLeaveCellCB(levalui.mw, leaveCB, &levalui);

        CreateAACDialog(levalui.top, levalui.mw, leval_aac_cb, &levalui);
    }
    
    RaiseWindow(GetParent(levalui.top));
    unset_wait_cursor();
}