示例#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
RegionUI *create_region_ui(ExplorerUI *eui)
{
    RegionUI *ui;
    Widget form;

    form = CreateVContainer(eui->scrolled_window);
    AddHelpCB(form, "doc/UsersGuide.html#region-properties");
    
    ui = xmalloc(sizeof(RegionUI));

    ui->top = form;
    
    ui->type = CreateLabelOptionChoiceVA(form, "Type:",
        "Polygon", REGION_POLYGON,
        "Band",    REGION_BAND,
        /* "Formula", REGION_FORMULA, */
        NULL);
    AddOptionChoiceCB(ui->type, oc_explorer_cb, eui);

    ui->color = CreateColorChoice(form, "Color:");
    AddOptionChoiceCB(ui->color, oc_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
ProjectUI *create_project_ui(ExplorerUI *eui)
{
    ProjectUI *ui;
    Widget form, fr, rc, rc1;

    form = CreateVContainer(eui->scrolled_window);
    AddHelpCB(form, "doc/UsersGuide.html#project-properties");
    
    ui = xmalloc(sizeof(ProjectUI));
    ui->current_page_units = PAGE_UNITS_PP;

    fr = CreateFrame(form, "Project description");
    ui->description  = CreateScrolledText(fr, "", 5);
    AddTextActivateCB(ui->description, text_explorer_cb, eui);

    fr = CreateFrame(form, "Page dimensions");
    rc1 = CreateVContainer(fr);

    rc = CreateHContainer(rc1);
    ui->page_orient = CreatePaperOrientationChoice(rc, "Orientation:");
    AddOptionChoiceCB(ui->page_orient, do_orient_toggle, ui);
    AddOptionChoiceCB(ui->page_orient, oc_explorer_cb, eui);

    ui->page_format = CreatePaperFormatChoice(rc, "Size:");
    AddOptionChoiceCB(ui->page_format, do_format_toggle, ui);
    AddOptionChoiceCB(ui->page_format, oc_explorer_cb, eui);

    rc = CreateHContainer(rc1);
    ui->page_x = CreateText2(rc, "Dimensions:", 7);
    AddTextActivateCB(ui->page_x, text_explorer_cb, eui);
    ui->page_y = CreateText2(rc, "x ", 7);
    AddTextActivateCB(ui->page_y, text_explorer_cb, eui);
    ui->page_size_unit = CreateOptionChoiceVA(rc, " ",
        "pp", PAGE_UNITS_PP,
        "in", PAGE_UNITS_IN,
        "cm", PAGE_UNITS_CM,
        NULL);
    SetOptionChoice(ui->page_size_unit, ui->current_page_units);
    AddOptionChoiceCB(ui->page_size_unit, do_units_toggle, ui);

    
    fr = CreateFrame(form, "Page background");
    FormAddVChild(form, fr);
    rc = CreateHContainer(fr);
    ui->bg_color = CreateColorChoice(rc, "Color:");
    AddOptionChoiceCB(ui->bg_color, oc_explorer_cb, eui);
    ui->bg_fill = CreateToggleButton(rc, "Fill");
    AddToggleButtonCB(ui->bg_fill, tb_explorer_cb, eui);

    fr = CreateFrame(form, "Scaling factors");
    FormAddVChild(form, fr);
    rc = CreateVContainer(fr);
    ui->fsize_scale = CreateSpinChoice(rc, "Font size:", 5,
        SPIN_TYPE_FLOAT, 0.0, 1.0, 0.005);
    AddSpinChoiceCB(ui->fsize_scale, sp_explorer_cb, eui);
    ui->lwidth_scale = CreateSpinChoice(rc, "Line width:", 6,
        SPIN_TYPE_FLOAT, 0.0, 1.0, 0.0005);
    AddSpinChoiceCB(ui->lwidth_scale, sp_explorer_cb, eui);

    fr = CreateFrame(form, "Data & Dates");
    rc1 = CreateVContainer(fr);
    ui->prec = CreateSpinChoice(rc1, "Data precision:", 3,
        SPIN_TYPE_INT, DATA_PREC_MIN, DATA_PREC_MAX, 1);
    AddSpinChoiceCB(ui->prec, sp_explorer_cb, eui);
    ui->refdate = CreateText2(rc1, "Reference date:", 20);
    AddTextActivateCB(ui->refdate, text_explorer_cb, eui);
    rc = CreateHContainer(rc1);
    ui->two_digits_years = CreateToggleButton(rc, "Two-digit year span");
    AddToggleButtonCB(ui->two_digits_years, tb_explorer_cb, eui);
    ui->wrap_year = CreateText2(rc, "Wrap year:", 4);
    AddTextActivateCB(ui->wrap_year, text_explorer_cb, eui);
    AddToggleButtonCB(ui->two_digits_years, wrap_year_cb, ui->wrap_year);
    
    ui->top = form;
    
    return ui;
}
示例#5
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();
}
示例#6
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();
}
示例#7
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();
}
示例#8
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();
}