示例#1
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();
}
示例#2
0
static LineUI *create_line_ui(Widget parent, ExplorerUI *eui)
{
    LineUI *ui;
    Widget fr, rc, rc1;
    
    ui = xmalloc(sizeof(LineUI));
    
    ui->top = CreateVContainer(parent);
    fr = CreateFrame(ui->top, "Vector");
    rc = CreateHContainer(fr);
    ui->v_x = CreateSpinChoice(rc, "X: ",
        8, SPIN_TYPE_FLOAT, -10.0, 10.0, 0.05);
    AddSpinChoiceCB(ui->v_x, sp_explorer_cb, eui);
    ui->v_y = CreateSpinChoice(rc, "Y:",
        8, SPIN_TYPE_FLOAT, -10.0, 10.0, 0.05);
    AddSpinChoiceCB(ui->v_y, sp_explorer_cb, eui);

    fr = CreateFrame(ui->top, "Arrows");
    rc = CreateVContainer(fr);
    ui->arrow_end = CreatePanelChoice(rc, "Place at:",
				      "None",
				      "Start",
				      "End",
				      "Both ends",
				      NULL);
    AddOptionChoiceCB(ui->arrow_end, oc_explorer_cb, eui);

    rc1 = CreateHContainer(rc);
    ui->a_type = CreateLabelOptionChoiceVA(rc1, "Type:",
        "Line",   ARROW_TYPE_LINE,
        "Filled", ARROW_TYPE_FILLED,
        "Circle", ARROW_TYPE_CIRCLE,
        NULL);
    AddOptionChoiceCB(ui->a_type, oc_explorer_cb, eui);
    ui->a_length = CreateSpinChoice(rc1, "Length:",
        4, SPIN_TYPE_FLOAT, -10.0, 10.0, 0.5);
    AddSpinChoiceCB(ui->a_length, sp_explorer_cb, eui);
    rc1 = CreateHContainer(rc);
    ui->a_dL_ff = CreateSpinChoice(rc1, "d/L FF:",
        4, SPIN_TYPE_FLOAT, 0.0, 10.0, 0.1);
    AddSpinChoiceCB(ui->a_dL_ff, sp_explorer_cb, eui);
    ui->a_lL_ff = CreateSpinChoice(rc1, "l/L FF:",
        4, SPIN_TYPE_FLOAT, -1.0, 1.0, 0.1);
    AddSpinChoiceCB(ui->a_lL_ff, sp_explorer_cb, eui);
    
    return ui;
}
示例#3
0
文件: axis_ui.c 项目: mariusal/grace
AGridUI *create_axisgrid_ui(ExplorerUI *eui)
{
    AGridUI *ui;
    int i;
    LabelOptionItem opitems[3];
    char buf[32];
    Widget tab, rc, rc2, rc3, fr;

    ui = xmalloc(sizeof(AGridUI));

    /* ------------ Tabs --------------*/
    tab = CreateTab(eui->scrolled_window); 
    AddHelpCB(tab, "doc/UsersGuide.html#axisgrid-properties");

    ui->main_tp = CreateTabPage(tab, "Grid");

    rc = CreateHContainer(ui->main_tp);
    opitems[0].value = AXIS_TYPE_X;
    opitems[0].label = "X";
    opitems[1].value = AXIS_TYPE_Y;
    opitems[1].label = "Y";
    ui->type = CreateLabelOptionChoice(rc, "Type:", 0, 2, opitems);
    AddOptionChoiceCB(ui->type, oc_explorer_cb, eui);

    fr = CreateFrame(ui->main_tp, "Spacing");
    rc = CreateVContainer(fr);

    rc2 = CreateHContainer(rc);
    ui->tmajor = CreateText2(rc2, "Major spacing:", 8);
    AddTextActivateCB(ui->tmajor, text_explorer_cb, eui);
    ui->nminor = CreateSpinChoice(rc2, "Minor ticks:",
        2, SPIN_TYPE_INT, 0.0, (double) MAX_TICKS - 1, 1.0);
    AddSpinChoiceCB(ui->nminor, sp_explorer_cb, eui);

    rc2 = CreateHContainer(rc);
    ui->tround = CreateToggleButton(rc2, "Place at rounded positions");
    AddToggleButtonCB(ui->tround, tb_explorer_cb, eui);
    ui->autonum = CreatePanelChoice(rc2, "Autotick divisions:",
        "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", NULL);
    AddOptionChoiceCB(ui->autonum, oc_explorer_cb, eui);

    rc2 = CreateHContainer(ui->main_tp);

    /* major grid lines */
    fr = CreateFrame(rc2, "Major grid lines");
    rc = CreateVContainer(fr);
    ui->tgrid = CreateToggleButton(rc, "Enabled");
    AddToggleButtonCB(ui->tgrid, tb_explorer_cb, eui);
    ui->tgridpen = CreatePenChoice(rc, "Pen:");
    AddPenChoiceCB(ui->tgridpen, pen_explorer_cb, eui);
    ui->tgridlinew = CreateLineWidthChoice(rc, "Line width:");
    AddSpinChoiceCB(ui->tgridlinew, sp_explorer_cb, eui);
    ui->tgridlines = CreateLineStyleChoice(rc, "Line style:");
    AddOptionChoiceCB(ui->tgridlines, oc_explorer_cb, eui);

    /* minor grid lines */
    fr = CreateFrame(rc2, "Minor grid lines");
    rc = CreateVContainer(fr);
    ui->tmgrid = CreateToggleButton(rc, "Enabled");
    AddToggleButtonCB(ui->tmgrid, tb_explorer_cb, eui);
    ui->tmgridpen = CreatePenChoice(rc, "Pen:");
    AddPenChoiceCB(ui->tmgridpen, pen_explorer_cb, eui);
    ui->tmgridlinew = CreateLineWidthChoice(rc, "Line width:");
    AddSpinChoiceCB(ui->tmgridlinew, sp_explorer_cb, eui);
    ui->tmgridlines = CreateLineStyleChoice(rc, "Line style:");
    AddOptionChoiceCB(ui->tmgridlines, oc_explorer_cb, eui);


    ui->label_tp = CreateTabPage(tab, "Axis bar");

    fr = CreateFrame(ui->label_tp, "Bar properties");
    rc = CreateVContainer(fr);

    rc2 = CreateHContainer(rc);
    ui->barpen = CreatePenChoice(rc2, "Pen:");
    AddPenChoiceCB(ui->barpen, pen_explorer_cb, eui);
    ui->barlines = CreateLineStyleChoice(rc2, "Line style:");
    AddOptionChoiceCB(ui->barlines, oc_explorer_cb, eui);

    ui->barlinew = CreateLineWidthChoice(rc, "Width:");
    AddSpinChoiceCB(ui->barlinew, sp_explorer_cb, eui);


    ui->tickmark_tp = CreateTabPage(tab, "Tick marks");

    rc2 = CreateHContainer(ui->tickmark_tp);

    /* major tick marks */
    fr = CreateFrame(rc2, "Major ticks");
    rc = CreateVContainer(fr);
    ui->tinout = CreateLabelOptionChoiceVA(rc, "Pointing:",
        "In",   TICKS_IN,
        "Out",  TICKS_OUT,
        "Both", TICKS_BOTH,
        NULL);
    AddOptionChoiceCB(ui->tinout, oc_explorer_cb, eui);
    ui->tlen = CreateSpinChoice(rc, "Tick length",
        4, SPIN_TYPE_FLOAT, 0.0, 100.0, 0.25);
    AddSpinChoiceCB(ui->tlen, sp_explorer_cb, eui);
    ui->tpen = CreatePenChoice(rc, "Pen:");
    AddPenChoiceCB(ui->tpen, pen_explorer_cb, eui);
    ui->tlinew = CreateLineWidthChoice(rc, "Line width:");
    AddSpinChoiceCB(ui->tlinew, sp_explorer_cb, eui);
    ui->tlines = CreateLineStyleChoice(rc, "Line style:");
    AddOptionChoiceCB(ui->tlines, oc_explorer_cb, eui);

    fr = CreateFrame(rc2, "Minor ticks");
    rc = CreateVContainer(fr);
    ui->tminout = CreateLabelOptionChoiceVA(rc, "Pointing:",
        "In",   TICKS_IN,
        "Out",  TICKS_OUT,
        "Both", TICKS_BOTH,
        NULL);
    AddOptionChoiceCB(ui->tminout, oc_explorer_cb, eui);
    ui->tmlen = CreateSpinChoice(rc, "Tick length",
        4, SPIN_TYPE_FLOAT, 0.0, 100.0, 0.25);
    AddSpinChoiceCB(ui->tmlen, sp_explorer_cb, eui);
    ui->tmpen = CreatePenChoice(rc, "Pen:");
    AddPenChoiceCB(ui->tmpen, pen_explorer_cb, eui);
    ui->tmlinew = CreateLineWidthChoice(rc, "Line width:");
    AddSpinChoiceCB(ui->tmlinew, sp_explorer_cb, eui);
    ui->tmlines = CreateLineStyleChoice(rc, "Line style:");
    AddOptionChoiceCB(ui->tmlines, oc_explorer_cb, eui);


    ui->ticklabel_tp = CreateTabPage(tab, "Tick labels");

    fr = CreateFrame(ui->ticklabel_tp, "Formatting");
    rc2 = CreateVContainer(fr);
    rc = CreateHContainer(rc2);
    ui->tlcharsize = CreateCharSizeChoice(rc, "Char size");
    AddSpinChoiceCB(ui->tlcharsize, sp_explorer_cb, eui);
    ui->tlangle = CreateAngleChoice(rc, "Angle:");
    AddSpinChoiceCB(ui->tlangle, sp_explorer_cb, eui);

    rc = CreateHContainer(rc2);
    ui->tlfont = CreateFontChoice(rc, "Font:");
    AddOptionChoiceCB(ui->tlfont, oc_explorer_cb, eui);
    ui->tlcolor = CreateColorChoice(rc, "Color:");
    AddOptionChoiceCB(ui->tlcolor, oc_explorer_cb, eui);

    rc = CreateHContainer(rc2);
    ui->tlform = CreateFormatChoice(rc);
    AddFormatChoiceCB(ui->tlform , format_explorer_cb, eui);


    fr = CreateFrame(ui->ticklabel_tp, "Placement");

    rc2 = CreateVContainer(fr);
    rc3 = CreateHContainer(rc2);
    ui->tlstarttype = CreatePanelChoice(rc3, "Start at:",
                                    "Axis min", "Specified:", NULL);
    AddOptionChoiceCB(ui->tlstarttype, oc_explorer_cb, eui);
    ui->tlstart = CreateText2(rc3, "", 8);
    AddTextActivateCB(ui->tlstart, text_explorer_cb, eui);

    rc3 = CreateHContainer(rc2);
    ui->tlstoptype = CreatePanelChoice(rc3, "Stop at:",
                                   "Axis max", "Specified:", NULL);
    AddOptionChoiceCB(ui->tlstoptype, oc_explorer_cb, eui);
    ui->tlstop = CreateText2(rc3, "", 8);
    AddTextActivateCB(ui->tlstop, text_explorer_cb, eui);

    fr = CreateFrame(ui->ticklabel_tp, "Extra");
    rc = CreateVContainer(fr);

    rc2 = CreateHContainer(rc);
    ui->tlskip = CreatePanelChoice(rc2, "Skip every:",
        "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL);
    AddOptionChoiceCB(ui->tlskip, oc_explorer_cb, eui);
    ui->tlstagger = CreatePanelChoice(rc2, "Stagger:",
        "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL);
    AddOptionChoiceCB(ui->tlstagger, oc_explorer_cb, eui);


    ui->tlformula = CreateText(rc, "Axis transform:");
    AddTextActivateCB(ui->tlformula, text_explorer_cb, eui);

    rc2 = CreateHContainer(rc);
    ui->tlprestr = CreateText(rc2, "Prepend:");
    TextSetLength(ui->tlprestr, 13);
    AddTextActivateCB(ui->tlprestr, text_explorer_cb, eui);
    ui->tlappstr = CreateText(rc2, "Append:");
    TextSetLength(ui->tlappstr, 13);
    AddTextActivateCB(ui->tlappstr, text_explorer_cb, eui);

    rc2 = CreateHContainer(rc);
    ui->tlgap_para = CreateText2(rc2, "Parallel offset:", 5);
    AddTextActivateCB(ui->tlgap_para, text_explorer_cb, eui);
    ui->tlgap_perp = CreateText2(rc2, "Perpendicular offset:", 5);
    AddTextActivateCB(ui->tlgap_perp, text_explorer_cb, eui);


    ui->special_tp = CreateTabPage(tab, "Special");

    opitems[0].value = TICKS_SPEC_NONE;
    opitems[0].label = "None";
    opitems[1].value = TICKS_SPEC_MARKS;
    opitems[1].label = "Tick marks";
    opitems[2].value = TICKS_SPEC_BOTH;
    opitems[2].label = "Tick marks and labels";
    ui->specticks = CreateLabelOptionChoice(ui->special_tp, "Special ticks:", 0, 3, opitems);
    AddOptionChoiceCB(ui->specticks, oc_explorer_cb, eui);

    ui->nspec = CreateSpinChoice(ui->special_tp, "Number of user ticks to use:",
        3, SPIN_TYPE_INT, 0.0, (double) MAX_TICKS, 1.0);
    AddSpinChoiceCB(ui->nspec, sp_explorer_cb, eui);
    CreateLabel(ui->special_tp, "Tick location - Label:");

    ui->sw = CreateScrolledWindow(ui->special_tp);
    WidgetSetHeight(ui->sw, 320);

    rc = CreateVContainer(ui->sw);

    for (i = 0; i < MAX_TICKS; i++) {
        rc3 = CreateHContainer(rc);
        sprintf(buf, "%2d", i);
        ui->specloc[i]   = CreateText2(rc3, buf, 12);
        AddTextActivateCB(ui->specloc[i], text_explorer_cb, eui);
        ui->speclabel[i] = CreateText2(rc3, "", 30);
        AddTextActivateCB(ui->speclabel[i], text_explorer_cb, eui);
    }

    SelectTabPage(tab, ui->main_tp);
    
    ui->top = tab;
    
    return ui;
}
示例#4
0
文件: eblockwin.cpp 项目: nixz/covise
/*
 * Create the files Frame and the files Panel
 */
void create_eblock_frame(Widget, XtPointer, XtPointer)
{
    long i;
    int x, y;
    Widget rc, buts[2];

    if (blockncols == 0)
    {
        errwin("Need to read block data first");
        return;
    }
    set_wait_cursor();
    if (eblock_frame == NULL)
    {
        char *label1[2];
        label1[0] = (char *)"Accept";
        label1[1] = (char *)"Close";
        XmGetPos(app_shell, 0, &x, &y);
        eblock_frame = XmCreateDialogShell(app_shell, (char *)"Edit block data", NULL, 0);
        handle_close(eblock_frame);
        XtVaSetValues(eblock_frame, XmNx, x, XmNy, y, NULL);
        eblock_panel = XmCreateRowColumn(eblock_frame, (char *)"eblock_rc", NULL, 0);

        eblock_ncols_item = XtVaCreateManagedWidget((char *)"tmp", xmLabelWidgetClass, eblock_panel,
                                                    NULL);

        rc = XtVaCreateWidget((char *)"rc", xmRowColumnWidgetClass, eblock_panel,
                              XmNpacking, XmPACK_COLUMN,
                              XmNnumColumns, 9,
                              XmNorientation, XmHORIZONTAL,
                              XmNisAligned, True,
                              XmNadjustLast, False,
                              XmNentryAlignment, XmALIGNMENT_END,
                              NULL);

        XtVaCreateManagedWidget((char *)"Set type: ", xmLabelWidgetClass, rc, NULL);
        eblock_type_choice_item = CreatePanelChoice(rc,
                                                    " ",
                                                    13,
                                                    "XY",
                                                    "XY DX",
                                                    "XY DY",
                                                    "XY DX1 DX2",
                                                    "XY DY1 DY2",
                                                    "XY DX DY",
                                                    "XY Z",
                                                    "XY HILO",
                                                    "XY R",
                                                    "XY BOX",
                                                    "Rawspice",
                                                    "XY BOXPLOT",
                                                    NULL, 0);
        for (i = 0; i < 12; i++)
        {
            XtAddCallback(eblock_type_choice_item[2 + i],
                          XmNactivateCallback, (XtCallbackProc)eblock_type_notify_proc, (XtPointer)i);
        }

        XtVaCreateManagedWidget("X from column:", xmLabelWidgetClass, rc, NULL);
        eblock_x_choice_item = CreateBlockChoice(rc, (char *)" ", maxblock, 1);
        XtVaCreateManagedWidget("Y from column:", xmLabelWidgetClass, rc, NULL);
        eblock_y_choice_item = CreateBlockChoice(rc, (char *)" ", maxblock, 0);
        XtVaCreateManagedWidget("E1 from column:", xmLabelWidgetClass, rc, NULL);
        eblock_e1_choice_item = CreateBlockChoice(rc, (char *)" ", maxblock, 0);
        XtVaCreateManagedWidget("E2 from column:", xmLabelWidgetClass, rc, NULL);
        eblock_e2_choice_item = CreateBlockChoice(rc, (char *)" ", maxblock, 0);
        XtVaCreateManagedWidget("E3 from column:", xmLabelWidgetClass, rc, NULL);
        eblock_e3_choice_item = CreateBlockChoice(rc, (char *)" ", maxblock, 0);
        XtVaCreateManagedWidget("E4 from column:", xmLabelWidgetClass, rc, NULL);
        eblock_e4_choice_item = CreateBlockChoice(rc, (char *)" ", maxblock, 0);
        /*
         XtVaCreateManagedWidget("Load to set:", xmLabelWidgetClass, rc, NULL);
         eblock_set_choice_item = CreateSetChoice(rc, " ", maxplot, 4);
      */

        XtVaCreateManagedWidget((char *)"Load to set in graph:", xmLabelWidgetClass, rc, NULL);
        eblock_graph_choice_item = CreateGraphChoice(rc, (char *)" ", maxgraph, 1);

        XtManageChild(rc);

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

        CreateCommandButtons(eblock_panel, 2, buts, label1);
        XtAddCallback(buts[0], XmNactivateCallback,
                      (XtCallbackProc)eblock_accept_notify_proc, (XtPointer)0);
        XtAddCallback(buts[1], XmNactivateCallback,
                      (XtCallbackProc)destroy_dialog, (XtPointer)eblock_frame);

        XtManageChild(eblock_panel);
    }
    XtRaise(eblock_frame);
    update_eblock();
    unset_wait_cursor();
} /* end create_eblock_panel */
示例#5
0
void do_props_proc(Widget w, XtPointer client_data, XtPointer call_data)
{
    int x, y;
    static Widget top, acceptcallback;
    Widget dialog;
    EditPoints *ep = (EditPoints *) client_data;

    set_wait_cursor();
    if (top == NULL) {
	Widget but1[2];
	char *label1[2];
	label1[0] = "Accept";
	label1[1] = "Close";
	XmGetPos(app_shell, 0, &x, &y);
	top = XmCreateDialogShell(app_shell, "Edit set props", NULL, 0);
	handle_close(top);
	XtVaSetValues(top, XmNx, x, XmNy, y, NULL);
	dialog = XmCreateRowColumn(top, "dialog_rc", NULL, 0);

	editp_col_item = CreatePanelChoice(dialog, "Apply to column:",
				    8, "1", "2", "3", "4", "5", "6", "All",
					   NULL, 0);

	editp_format_item = CreatePanelChoice(dialog, "Format:",
					      4,
					      "Decimal",
					      "General",
					      "Exponential",
					      NULL, 0);

	editp_precision_item = CreatePanelChoice(dialog, "Precision:",
						 16,
						 "0", "1", "2", "3", "4",
						 "5", "6", "7", "8", "9",
						 "10", "11", "12", "13", "14",
						 NULL, 0);

	editp_width_item = CreatePanelChoice0(dialog, "Width:",
					5, 21,
				"1", "2", "3", "4", "5",
				"6", "7", "8", "9", "10", 
				"11", "12", "13", "14", "15",
				"16", "17", "18", "19", "20",
					NULL, 0);

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

	CreateCommandButtons(dialog, 2, but1, label1);
	XtAddCallback(but1[0], XmNactivateCallback,
	    	(XtCallbackProc) do_accept_props, (XtPointer) ep);
	XtAddCallback(but1[1], XmNactivateCallback,
	    	(XtCallbackProc) destroy_dialog, (XtPointer) top);
	XtManageChild(dialog);
	acceptcallback = but1[0];
    }
    XtRemoveAllCallbacks(acceptcallback, XmNactivateCallback);
    XtAddCallback(acceptcallback, XmNactivateCallback,
    	    (XtCallbackProc) do_accept_props, (XtPointer) ep);
    update_props(ep);
    XtRaise(top);
    unset_wait_cursor();
}
示例#6
0
文件: fileswin.cpp 项目: nixz/covise
void create_file_popup(Widget, XtPointer, XtPointer)
{
    long i;
    Widget lab, rc, rc2, fr, rb, w[3];

    set_wait_cursor();

    if (rdata_dialog == NULL)
    {
        rdata_dialog = XmCreateFileSelectionDialog(app_shell, (char *)"rdata_dialog", NULL, 0);
        XtVaSetValues(XtParent(rdata_dialog), XmNtitle, "Read sets", NULL);
        XtAddCallback(rdata_dialog, XmNcancelCallback, (XtCallbackProc)destroy_dialog, rdata_dialog);
        XtAddCallback(rdata_dialog, XmNokCallback, rdata_proc, 0);

        curtype = XY;

        rc = XmCreateRowColumn(rdata_dialog, (char *)"Read data main RC", NULL, 0);

        fr = XmCreateFrame(rc, (char *)"frame_1", NULL, 0);
        rc2 = XmCreateRowColumn(fr, (char *)"Read data main RC", NULL, 0);
        XtVaSetValues(rc2, XmNorientation, XmHORIZONTAL, NULL);
        read_ftype_item = CreatePanelChoice(rc2, "File format: ", 16,
                                            "X Y",
                                            "X Y1 Y2 ... ",
                                            "IHL",
                                            "Binary",
                                            "X Y DX",
                                            "X Y DY",
                                            "X Y DX1 DX2",
                                            "X Y DY1 DY2",
                                            "X Y DX DY",
                                            "X Y Z",
                                            "X HI LO OPEN CLOSE",
                                            "X Y RADIUS",
                                            "X Y BOX",
                                            "Rawspice",
                                            "X Y BOXPLOT",
                                            NULL, NULL);

        XtManageChild(rc2);
        XtManageChild(fr);

        fr = XmCreateFrame(rc, (char *)"frame_2", NULL, 0);
        rc2 = XmCreateRowColumn(fr, (char *)"Read data main RC", NULL, 0);
        XtVaSetValues(rc2, XmNorientation, XmHORIZONTAL, NULL);
        lab = XmCreateLabel(rc2, (char *)"File Source:", NULL, 0);
        rb = XmCreateRadioBox(rc2, (char *)"radio_box_2", NULL, 0);
        XtVaSetValues(rb, XmNorientation, XmHORIZONTAL, NULL);
        w[0] = XmCreateToggleButton(rb, (char *)"Disk", NULL, 0);
        w[1] = XmCreateToggleButton(rb, (char *)"Pipe", NULL, 0);
        for (i = 0; i < 2; i++)
        {
            XtAddCallback(w[i], XmNvalueChangedCallback, set_src_proc, (XtPointer)i);
        }
        XtManageChild(lab);
        XtManageChild(rb);
        XtManageChildren(w, 2);
        XtManageChild(rc2);
        XtManageChild(fr);
        XmToggleButtonSetState(w[0], True, False);

        fr = XmCreateFrame(rc, (char *)"frame_3", NULL, 0);
        rc2 = XmCreateRowColumn(fr, (char *)"Read data main RC", NULL, 0);
        read_graph_item = CreateGraphChoice(rc2, "Read to graph: ", maxgraph, 1);
        read_auto_item = XmCreateToggleButton(rc2, (char *)"Autoscale on read", NULL, 0);
        XtManageChild(read_auto_item);
        XtManageChild(rc2);
        XtManageChild(fr);
        XtManageChild(rc);

        XtManageChild(rc);
    }
    XtRaise(rdata_dialog);
    unset_wait_cursor();
}
示例#7
0
文件: labelwin.cpp 项目: nixz/covise
static void label_props_notify_proc(Widget, XtPointer, XtPointer)
{
    Widget wlabel, rc, rc2, rc3, fr;
    int x, y;
    set_wait_cursor();
    if (labelprops_frame == NULL)
    {
        Widget buts[2];
        char *label1[2];
        label1[0] = (char *)"Accept";
        label1[1] = (char *)"Close";
        XmGetPos(app_shell, 0, &x, &y);
        labelprops_frame = XmCreateDialogShell(app_shell, (char *)"Title/Subtitle props", NULL, 0);
        handle_close(labelprops_frame);
        XtVaSetValues(labelprops_frame, XmNx, x, XmNy, y, NULL);
        labelprops_panel = XtVaCreateWidget("labelprops panel",
                                            xmRowColumnWidgetClass, labelprops_frame,
                                            NULL);

        rc = XmCreateRowColumn(labelprops_panel, (char *)"rc", NULL, 0);
        XtVaSetValues(rc,
                      XmNorientation, XmHORIZONTAL,
                      NULL);

        fr = XtVaCreateManagedWidget("frame", xmFrameWidgetClass, rc,
                                     NULL);
        rc2 = XtVaCreateManagedWidget("rc2", xmRowColumnWidgetClass, fr,
                                      NULL);
        XtVaCreateManagedWidget("Title:", xmLabelWidgetClass, rc2,
                                NULL);
        title_font_item = CreatePanelChoice(rc2, "Font:",
                                            11,
                                            "Times-Roman", "Times-Bold", "Times-Italic",
                                            "Times-BoldItalic", "Helvetica",
                                            "Helvetica-Bold", "Helvetica-Oblique",
                                            "Helvetica-BoldOblique", "Greek", "Symbol",
                                            0,
                                            0);
        wlabel = XtVaCreateManagedWidget("Character size:", xmLabelWidgetClass, rc2,
                                         NULL);
        title_size_item = XtVaCreateManagedWidget("stringsize", xmScaleWidgetClass, rc2,
                                                  XmNminimum, 0,
                                                  XmNmaximum, 400,
                                                  XmNvalue, 100,
                                                  XmNshowValue, True,
                                                  XmNprocessingDirection, XmMAX_ON_RIGHT,
                                                  XmNorientation, XmHORIZONTAL,
                                                  NULL);

        rc3 = XmCreateRowColumn(rc2, (char *)"rc3", NULL, 0);
        XtVaSetValues(rc3, XmNorientation, XmHORIZONTAL, NULL);
        title_color_item = CreateColorChoice(rc3, "Color:", 0);
        title_linew_item = CreatePanelChoice(rc3, "Width:",
                                             10,
                                             "1", "2", "3", "4", "5", "6", "7", "8", "9", 0,
                                             0);
        XtManageChild(rc3);
        XtManageChild(rc2);
        XtManageChild(fr);

        fr = XtVaCreateManagedWidget("frame", xmFrameWidgetClass, rc,
                                     NULL);
        rc2 = XtVaCreateManagedWidget("rc2", xmRowColumnWidgetClass, fr,
                                      NULL);
        wlabel = XtVaCreateManagedWidget("Subtitle:", xmLabelWidgetClass, rc2,
                                         NULL);
        stitle_font_item = CreatePanelChoice(rc2, "Font:",
                                             11,
                                             "Times-Roman", "Times-Bold", "Times-Italic",
                                             "Times-BoldItalic", "Helvetica",
                                             "Helvetica-Bold", "Helvetica-Oblique",
                                             "Helvetica-BoldOblique", "Greek", "Symbol",
                                             0,
                                             0);
        wlabel = XtVaCreateManagedWidget("Character size:", xmLabelWidgetClass, rc2,
                                         NULL);
        stitle_size_item = XtVaCreateManagedWidget("stringsize", xmScaleWidgetClass, rc2,
                                                   XmNminimum, 0,
                                                   XmNmaximum, 400,
                                                   XmNvalue, 100,
                                                   XmNshowValue, True,
                                                   XmNprocessingDirection, XmMAX_ON_RIGHT,
                                                   XmNorientation, XmHORIZONTAL,
                                                   NULL);
        rc3 = XmCreateRowColumn(rc2, (char *)"rc3", NULL, 0);
        XtVaSetValues(rc3, XmNorientation, XmHORIZONTAL, NULL);
        stitle_color_item = CreateColorChoice(rc3, "Color:", 0);
        stitle_linew_item = CreatePanelChoice(rc3, "Width:",
                                              10,
                                              "1", "2", "3", "4", "5", "6", "7", "8", "9", 0,
                                              0);

        XtManageChild(rc3);
        XtManageChild(rc2);
        XtManageChild(fr);

        XtManageChild(rc);

        CreateCommandButtons(labelprops_panel, 2, buts, label1);
        XtAddCallback(buts[0], XmNactivateCallback,
                      (XtCallbackProc)labelprops_define_notify_proc, (XtPointer)NULL);
        XtAddCallback(buts[1], XmNactivateCallback,
                      (XtCallbackProc)destroy_dialog, (XtPointer)labelprops_frame);
        XtManageChild(labelprops_panel);
    }
    update_labelprops_proc();
    XtRaise(labelprops_frame);
    unset_wait_cursor();
}
示例#8
0
文件: nonlwin.cpp 项目: nixz/covise
/* ARGSUSED */
void create_nonl_frame(Widget, XtPointer, XtPointer)
{
    int i;
    int x, y;
    Widget sw, fr, rc, rc1, rc2, lab, but1[3];
    set_wait_cursor();
    if (nonl_frame == NULL)
    {
        char *label1[3];
        /*
         label1[0] = "Accept";
         label1[1] = "Eval...";
         label1[2] = "Close";
      */
        label1[0] = (char *)"Accept";
        label1[1] = (char *)"Close";
        XmGetPos(app_shell, 0, &x, &y);
        nonl_frame = XmCreateDialogShell(app_shell, (char *)"Non-linear curve fitting", NULL, 0);
        handle_close(nonl_frame);
        XtVaSetValues(nonl_frame, XmNx, x, XmNy, y, NULL);
        nonl_panel = XmCreateForm(nonl_frame, (char *)"nonl_frame_rc", NULL, 0);
        fr = XmCreateFrame(nonl_panel, (char *)"nonl_frame", NULL, 0);
        rc = XmCreateRowColumn(fr, (char *)"nonl_rc", NULL, 0);

        nonl_set_item = CreateSetChoice(rc, (char *)"Use set:", maxplot, 0);

        nonl_load_item = CreatePanelChoice(rc,
                                           "Load:",
                                           4,
                                           "Fitted values",
                                           "Residuals",
                                           "None",
                                           NULL, NULL);

        nonl_loadgraph_item = CreateGraphChoice(rc, (char *)"To graph:", maxgraph, 0);

        nonl_formula_item = (Widget)CreateTextItem2(rc, 35, (char *)"Function:");
        xv_setstr(nonl_formula_item, (char *)"y = ");

        nonl_nparm_item = CreateTextItem2(rc, 5, (char *)"# of parameters:");
        nonl_tol_item = CreateTextItem2(rc, 10, (char *)"Tolerance:");
        XtManageChild(rc);
        XtManageChild(fr);
        sw = XtVaCreateManagedWidget("sw",
                                     xmScrolledWindowWidgetClass, nonl_panel,
                                     XmNscrollingPolicy, XmAUTOMATIC,
                                     NULL);

        rc = XmCreateRowColumn(sw, (char *)"rc", NULL, 0);
        XtVaSetValues(rc, XmNorientation, XmHORIZONTAL, NULL);

        rc1 = XmCreateRowColumn(rc, (char *)"rc1", NULL, 0);
        lab = XmCreateLabel(rc1, (char *)"Initial guess:", NULL, 0);
        XtManageChild(lab);
        rc2 = XmCreateRowColumn(rc, (char *)"rc2", NULL, 0);
        lab = XmCreateLabel(rc2, (char *)"Computed values:", NULL, 0);
        XtManageChild(lab);

        for (i = 0; i < MAXPARM; i++)
        {
            sprintf(buf, "A%1d: ", i);
            nonl_initial_item[i] = CreateTextItem2(rc1, 15, buf);
        }
        for (i = 0; i < MAXPARM; i++)
        {
            nonl_computed_item[i] = CreateTextItem2(rc2, 15, (char *)"");
        }
        XtManageChild(rc1);
        XtManageChild(rc2);
        XtManageChild(rc);
        XtVaSetValues(sw,
                      XmNworkWindow, rc,
                      NULL);

        rc = XmCreateRowColumn(nonl_panel, (char *)"rc", NULL, 0);
        CreateCommandButtons(rc, 2, but1, label1);
        XtAddCallback(but1[0], XmNactivateCallback,
                      (XtCallbackProc)do_nonl_proc, (XtPointer)NULL);
        /*
         XtAddCallback(but1[1], XmNactivateCallback,
                (XtCallbackProc) create_nonleval_frame, (XtPointer) NULL);
      */
        XtAddCallback(but1[1], XmNactivateCallback,
                      (XtCallbackProc)destroy_dialog, (XtPointer)nonl_frame);
        XtManageChild(rc);

        XtVaSetValues(fr,
                      XmNtopAttachment, XmATTACH_FORM,
                      XmNleftAttachment, XmATTACH_FORM,
                      XmNrightAttachment, XmATTACH_FORM,
                      NULL);
        XtVaSetValues(sw,
                      XmNtopAttachment, XmATTACH_WIDGET,
                      XmNtopWidget, fr,
                      XmNleftAttachment, XmATTACH_FORM,
                      XmNrightAttachment, XmATTACH_FORM,
                      XmNbottomAttachment, XmATTACH_WIDGET,
                      XmNbottomWidget, rc,
                      NULL);
        XtVaSetValues(rc,
                      XmNleftAttachment, XmATTACH_FORM,
                      XmNrightAttachment, XmATTACH_FORM,
                      XmNbottomAttachment, XmATTACH_FORM,
                      NULL);

        XtManageChild(nonl_panel);
    }
    XtRaise(nonl_frame);
    unset_wait_cursor();
}
示例#9
0
/* ARGSUSED */
void create_nonl_frame(Widget w, XtPointer client_data, XtPointer call_data)
{
    int i;
    Widget sw, fr, title_fr, fr1, fr3, rc, rc1, rc2, rc3, lab, fitbut[4], but1[2];
    Widget menubar, menupane, submenupane, cascade;
    set_wait_cursor();
    if (nonl_frame == NULL) {
	char *fitlabel[4];
	char *blabel[2];

	fitlabel[0] = "Load as is";
	fitlabel[1] = "Run 5 steps";
	fitlabel[2] = "Run 20 steps";
	fitlabel[3] = "Run 100 steps";
	
	blabel[0] = "Accept";
	blabel[1] = "Cancel";

	nonl_frame = XmCreateDialogShell(app_shell, "Non-linear curve fitting", NULL, 0);
	handle_close(nonl_frame);
	nonl_panel = XmCreateForm(nonl_frame, "nonl_frame_rc", NULL, 0);

        menubar = CreateMenuBar(nonl_panel, "nonlMenuBar", NULL);
        
        menupane = CreateMenu(menubar, "nonlFileMenu", "File", 'F', NULL, NULL);
        CreateMenuButton(menupane, "open", "Open...", 'O',
            (XtCallbackProc) create_openfit_popup, (XtPointer) NULL, NULL);
        CreateMenuButton(menupane, "save", "Save...", 'S',
            (XtCallbackProc) create_savefit_popup, (XtPointer) NULL, NULL);
        CreateMenuSeparator(menupane, "sep1");
        CreateMenuButton(menupane, "close", "Close", 'C',
    	    (XtCallbackProc) destroy_nonl_frame, (XtPointer) NONL_ACCEPT, NULL);

        menupane = CreateMenu(menubar, "nonlDataMenu", "Data", 'D', NULL, NULL);

        CreateMenuButton(menupane, "reset", "Reset", 'R',
    	    (XtCallbackProc) reset_nonl_frame, (XtPointer) NULL, 0);
        CreateMenuButton(menupane, "update", "Update", 'U',
    	    (XtCallbackProc) update_nonl_frame, (XtPointer) NULL, 0);

        menupane = CreateMenu(menubar, "nonlOptionsMenu", "Options", 'O', NULL, NULL);
   
        submenupane = CreateMenu(menupane, "nonlLoadMenu", 
    				"Load", 'L', NULL, NULL);
    
        nonl_load_item[0] = CreateMenuToggle(submenupane, "values", "Fitted values", 'v',
	    (XtCallbackProc) do_nonl_toggle, (XtPointer) 0, NULL);
        nonl_load_item[1] = CreateMenuToggle(submenupane, "residuals", "Residuals", 'R',
	    (XtCallbackProc) do_nonl_toggle, (XtPointer) 1, NULL);
        nonl_load_item[2] = CreateMenuToggle(submenupane, "function", "Function", 'F',
	    (XtCallbackProc) do_nonl_toggle, (XtPointer) 2, NULL);

        nonl_autol_item = CreateMenuToggle(menupane, "autoload", "Autoload", 'A',
	    (XtCallbackProc) NULL, (XtPointer) NULL, NULL);

        menupane = CreateMenu(menubar, "nonlHelpMenu", "Help", 'H', &cascade, NULL);
        XtVaSetValues(menubar, XmNmenuHelpWidget, cascade, NULL);

        CreateMenuButton(menupane, "onFit", "On fit", 'f',
            (XtCallbackProc) HelpCB, (XtPointer) "trans.html#nlcurve", 0);

        CreateMenuButton(menupane, "onContext", "On context", 'x',
            (XtCallbackProc) ContextHelpCB, (XtPointer) NULL, 0);
        
        XtManageChild(menubar);
	XtVaSetValues(menubar,
		      XmNtopAttachment, XmATTACH_FORM,
		      XmNleftAttachment, XmATTACH_FORM,
		      XmNrightAttachment, XmATTACH_FORM,
		      NULL);
        
        fr1 = XmCreateFrame(nonl_panel, "nonl_frame", NULL, 0);
        nonl_set_item  = CreateSetSelector(fr1, "Apply to set:",
                                    SET_SELECT_ACTIVE,
                                    FILTER_SELECT_NONE,
                                    GRAPH_SELECT_CURRENT,
                                    SELECTION_TYPE_SINGLE);
	
	XtManageChild(fr1);
	XtVaSetValues(fr1,
		      XmNtopAttachment, XmATTACH_WIDGET,
		      XmNtopWidget, menubar,
		      XmNleftAttachment, XmATTACH_FORM,
		      XmNrightAttachment, XmATTACH_FORM,
		      NULL);
		      
	fr = XmCreateFrame(nonl_panel, "nonl_frame", NULL, 0);
	rc = XmCreateRowColumn(fr, "nonl_rc", NULL, 0);
	
	title_fr = XmCreateFrame(rc, "nonl_title_frame", NULL, 0);
	XtVaSetValues(title_fr, XmNshadowType, XmSHADOW_ETCHED_OUT, NULL);
	nonl_title_item = XmCreateLabel(title_fr, nonl_opts.title, NULL, 0);
    	XtManageChild(nonl_title_item);
	XtManageChild(title_fr);
    	
	nonl_formula_item = (Widget) CreateTextItem2(rc, 35, "Formula:");
	rc1 = XmCreateRowColumn(rc, "nonl_rc", NULL, 0);
	XtVaSetValues(rc1, XmNorientation, XmHORIZONTAL, NULL);
	
	nonl_nparm_item = CreatePanelChoice(rc1,
				   "Number of parameters:",
				   12,
				   "0",
				   "1",
				   "2",
				   "3",
				   "4",
				   "5",
				   "6",
				   "7",
				   "8",
				   "9",
				  "10",
				   NULL, NULL);

	for (i = 0; i < MAXPARM + 1; i++) {
	    XtAddCallback(nonl_nparm_item[2 + i], XmNactivateCallback,
			(XtCallbackProc) do_nparm_toggle, (XtPointer) i);
	}
	
	nonl_tol_item = CreateTextItem2(rc1, 10, "Tolerance:");
	
	XtManageChild(rc1);
	
	sw = XtVaCreateManagedWidget("sw",
				     xmScrolledWindowWidgetClass, rc,
				     XmNheight, 180,
				     XmNscrollingPolicy, XmAUTOMATIC,
				     NULL);

	rc2 = XmCreateRowColumn(sw, "rc2", NULL, 0);


	for (i = 0; i < MAXPARM; i++) {
	    nonl_parm_item[i] = XmCreateRowColumn(rc2, "rc1", NULL, 0);
	    XtVaSetValues(nonl_parm_item[i], XmNorientation, XmHORIZONTAL, NULL);
	    sprintf(buf, "A%1d: ", i);
	    nonl_value_item[i] = CreateTextItem2(nonl_parm_item[i], 10, buf);

	    nonl_constr_item[i] = XmCreateToggleButton(nonl_parm_item[i], "Bounds:", NULL, 0);
	    XtAddCallback(nonl_constr_item[i], XmNvalueChangedCallback, 
	    	    	    (XtCallbackProc) do_constr_toggle, (XtPointer) i);
	    XtManageChild(nonl_constr_item[i]);

	    nonl_lowb_item[i] = CreateTextItem2(nonl_parm_item[i], 6, "");
	    
	    sprintf(buf, "< A%1d < ", i);
	    lab = XmCreateLabel(nonl_parm_item[i], buf, NULL, 0);
    	    XtManageChild(lab);

	    nonl_uppb_item[i] = CreateTextItem2(nonl_parm_item[i], 6, "");
	    XtManageChild(nonl_parm_item[i]);
	}

	XtManageChild(rc2);
	XtManageChild(rc);
	XtManageChild(fr);

        XtVaSetValues(fr,
                      XmNtopAttachment, XmATTACH_WIDGET,
                      XmNtopWidget, fr1,
                      XmNleftAttachment, XmATTACH_FORM,
                      XmNrightAttachment, XmATTACH_FORM,
                      NULL);
                      
	fr3 = XmCreateFrame(nonl_panel, "nonl_frame", NULL, 0);
	rc3 = XmCreateRowColumn(fr3, "rc3", NULL, 0);
	
	CreateCommandButtons(rc3, 4, fitbut, fitlabel);
	XtAddCallback(fitbut[0], XmNactivateCallback,
	     		   (XtCallbackProc) do_nonl_proc, (XtPointer)   (0));
	XtAddCallback(fitbut[1], XmNactivateCallback,
	     		   (XtCallbackProc) do_nonl_proc, (XtPointer)   (5));
	XtAddCallback(fitbut[2], XmNactivateCallback,
	     		   (XtCallbackProc) do_nonl_proc, (XtPointer)  (20));	     		   
	XtAddCallback(fitbut[3], XmNactivateCallback,
	     		   (XtCallbackProc) do_nonl_proc, (XtPointer) (100));
	
	XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, rc3, NULL);	
	
	nonl_fload_rc = XmCreateRowColumn(rc3, "nonl_fload_rc", NULL, 0);
	XtVaSetValues(nonl_fload_rc, XmNorientation, XmHORIZONTAL, NULL);
	nonl_start_item = CreateTextItem2(nonl_fload_rc, 6, "Start load at:");
	nonl_stop_item = CreateTextItem2(nonl_fload_rc, 6, "Stop load at:");
	nonl_npts_item = CreateTextItem2(nonl_fload_rc, 4, "# of points:");
	XtManageChild(nonl_fload_rc);
	XtSetSensitive(nonl_fload_rc, False);

	CreateCommandButtons(rc3, 2, but1, blabel);
	XtAddCallback(but1[0], XmNactivateCallback,
		(XtCallbackProc) destroy_nonl_frame, (XtPointer) NONL_ACCEPT);
	XtAddCallback(but1[1], XmNactivateCallback,
		(XtCallbackProc) destroy_nonl_frame, (XtPointer) NONL_CANCEL);

	XtManageChild(rc3);
	XtManageChild(fr3);
	XtVaSetValues(fr3,
	              XmNtopAttachment, XmATTACH_WIDGET,
                      XmNtopWidget, fr,
		      XmNleftAttachment, XmATTACH_FORM,
		      XmNrightAttachment, XmATTACH_FORM,
		      XmNbottomAttachment, XmATTACH_FORM,
		      NULL);

	XtManageChild(nonl_panel);
    }
    update_nonl_frame();
    
    XtRaise(nonl_frame);
    
    unset_wait_cursor();
}
示例#10
0
void create_featext_frame(Widget w, XtPointer client_data, XtPointer call_data)
{
    int x, y, i;
    Widget dialog;
    set_wait_cursor();
    if (feui.top == NULL) {
	char *label2[3];
	label2[0] = "Accept";
	label2[1] = "Close";
	XmGetPos(app_shell, 0, &x, &y);
	feui.top = XmCreateDialogShell(app_shell, "Feature Extraction", NULL, 0);
	handle_close(feui.top);
	XtVaSetValues(feui.top, XmNx, x, XmNy, y, NULL);
	dialog = XmCreateRowColumn(feui.top, "dialog_rc", NULL, 0);

	feui.tograph = CreateGraphChoice(dialog, "Results to graph: ", maxgraph, 1);
	feui.feature_item = CreatePanelChoice0(dialog,
					  "Feature:", 3, 24,
					  "Y minimum", "Y maximum", "Y average", "Y std. dev.",
					  "Y median",
					  "X minimum", "X maximum", "X average", "X std. dev.",
					  "X median",
					  "Frequency", "Period", "Zero crossing", 
					  "Rise time", "Fall time", "Slope", "Y intercept", 
					  "Set length", "Half maximal width", 
					  "Barycenter X", "Barycenter Y", 
					  "X(Y max)", "Y(X max)",
					  NULL, 0);
	feui.xval_item = CreatePanelChoice(dialog,
						"X values from:", 5,
						"Index", "Legends", "X from Set", "Y from set",
						NULL, 0 );
	
	for (i = 0; i < 4; i++) {
	    XtAddCallback(feui.xval_item[2 + i], XmNactivateCallback,
			(XtCallbackProc) do_fext_toggle, (XtPointer) i);
	}
	
	XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, dialog, NULL);

	feui.legload_rc= XmCreateRowColumn(dialog, "fext_legload_rc", NULL, 0);
	
	feui.absic_graph = CreateGraphChoice(feui.legload_rc,
								"Abscissa from graph: ",maxgraph,0);
	for(i=0; i<maxgraph; i++ )
	    XtAddCallback(feui.absic_graph[2 + i], XmNactivateCallback,
			(XtCallbackProc) do_gto_setsel_update, (XtPointer) i);
	
	feui.absic_set = CreateSetSelector(feui.legload_rc, "set:",
					SET_SELECT_ACTIVE,
					FILTER_SELECT_NONE,
					0,
					SELECTION_TYPE_SINGLE);
	update_save_set_list( feui.absic_set, 0 );
	
	XtManageChild(feui.legload_rc);
	XtSetSensitive(feui.legload_rc, False);
	XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, dialog, NULL);

	CreateCommandButtons(dialog, 2, but2, label2);
	XtAddCallback(but2[0], XmNactivateCallback, (XtCallbackProc)
	do_fext_proc,(XtPointer) & feui);
	XtAddCallback(but2[1], XmNactivateCallback,
	(XtCallbackProc)destroy_dialog,(XtPointer)feui.top);

	XtManageChild(dialog);
    }
    XtRaise(feui.top);
    unset_wait_cursor();
}
示例#11
0
文件: hotwin.cpp 项目: nixz/covise
void create_hotlinks_popup(Widget, XtPointer, XtPointer)
{
    int x, y;
    static Widget top, dialog;
    Arg args[3];
    set_wait_cursor();
    if (top == NULL)
    {
        char *label1[5];
        Widget but1[5];
        label1[0] = (char *)"Link";
        label1[1] = (char *)"Files...";
        label1[2] = (char *)"Unlink";
        label1[3] = (char *)"Update";
        label1[4] = (char *)"Close";
        XmGetPos(app_shell, 0, &x, &y);
        top = XmCreateDialogShell(app_shell, (char *)"Hot links", NULL, 0);
        handle_close(top);
        XtVaSetValues(top, XmNx, x, XmNy, y, NULL);
        dialog = XmCreateRowColumn(top, (char *)"dialog_rc", NULL, 0);

        XtSetArg(args[0], XmNlistSizePolicy, XmRESIZE_IF_POSSIBLE);
        XtSetArg(args[1], XmNvisibleItemCount, 5);
        hotlink_list_item = XmCreateScrolledList(dialog, (char *)"list", args, 2);
        XtManageChild(hotlink_list_item);

        hotlink_set_item = CreateSetSelector(dialog, "Link set:",
                                             SET_SELECT_ACTIVE,
                                             FILTER_SELECT_ALL,
                                             GRAPH_SELECT_CURRENT,
                                             SELECTION_TYPE_MULTIPLE);
        DefineSetSelectorFilter(&hotlink_set_item);

        hotlink_file_item = CreateTextItem2(dialog, 30, "To file or pipe:");
        hotlink_source_item = CreatePanelChoice(dialog, "Source: ", 3,
                                                "Disk file",
                                                "Pipe",
                                                NULL,
                                                NULL);

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

        CreateCommandButtons(dialog, 5, but1, label1);
        XtAddCallback(but1[0], XmNactivateCallback, (XtCallbackProc)do_hotlink_proc,
                      (XtPointer)NULL);
        XtAddCallback(but1[1], XmNactivateCallback, (XtCallbackProc)create_hotfiles_popup,
                      (XtPointer)NULL);
        XtAddCallback(but1[2], XmNactivateCallback, (XtCallbackProc)do_hotunlink_proc,
                      (XtPointer)NULL);
        XtAddCallback(but1[3], XmNactivateCallback, (XtCallbackProc)do_hotupdate_proc,
                      (XtPointer)NULL);
        XtAddCallback(but1[4], XmNactivateCallback, (XtCallbackProc)destroy_dialog,
                      (XtPointer)top);

        XtManageChild(dialog);
        hotlink_frame = top;
    }
    XtRaise(top);
    update_hotlinks();
    unset_wait_cursor();
}
示例#12
0
static void do_ticklabels_proc(Widget w, XtPointer client_data, XtPointer call_data)
{
    Widget wlabel, rc;
    int x, y;
    set_wait_cursor();
    if (ticklabel_frame == NULL) {
	char *label1[2];
	label1[0] = "Accept";
	label1[1] = "Close";
	XmGetPos(app_shell, 0, &x, &y);
	ticklabel_frame = XmCreateDialogShell(app_shell, "Tick labels", NULL, 0);
	handle_close(ticklabel_frame);
	XtVaSetValues(ticklabel_frame, XmNx, x, XmNy, y, NULL);
	ticklabel_panel = XmCreateRowColumn(ticklabel_frame, "ticklabel_rc", NULL, 0);

	tlfont = CreatePanelChoice(ticklabel_panel, "Font:",
				   11,
				"Times-Roman", "Times-Bold", "Times-Italic",
				   "Times-BoldItalic", "Helvetica",
				   "Helvetica-Bold", "Helvetica-Oblique",
				 "Helvetica-BoldOblique", "Greek", "Symbol",
				   0,
				   0);

	rc = XmCreateRowColumn(ticklabel_panel, "rc", NULL, 0);
	XtVaSetValues(rc, XmNorientation, XmHORIZONTAL, NULL);
	tlcolor = CreateColorChoice(rc, "Color:", 0);

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

	rc = XmCreateRowColumn(ticklabel_panel, "rc", NULL, 0);
	XtVaSetValues(rc, XmNorientation, XmHORIZONTAL, NULL);
	wlabel = XtVaCreateManagedWidget("Char size:", xmLabelWidgetClass, rc,
					 NULL);
	tlcharsize = XtVaCreateManagedWidget("stringsize", xmScaleWidgetClass, rc,
					     XmNminimum, 0,
					     XmNmaximum, 400,
					     XmNvalue, 0,
					     XmNshowValue, True,
				     XmNprocessingDirection, XmMAX_ON_RIGHT,
					     XmNorientation, XmHORIZONTAL,
					     NULL);
	XtManageChild(rc);
	XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, ticklabel_panel, NULL);

	tlform = CreatePanelChoice0(ticklabel_panel,
				    "Format:", 4,
				    30,
				    "Decimal",
				    "Exponential",
				    "Power",
				    "General",
				    "DD-MM-YY",
				    "MM-DD-YY",
				    "YY-MM-DD",
				    "MM-YY",
				    "MM-DD",
				    "Month-DD",
				    "DD-Month",
				    "Month (abrev.)",
				    "Month (abrev.)-YY",
				    "Month",
				    "Day of week (abrev.)",
				    "Day of week",
				    "Day of year",
				    "HH:MM:SS.s",
				    "MM-DD HH:MM:SS.s",
				    "MM-DD-YY HH:MM:SS.s",
				    "YY-MM-DD HH:MM:SS.s",
				    "Degrees (lon)",
				    "DD MM' (lon)",
				    "DD MM' SS.s\" (lon)",
				    "MM' SS.s\" (lon)",
				    "Degrees (lat)",
				    "DD MM' (lat)",
				    "DD MM' SS.s\" (lat)",
				    "MM' SS.s\" (lat)", 0,
				    0);

	tlprec = CreatePanelChoice(ticklabel_panel, "Precision:",
				   11,
			"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", 0,
				   0);
	tlappstr = CreateTextItem2(ticklabel_panel, 10, "Append to labels:");
	tlprestr = CreateTextItem2(ticklabel_panel, 10, "Prepend to labels:");

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

	tlstagger = CreatePanelChoice(ticklabel_panel, "Stagger labels:",
				      11,
			"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", 0,
				      0);

	tlskip = CreatePanelChoice(ticklabel_panel, "Skip every:",
				   11,
			"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", 0,
				   0);
	XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, ticklabel_panel, NULL);

	rc = XmCreateRowColumn(ticklabel_panel, "rc", NULL, 0);
	XtVaSetValues(rc, XmNorientation, XmHORIZONTAL, NULL);
	tlstarttype = CreatePanelChoice(rc, "Start labels at:",
					3,
					"Graph min", "Specified:", 0,
					0);
	tlstart = XtVaCreateManagedWidget("tlstart", xmTextWidgetClass, rc,
					  XmNtraversalOn, True,
					  XmNcolumns, 10,
					  NULL);
	XtManageChild(rc);

	rc = XmCreateRowColumn(ticklabel_panel, "rc", NULL, 0);
	XtVaSetValues(rc, XmNorientation, XmHORIZONTAL, NULL);
	tlstoptype = CreatePanelChoice(rc, "Stop labels at:",
				       3,
				       "Graph max", "Specified:", 0,
				       0);
	tlstop = XtVaCreateManagedWidget("tlstop", xmTextWidgetClass, rc,
					 XmNtraversalOn, True,
					 XmNcolumns, 10,
					 NULL);
	XtManageChild(rc);

	tlloc = (Widget *) CreatePanelChoice(ticklabel_panel, "Location:",
						3,
						"On ticks",
						"Between ticks",
						NULL,
						NULL);

	rc = XmCreateRowColumn(ticklabel_panel, "rc", NULL, 0);
	XtVaSetValues(rc, XmNorientation, XmHORIZONTAL, NULL);
	tllayout = (Widget *) CreatePanelChoice(rc, "Layout:",
						4,
						"Horizontal",
						"Vertical",
						"Specified (degrees):",
						NULL,
						NULL);
	tlangle = XtVaCreateManagedWidget("ticklangle", xmScaleWidgetClass, rc,
					  XmNminimum, 0,
					  XmNmaximum, 360,
					  XmNvalue, 100,
					  XmNshowValue, True,
					  XmNprocessingDirection, XmMAX_ON_RIGHT,
					  XmNorientation, XmHORIZONTAL,
					  NULL);
	XtManageChild(rc);
	XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, ticklabel_panel, NULL);

	ticklop = CreatePanelChoice(ticklabel_panel, "Draw tick labels on:",
				    4,
				  "Normal side", "Opposite side", "Both", 0,
				    0);

	tlsign = CreatePanelChoice(ticklabel_panel, "Sign of label:",
				   4,
				   "As is", "Absolute value", "Negate",
				   NULL,
				   0);

	ticklabel_applyto = CreatePanelChoice(ticklabel_panel, "Apply to:",
					      5,
					      "Current axis",
					      "All axes, current graph",
					      "Current axis, all graphs",
					      "All axes, all graphs",
					      NULL,
					      0);

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

	CreateCommandButtons(ticklabel_panel, 2, but1, label1);

	XtAddCallback(but1[0], XmNactivateCallback, (XtCallbackProc) accept_ticklabel_proc, (XtPointer) 0);
	XtAddCallback(but1[1], XmNactivateCallback, (XtCallbackProc) destroy_dialog, (XtPointer) ticklabel_frame);

	XtManageChild(ticklabel_panel);
    }
    XtRaise(ticklabel_frame);
    update_ticklabel_items(cg);
    unset_wait_cursor();
}
示例#13
0
static void do_axislabel_proc(Widget w, XtPointer client_data, XtPointer call_data)
{
    Widget wlabel, rc;
    int x, y;
    set_wait_cursor();
    if (axislabel_frame == NULL) {
	char *label1[2];
	label1[0] = "Accept";
	label1[1] = "Close";
	XmGetPos(app_shell, 0, &x, &y);
	axislabel_frame = XmCreateDialogShell(app_shell, "Axis label", NULL, 0);
	handle_close(axislabel_frame);
	XtVaSetValues(axislabel_frame, XmNx, x, XmNy, y, NULL);
	axislabel_panel = XmCreateRowColumn(axislabel_frame, "axislabel_rc", NULL, 0);

	axislabellayout = (Widget *) CreatePanelChoice(axislabel_panel, "Axis layout:",
						       3,
						       "Parallel to axis",
						    "Perpendicular to axis",
						       NULL,
						       NULL);

	axislabelplace = (Widget *) CreatePanelChoice(axislabel_panel, "Axis label location:",
						       3,
						       "Auto",
						    "Specified",
						       NULL,
						       NULL);
	axislabelspec = CreateTextItem2(axislabel_panel, 10, "Location:");

	axislabelfont = CreatePanelChoice(axislabel_panel, "Font:",
					  11,
				"Times-Roman", "Times-Bold", "Times-Italic",
					  "Times-BoldItalic", "Helvetica",
				      "Helvetica-Bold", "Helvetica-Oblique",
				 "Helvetica-BoldOblique", "Greek", "Symbol",
					  0,
					  0);

 
	rc = XmCreateRowColumn(axislabel_panel, "rc", NULL, 0);
	XtVaSetValues(rc, XmNorientation, XmHORIZONTAL, NULL);
	axislabelcolor = CreateColorChoice(rc, "Color:", 0);
	axislabellinew = CreatePanelChoice(rc, "Line width:",
					   10,
			     "1", "2", "3", "4", "5", "6", "7", "8", "9", 0,
					   0);
	XtManageChild(rc);

	wlabel = XtVaCreateManagedWidget("Size:", xmLabelWidgetClass, axislabel_panel,
					 NULL);
	axislabelcharsize = XtVaCreateManagedWidget("stringsize", xmScaleWidgetClass, axislabel_panel,
						    XmNminimum, 0,
						    XmNmaximum, 400,
						    XmNvalue, 100,
						    XmNshowValue, True,
				     XmNprocessingDirection, XmMAX_ON_RIGHT,
					       XmNorientation, XmHORIZONTAL,
						    NULL);

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

	CreateCommandButtons(axislabel_panel, 2, but1, label1);
	XtAddCallback(but1[0], XmNactivateCallback, (XtCallbackProc) accept_axislabel_proc, (XtPointer) 0);
	XtAddCallback(but1[1], XmNactivateCallback, (XtCallbackProc) destroy_dialog, (XtPointer) axislabel_frame);

	XtManageChild(axislabel_panel);
    }
    XtRaise(axislabel_frame);
    update_axislabel_items(cg);
    unset_wait_cursor();
}
示例#14
0
/*
 * Create the ticks popup
 */
void create_ticks_frame(Widget w, XtPointer client_data, XtPointer call_data)
{
    Widget wbut, rc;
    int x, y;
    int i;
    set_wait_cursor();
    if (ticks_frame == NULL) {
	char *label1[2];
	label1[0] = "Accept";
	label1[1] = "Close";
	XmGetPos(app_shell, 0, &x, &y);
	ticks_frame = XmCreateDialogShell(app_shell, "Axes", NULL, 0);
	handle_close(ticks_frame);
	XtVaSetValues(ticks_frame, XmNx, x, XmNy, y, NULL);
	ticks_panel = XmCreateRowColumn(ticks_frame, "ticks_rc", NULL, 0);

	editaxis = (Widget *) CreatePanelChoice(ticks_panel, "Edit:",
						5,
						"X axis",
						"Y axis",
						"Zero X axis",
						"Zero Y axis",
						NULL,
						NULL);
	for (i = 0; i < 4; i++) {
	    XtAddCallback(editaxis[2 + i], XmNactivateCallback, (XtCallbackProc) set_axis_proc, (XtPointer) (intptr_t) i);
	}

	XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, ticks_panel, NULL);
	axislabel = CreateTextItem2(ticks_panel, 30, "Axis label:");
	XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, ticks_panel, NULL);
	tmajor = CreateTextItem2(ticks_panel, 10, "Major tick spacing:");
	tminor = CreateTextItem2(ticks_panel, 10, "Minor tick spacing:");

	XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, ticks_panel, NULL);
	tlonoff = XtVaCreateManagedWidget("Display tick labels",
				     xmToggleButtonWidgetClass, ticks_panel,
					  NULL);
	tonoff = XtVaCreateManagedWidget("Display tick marks",
				     xmToggleButtonWidgetClass, ticks_panel,
					 NULL);
	baronoff = XtVaCreateManagedWidget("Display axis bar",
				     xmToggleButtonWidgetClass, ticks_panel,
					   NULL);

	XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, ticks_panel, NULL);
	rc = XmCreateRowColumn(ticks_panel, "rc", NULL, 0);
	XtVaSetValues(rc, XmNorientation, XmHORIZONTAL, NULL);
	wbut = XtVaCreateManagedWidget("Axis props...", xmPushButtonWidgetClass, rc,
				       NULL);
	XtAddCallback(wbut, XmNactivateCallback, (XtCallbackProc) do_axis_proc, (XtPointer) 0);
	wbut = XtVaCreateManagedWidget("Axis label...", xmPushButtonWidgetClass, rc,
				       NULL);
	XtAddCallback(wbut, XmNactivateCallback, (XtCallbackProc) do_axislabel_proc, (XtPointer) 0);
	wbut = XtVaCreateManagedWidget("Tick labels...", xmPushButtonWidgetClass, rc,
				       NULL);
	XtAddCallback(wbut, XmNactivateCallback, (XtCallbackProc) do_ticklabels_proc, (XtPointer) 0);
	XtManageChild(rc);

	rc = XmCreateRowColumn(ticks_panel, "rc", NULL, 0);
	XtVaSetValues(rc, XmNorientation, XmHORIZONTAL, NULL);
	wbut = XtVaCreateManagedWidget("Tick marks...", xmPushButtonWidgetClass, rc,
				       NULL);
	XtAddCallback(wbut, XmNactivateCallback, (XtCallbackProc) do_tickmarks_proc, (XtPointer) 0);
	wbut = XtVaCreateManagedWidget("Axis bar...", xmPushButtonWidgetClass, rc,
				       NULL);
	XtAddCallback(wbut, XmNactivateCallback, (XtCallbackProc) do_axisbar_proc, (XtPointer) 0);
	wbut = XtVaCreateManagedWidget("User ticks/tick labels...",
				       xmPushButtonWidgetClass, rc,
				       NULL);
	XtAddCallback(wbut, XmNactivateCallback, (XtCallbackProc) do_special_proc, (XtPointer) 0);
	XtManageChild(rc);
	XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, ticks_panel, NULL);
	axis_applyto = (Widget *) CreatePanelChoice(ticks_panel,
						    "Apply to:",
						    5,
						    "Current axis",
						    "All axes, current graph",
						    "Current axis, all graphs",
						    "All axes, all graphs",
						    NULL,
						    NULL);

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

	CreateCommandButtons(ticks_panel, 2, but1, label1);
	XtAddCallback(but1[0], XmNactivateCallback, (XtCallbackProc) ticks_define_notify_proc, (XtPointer) 0);
	XtAddCallback(but1[1], XmNactivateCallback, (XtCallbackProc) destroy_dialog, (XtPointer) ticks_frame);

	XtManageChild(ticks_panel);
    }
    XtRaise(ticks_frame);
    update_ticks(cg);
    unset_wait_cursor();
}
示例#15
0
static void do_tickmarks_proc(Widget w, XtPointer client_data, XtPointer call_data)
{
    Widget wlabel, rc, rc2, rc3, fr;
    int x, y;
    set_wait_cursor();
    if (tickmark_frame == NULL) {
	char *label1[2];
	label1[0] = "Accept";
	label1[1] = "Close";
	XmGetPos(app_shell, 0, &x, &y);
	tickmark_frame = XmCreateDialogShell(app_shell, "Tick marks", NULL, 0);
	handle_close(tickmark_frame);
	XtVaSetValues(tickmark_frame, XmNx, x, XmNy, y, NULL);
	tickmark_panel = XmCreateRowColumn(tickmark_frame, "tickmark_rc", NULL, 0);

	tinout = CreatePanelChoice(tickmark_panel, "Tick marks pointing:",
				   4,
				   "In", "Out", "Both", 0,
				   0);

	tickop = CreatePanelChoice(tickmark_panel, "Draw tick marks on:",
				   4,
			    "Normal side", "Opposite side", "Both sides", 0,
				   0);

	rc2 = XmCreateRowColumn(tickmark_panel, "rc2", NULL, 0);
	XtVaSetValues(rc2, XmNorientation, XmHORIZONTAL, NULL);

/* major tick marks */
	fr = XmCreateFrame(rc2, "fr", NULL, 0);
	rc = XmCreateRowColumn(fr, "rc", NULL, 0);

	tgrid = XtVaCreateManagedWidget("Major ticks grid lines",
					xmToggleButtonWidgetClass, rc,
					NULL);

	rc3 = XmCreateRowColumn(rc, "rc3", NULL, 0);
	wlabel = XtVaCreateManagedWidget("Major tick length:", xmLabelWidgetClass, rc3,
					 NULL);
	tlen = XtVaCreateManagedWidget("ticklength", xmScaleWidgetClass, rc3,
				       XmNminimum, 0,
				       XmNmaximum, 400,
				       XmNvalue, 100,
				       XmNshowValue, True,
				       XmNprocessingDirection, XmMAX_ON_RIGHT,
				       XmNorientation, XmHORIZONTAL,
				       NULL);
	XtManageChild(rc3);

	tgridcol = CreateColorChoice(rc, "Color:", 0);

	tgridlinew = CreatePanelChoice(rc, "Line width:",
				       10,
			     "1", "2", "3", "4", "5", "6", "7", "8", "9", 0,
				       0);
	tgridlines = (Widget *) CreatePanelChoice(rc, "Line style:",
						  6,
						  "Solid line",
						  "Dotted line",
						  "Dashed line",
						  "Long Dashed",
						  "Dot-dashed",
						  NULL,
						  NULL);
	XtManageChild(rc);
	XtManageChild(fr);

	fr = XmCreateFrame(rc2, "fr", NULL, 0);
	rc = XmCreateRowColumn(fr, "rc", NULL, 0);

	tmgrid = XtVaCreateManagedWidget("Minor ticks grid lines", xmToggleButtonWidgetClass, rc,
					 NULL);
	rc3 = XmCreateRowColumn(rc, "rc", NULL, 0);
	wlabel = XtVaCreateManagedWidget("Minor tick length:", xmLabelWidgetClass, rc3,
					 NULL);
	tmlen = XtVaCreateManagedWidget("mticklength", xmScaleWidgetClass, rc3,
					XmNminimum, 0,
					XmNmaximum, 400,
					XmNvalue, 100,
					XmNshowValue, True,
				     XmNprocessingDirection, XmMAX_ON_RIGHT,
					XmNorientation, XmHORIZONTAL,
					NULL);
	XtManageChild(rc3);

	tmgridcol = CreateColorChoice(rc, "Color:", 0);
	tmgridlinew = CreatePanelChoice(rc, "Line width:",
					10,
			     "1", "2", "3", "4", "5", "6", "7", "8", "9", 0,
					0);
	tmgridlines = (Widget *) CreatePanelChoice(rc, "Line style:",
						   6,
						   "Solid line",
						   "Dotted line",
						   "Dashed line",
						   "Long Dashed",
						   "Dot-dashed",
						   NULL,
						   NULL);
	XtManageChild(rc);
	XtManageChild(fr);
	XtManageChild(rc2);

	tick_applyto = CreatePanelChoice(tickmark_panel, "Apply to:",
					 5,
					 "Current axis",
					 "All axes, current graph",
					 "Current axis, all graphs",
					 "All axes, all graphs",
					 NULL,
					 0);

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

	CreateCommandButtons(tickmark_panel, 2, but1, label1);

	XtAddCallback(but1[0], XmNactivateCallback, (XtCallbackProc) accept_tickmark_proc, (XtPointer) 0);
	XtAddCallback(but1[1], XmNactivateCallback, (XtCallbackProc) destroy_dialog, (XtPointer) tickmark_frame);


	XtManageChild(tickmark_panel);
    }
    XtRaise(tickmark_frame);
    update_tickmark_items(cg);
    unset_wait_cursor();
}