Exemplo n.º 1
0
ObjectUI *create_object_ui(ExplorerUI *eui)
{    
    ObjectUI *ui;
    Widget tab, fr, rc, rc1;

    ui = xmalloc(sizeof(ObjectUI));

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

    /* ------------ Main tab -------------- */
    ui->main_tp = CreateTabPage(tab, "General");

    fr = CreateFrame(ui->main_tp, "Anchor point");
    rc = CreateHContainer(fr);
    ui->x = CreateText2(rc, "X:", 10);
    AddTextActivateCB(ui->x, text_explorer_cb, eui);
    ui->y = CreateText2(rc, "Y:", 10);
    AddTextActivateCB(ui->y, text_explorer_cb, eui);

    fr = CreateFrame(ui->main_tp, "Placement");
    rc = CreateVContainer(fr);
    rc1 = CreateHContainer(rc);
    ui->offsetx = CreateViewCoordInput(rc1, "dX:");
    AddSpinChoiceCB(ui->offsetx, sp_explorer_cb, eui);
    ui->offsety = CreateViewCoordInput(rc1, "dY:");
    AddSpinChoiceCB(ui->offsety, sp_explorer_cb, eui);
    ui->angle = CreateAngleChoice(rc, "Angle:");
    AddSpinChoiceCB(ui->angle, sp_explorer_cb, eui);

    fr = CreateFrame(ui->main_tp, "Drawing properties");
    rc = CreateVContainer(fr);
    rc1 = CreateHContainer(rc);
    ui->linew = CreateLineWidthChoice(rc1, "Line width:");
    AddSpinChoiceCB(ui->linew, sp_explorer_cb, eui);
    ui->lines = CreateLineStyleChoice(rc1, "Line style:");
    AddOptionChoiceCB(ui->lines, oc_explorer_cb, eui);
    rc1 = CreateHContainer(rc);
    ui->linepen = CreatePenChoice(rc1, "Outline pen:");
    AddPenChoiceCB(ui->linepen, pen_explorer_cb, eui);
    ui->fillpen = CreatePenChoice(rc1, "Fill pen:");
    AddPenChoiceCB(ui->fillpen, pen_explorer_cb, eui);

    /* ------------ Object data tab -------------- */
    ui->odata_tp = CreateTabPage(tab, "Object data");

    ui->line_ui = create_line_ui(ui->odata_tp, eui);
    WidgetUnmanage(ui->line_ui->top);
    ui->box_ui = create_box_ui(ui->odata_tp, eui);
    WidgetUnmanage(ui->box_ui->top);
    ui->arc_ui = create_arc_ui(ui->odata_tp, eui);
    WidgetUnmanage(ui->arc_ui->top);

    SelectTabPage(tab, ui->main_tp);
    
    ui->top = tab;
    
    return ui;
}
Exemplo n.º 2
0
AxisUI *create_axis_ui(ExplorerUI *eui)
{
    AxisUI *ui;
    Widget rc, fr;

    ui = xmalloc(sizeof(AxisUI));

    ui->top = CreateVContainer(eui->scrolled_window);
    AddHelpCB(ui->top, "doc/UsersGuide.html#axis-properties");

    fr = CreateFrame(ui->top, "Position");
    rc = CreateHContainer(fr);
    ui->position = CreateLabelOptionChoiceVA(rc, "Placement:",
        "Normal",   AXIS_POS_NORMAL,
        "Opposite", AXIS_POS_OPPOSITE,
        "Zero",     AXIS_POS_ZERO,
        NULL);
    AddOptionChoiceCB(ui->position, oc_explorer_cb, eui);

    ui->offset = CreateSpinChoice(rc, "Offset:",
        4, SPIN_TYPE_FLOAT, -1.0, 1.0, 0.01);
    AddSpinChoiceCB(ui->offset, sp_explorer_cb, eui);
    
    fr = CreateFrame(ui->top, "Options");
    rc = CreateVContainer(fr);
    ui->draw_bar    = CreateToggleButton(rc, "Draw axis bar");
    AddToggleButtonCB(ui->draw_bar, tb_explorer_cb, eui);
    ui->draw_ticks  = CreateToggleButton(rc, "Draw tick marks");
    AddToggleButtonCB(ui->draw_ticks, tb_explorer_cb, eui);
    ui->draw_labels = CreateToggleButton(rc, "Draw tick labels");
    AddToggleButtonCB(ui->draw_labels, tb_explorer_cb, eui);
    
    return ui;
}
Exemplo n.º 3
0
static void png_gui_setup(const Canvas *canvas, void *data)
{
    PNG_UI_data *ui = (PNG_UI_data *) data;

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

	fr = CreateFrame(ui->frame, "PNG options");
        rc = CreateVContainer(fr);
	ui->interlaced = CreateToggleButton(rc, "Interlaced");
	ui->transparent = CreateToggleButton(rc, "Transparent");
	ui->compression = CreateSpinChoice(rc,
            "Compression:", 1, SPIN_TYPE_INT,
            (double) Z_NO_COMPRESSION, (double) Z_BEST_COMPRESSION, 1.0);

	CreateAACDialog(ui->frame, fr, set_png_setup_proc, ui);
    }
    update_png_setup_frame(ui);
    
    DialogRaise(ui->frame);
    unset_wait_cursor();
}
Exemplo n.º 4
0
static void pnm_gui_setup(const Canvas *canvas, void *data)
{
    PNM_UI_data *ui = (PNM_UI_data *) data;

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

	fr = CreateFrame(ui->frame, "PNM options");
        rc = CreateVContainer(fr);
	ui->format = CreateOptionChoiceVA(rc, "Format: ",
            "1-bit mono (PBM)",      PNM_FORMAT_PBM,
            "8-bit grayscale (PGM)", PNM_FORMAT_PGM,
            "8-bit color (PPM)",     PNM_FORMAT_PPM,
            NULL);
	ui->rawbits = CreateToggleButton(rc, "\"Rawbits\"");

	CreateAACDialog(ui->frame, fr, set_pnm_setup_proc, ui);
    }
    update_pnm_setup_frame(ui);

    DialogRaise(ui->frame);
    unset_wait_cursor();
}
Exemplo n.º 5
0
void hpdf_gui_setup(const Canvas *canvas, void *data)
{
    HPDF_UI_data *ui = (HPDF_UI_data *) data;

    set_wait_cursor();
    
    if (ui->frame == NULL) {
        Widget fr, rc;
        OptionItem colorspace_ops[3] = {
            {HPDF_COLORSPACE_GRAYSCALE, "Grayscale"},
            {HPDF_COLORSPACE_RGB,       "RGB"      },
            {HPDF_COLORSPACE_CMYK,      "CMYK"     }
        };
    
	ui->frame = CreateDialog(app_shell, "hPDF options");

	fr = CreateFrame(ui->frame, "hPDF options");
        rc = CreateVContainer(fr);
        ui->colorspace =
            CreateOptionChoice(rc, "Colorspace:", 1, 3, colorspace_ops);
	ui->compression = CreateToggleButton(rc, "Compression");

	CreateAACDialog(ui->frame, fr, set_hpdf_setup_proc, ui);
    }
    update_hpdf_setup_frame(ui);
    DialogRaise(ui->frame);
    unset_wait_cursor();
}
Exemplo n.º 6
0
static ArcUI *create_arc_ui(Widget parent, ExplorerUI *eui)
{
    ArcUI *ui;
    Widget rc, rc1;
    LabelOptionItem opitems[] = {
        {ARCCLOSURE_CHORD,    "Chord"    },
        {ARCCLOSURE_PIESLICE, "Pie slice"}
    };
    
    ui = xmalloc(sizeof(ArcUI));
    
    ui->top = CreateFrame(parent, "Arc properties");
    rc = CreateVContainer(ui->top);

    ui->width = CreateSpinChoice(rc, "Width: ",
        8, SPIN_TYPE_FLOAT, 0, 10.0, 0.05);
    AddSpinChoiceCB(ui->width, sp_explorer_cb, eui);
    ui->height = CreateSpinChoice(rc, "Height:",
        8, SPIN_TYPE_FLOAT, 0, 10.0, 0.05);
    AddSpinChoiceCB(ui->height, sp_explorer_cb, eui);
    
    ui->angle1 = CreateAngleChoice(rc, "Start angle:");
    AddSpinChoiceCB(ui->angle1, sp_explorer_cb, eui);
    ui->angle2 = CreateAngleChoice(rc, "Extent angle:");
    AddSpinChoiceCB(ui->angle2, sp_explorer_cb, eui);
    
    rc1 = CreateHContainer(rc);
    ui->closure_type = CreateLabelOptionChoice(rc1, "Closure type:", 1, 2, opitems);
    AddOptionChoiceCB(ui->closure_type, oc_explorer_cb, eui);
    ui->draw_closure = CreateToggleButton(rc1, "Draw closure");
    AddToggleButtonCB(ui->draw_closure, tb_explorer_cb, eui);
    
    return ui;
}
Exemplo n.º 7
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();
}
Exemplo n.º 8
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;
}
Exemplo n.º 9
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();
}
Exemplo n.º 10
0
static BoxUI *create_box_ui(Widget parent, ExplorerUI *eui)
{
    BoxUI *ui;
    Widget rc;
    
    ui = xmalloc(sizeof(BoxUI));
    
    ui->top = CreateFrame(parent, "Box properties");
    rc = CreateVContainer(ui->top);
    ui->width = CreateSpinChoice(rc, "Width: ",
        8, SPIN_TYPE_FLOAT, 0, 10.0, 0.05);
    AddSpinChoiceCB(ui->width, sp_explorer_cb, eui);
    ui->height = CreateSpinChoice(rc, "Height:",
        8, SPIN_TYPE_FLOAT, 0, 10.0, 0.05);
    AddSpinChoiceCB(ui->height, sp_explorer_cb, eui);
    
    return ui;
}
Exemplo n.º 11
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();
}
Exemplo n.º 12
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;
}
Exemplo n.º 13
0
void create_datasetop_popup(Widget but, void *data)
{
    Widget dialog, menubar, menupane, rc;

    set_wait_cursor();
    if (datasetopui.top == NULL) {
        
        datasetopui.top = CreateDialogForm(app_shell, "Data set operations");
        SetDialogFormResizable(datasetopui.top, TRUE);

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


        dialog = CreateVContainer(datasetopui.top);
#ifdef MOTIF_GUI
        XtVaSetValues(dialog, XmNrecomputeSize, True, NULL);
#endif

        datasetopui.sel = CreateSSDChoice(dialog,
            "Data sets:", LIST_TYPE_MULTIPLE);

        menupane = CreateMenu(menubar, "File", 'F', FALSE);
        CreateMenuButton(menupane,
            "Close", 'C', destroy_dialog_cb, GetParent(datasetopui.top));

        menupane = CreateMenu(menubar, "Help", 'H', TRUE);
        CreateMenuHelpButton(menupane, "On dataset operations", 's',
            datasetopui.top, "doc/UsersGuide.html#data-set-operations");

        datasetopui.optype_item =
            CreateOptionChoiceVA(dialog, "Operation type:",
            "Reverse",   DATASETOP_REVERSE,
            "Transpose", DATASETOP_TRANSPOSE,
            "Coalesce",  DATASETOP_COALESCE,
#if 0
            "Sort",      DATASETOP_SORT,
            "Split",     DATASETOP_SPLIT,
#endif
            "Drop rows", DATASETOP_DROP,
            NULL);
        AddOptionChoiceCB(datasetopui.optype_item, datasetoptypeCB, NULL);

        rc = CreateHContainer(dialog);
#ifdef MOTIF_GUI
        XtVaSetValues(rc, XmNrecomputeSize, True, NULL);
#endif

        /* Sort */
        datasetopui.up_down_item = CreateOptionChoiceVA(rc, "Order:",
            "Ascending", FALSE,
            "Descending", TRUE,
            NULL);
        datasettype_controls[0] = rc;

        /* Reverse */
        rc = CreateVContainer(dialog);
        CreateSeparator(rc);
        datasettype_controls[1] = rc;

        /* Transpose */
        rc = CreateVContainer(dialog);
        CreateSeparator(rc);
        datasettype_controls[2] = rc;

        /* Coalesce */
        rc = CreateVContainer(dialog);
        CreateSeparator(rc);
        datasettype_controls[3] = rc;

        /* Split */
        rc = CreateVContainer(dialog);
        datasetopui.length_item = CreateTextItem(rc, 6, "Length:");
        datasettype_controls[4] = rc;

        /* Drop rows */
        rc = CreateHContainer(dialog);
        datasetopui.start_item = CreateTextItem(rc, 6, "Start at:");
        datasetopui.stop_item  = CreateTextItem(rc, 6, "Stop at:");
        datasettype_controls[5] = rc;

        UnmanageChild(datasettype_controls[0]);
        ManageChild(datasettype_controls[1]);
        UnmanageChild(datasettype_controls[2]);
        UnmanageChild(datasettype_controls[3]);
        UnmanageChild(datasettype_controls[4]);
        UnmanageChild(datasettype_controls[5]);

        CreateAACDialog(datasetopui.top, dialog, datasetop_aac_cb,
            &datasetopui);
    }
    
    RaiseWindow(GetParent(datasetopui.top));
    
    unset_wait_cursor();
}
Exemplo n.º 14
0
static void ps_gui_setup(const Canvas *canvas, void *data)
{
    PS_UI_data *ui = (PS_UI_data *) data;
    PS_data *ps = ui->ps;
    
    set_wait_cursor();
    
    if (ui->frame == NULL) {
        char *title;
        Widget ps_setup_rc, fr, rc;
        OptionItem colorspace_ops[3] = {
            {PS_COLORSPACE_GRAYSCALE, "Grayscale"},
            {PS_COLORSPACE_RGB,       "RGB"      },
            {PS_COLORSPACE_CMYK,      "CMYK"     }
        };
        OptionItem docdata_ops[3] = {
            {PS_DOCDATA_7BIT,   "7bit"  },
            {PS_DOCDATA_8BIT,   "8bit"  },
            {PS_DOCDATA_BINARY, "Binary"}
        };
        OptionItem ops[3] = {
            {PS_MEDIA_FEED_AUTO,   "Automatic" },
            {PS_MEDIA_FEED_MATCH,  "Match size"},
            {PS_MEDIA_FEED_MANUAL, "Manual"    }
        };
        OptionItem font_ops[4] = {
            {PS_FONT_EMBED_NONE,  "None"               },
            {PS_FONT_EMBED_BUT13, "All but 13 standard"},
            {PS_FONT_EMBED_BUT35, "All but 35 standard"},
            {PS_FONT_EMBED_ALL,   "All"                }
        };
        
        if (ps->format == PS_FORMAT) {
            title = "PS options";
        } else {
            title = "EPS options";
        }
	ui->frame = CreateDialog(app_shell, title);

        ps_setup_rc = CreateVContainer(ui->frame);

	fr = CreateFrame(ps_setup_rc, "PS options");
        rc = CreateVContainer(fr);
	ui->level2 = CreateToggleButton(rc, "PS Level 2");
        ui->colorspace =
            CreateOptionChoice(rc, "Colorspace:", 1, 3, colorspace_ops);
	AddToggleButtonCB(ui->level2,
            colorspace_cb, ui->colorspace);
	ui->docdata =
            CreateOptionChoice(rc, "Document data:", 1, 3, docdata_ops);
	ui->fonts =
            CreateOptionChoice(rc, "Embed fonts:", 1, 4, font_ops);

        if (ps->format == EPS_FORMAT) {
	    ui->printable = CreateToggleButton(rc,
                "Printable as standalone");
        }
        
        if (ps->format == PS_FORMAT) {
	    fr = CreateFrame(ps_setup_rc, "Page offsets (pt)");
            rc = CreateHContainer(fr);
	    ui->offset_x = CreateSpinChoice(rc,
                "X: ", 4, SPIN_TYPE_INT, -999.0, 999.0, 10.0);
	    ui->offset_y = CreateSpinChoice(rc,
                "Y: ", 4, SPIN_TYPE_INT, -999.0, 999.0, 10.0);

	    fr = CreateFrame(ps_setup_rc, "Hardware");
            rc = CreateVContainer(fr);
	    ui->feed = CreateOptionChoice(rc, "Media feed:", 1, 3, ops);
	    ui->hwres = CreateToggleButton(rc, "Set hardware resolution");
        }

	CreateAACDialog(ui->frame, ps_setup_rc, set_ps_setup_proc, ui);
    }
    update_ps_setup_frame(ui);
    
    DialogRaise(ui->frame);
    unset_wait_cursor();
}
Exemplo n.º 15
0
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;
}
Exemplo n.º 16
0
SSDataUI *create_ssd_ui(ExplorerUI *eui)
{
    SSDataUI *ui;

    Widget tab, fr, rc, rc1, wbut;
    
    ui = xmalloc(sizeof(SSDataUI));
    if (!ui) {
        return NULL;
    }
    memset(ui, 0, sizeof(SSDataUI));

    /* ------------ Tabs -------------- */

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

    ui->top = tab;

    /* ------------ Main tab -------------- */
    ui->main_tp = CreateTabPage(tab, "Data");

    ui->mw = CreateTable("SSD", ui->main_tp,
                         EXTRA_SS_ROWS, EXTRA_SS_COLS,
                         VISIBLE_SS_ROWS, VISIBLE_SS_COLS);
    TableSSDInit(ui->mw);
    TableSetDefaultColWidth(ui->mw, CELL_WIDTH);
    TableSetDefaultColLabelAlignment(ui->mw, ALIGN_CENTER);

    AddTableDrawCellCB(ui->mw, drawcellCB, ui);
    AddTableLeaveCellCB(ui->mw, leaveCB, ui);
    AddTableEnterCellCB(ui->mw, enterCB, ui);
    AddTableLabelActivateCB(ui->mw, labelCB, ui);

    ui->popup = CreatePopupMenu(ui->mw);
    ui->delete_btn  = CreateMenuButton(ui->popup, "Delete column", '\0', col_delete_cb, ui);
    ui->index_btn   = CreateMenuButton(ui->popup, "Set as index", '\0', index_cb, ui);
    ui->unindex_btn = CreateMenuButton(ui->popup, "Unset index", '\0', unindex_cb, ui);


    /* ------------ Column props -------------- */
    ui->column_tp = CreateTabPage(tab, "Columns");
    ui->col_sel = CreateColChoice(ui->column_tp, "Column:", LIST_TYPE_SINGLE);
    AddListChoiceCB(ui->col_sel, col_cb, ui);

    ui->col_label = CreateCSText(ui->column_tp, "Label:");
    SetSensitive(ui->col_label->text, FALSE);
    AddTextInputCB(ui->col_label, text_explorer_cb, eui);

    
    /* ------------ Hotlink tab -------------- */
    ui->hotlink_tp = CreateTabPage(tab, "Hotlink");

    fr = CreateFrame(ui->hotlink_tp, "Hotlink");
    rc = CreateVContainer(fr);
    rc1 = CreateHContainer(rc);
    ui->hotlink = CreateToggleButton(rc1, "Enabled");
    ui->hotsrc  = CreateOptionChoiceVA(rc1, "Source type:",
        "Disk", SOURCE_DISK,
        "Pipe", SOURCE_PIPE,
        NULL);
    rc1 = CreateHContainer(rc);
    ui->hotfile = CreateTextItem(rc1, 20, "File name:");
    wbut = CreateButton(rc1, "Browse...");
    AddButtonCB(wbut, create_hotfiles_popup, ui);

    return ui;
}
Exemplo n.º 17
0
void raise_explorer(GUI *gui, Quark *q)
{
    GraceApp *gapp = gui->P;

    set_wait_cursor();
    
    if (!gui->eui) {
        ExplorerUI *eui;
        Widget menubar, menupane, panel, form, fr;

        eui = xmalloc(sizeof(ExplorerUI));
        gui->eui = eui;

        eui->a_icon = XpmToPixmap(active_xpm);
        eui->h_icon = XpmToPixmap(hidden_xpm);

        eui->top = CreateDialog(app_shell, "Explorer");
        menubar = CreateMenuBar(eui->top);
        WidgetManage(menubar);
        FormAddVChild(eui->top, menubar);

        menupane = CreateMenu(menubar, "File", 'F', FALSE);
        CreateMenuButtonA(menupane, "Close", 'C', "<Key>Escape", "Esc", destroy_dialog_cb, eui->top);

        menupane = CreateMenu(menubar, "Edit", 'E', FALSE);
        eui->edit_undo_bt = CreateMenuButtonA(menupane, "Undo", 'U', "Ctrl<Key>z", "Ctrl+Z",
            undo_cb, gapp);
        eui->edit_redo_bt = CreateMenuButtonA(menupane, "Redo", 'R', "Ctrl Shift<Key>z", "Ctrl+Shift+Z",
            redo_cb, gapp);

        menupane = CreateMenu(menubar, "Insert", 'I', FALSE);
        eui->insert_frame_bt = CreateMenuButton(menupane,
            "Frame", '\0', add_frame_cb, eui);
        WidgetSetSensitive(eui->insert_frame_bt,  FALSE);
        eui->insert_graph_bt = CreateMenuButton(menupane,
            "Graph", '\0', add_graph_cb, eui);
        WidgetSetSensitive(eui->insert_graph_bt,  FALSE);
        eui->insert_ssd_bt = CreateMenuButton(menupane,
            "SSData", '\0', add_ssd_cb, eui);
        WidgetSetSensitive(eui->insert_ssd_bt,    FALSE);
        eui->insert_set_bt = CreateMenuButton(menupane,
            "Set", '\0', add_set_cb, eui);
        WidgetSetSensitive(eui->insert_set_bt,    FALSE);
        eui->insert_axisgrid_bt = CreateMenuButton(menupane,
            "Axis grid", '\0', add_axisgrid_cb, eui);
        WidgetSetSensitive(eui->insert_axisgrid_bt,   FALSE);
        eui->insert_axis_bt = CreateMenuButton(menupane,
            "Axis", '\0', add_axis_cb, eui);
        WidgetSetSensitive(eui->insert_axis_bt,   FALSE);
        eui->insert_object_pane = CreateMenu(menupane, "Annotating objects", 'o', FALSE);
        WidgetSetSensitive(eui->insert_object_pane, FALSE);
        eui->insert_text_bt = CreateMenuButton(eui->insert_object_pane,
            "Text", '\0', add_object_cb, eui);
        eui->insert_line_bt = CreateMenuButton(eui->insert_object_pane,
            "Line", '\0', add_object_cb, eui);
        eui->insert_box_bt = CreateMenuButton(eui->insert_object_pane,
            "Box", '\0', add_object_cb, eui);
        eui->insert_arc_bt = CreateMenuButton(eui->insert_object_pane,
            "Arc", '\0', add_object_cb, eui);

        menupane = CreateMenu(menubar, "Options", 'O', FALSE);
        eui->instantupdate = CreateMenuToggle(menupane, "Instantaneous update",
                            'u', NULL, NULL);
        ToggleButtonSetState(eui->instantupdate, gui->instant_update);

        menupane = CreateMenu(menubar, "Help", 'H', TRUE);
        CreateMenuHelpButton(menupane, "On explorer", 'e',
            eui->top, "doc/UsersGuide.html#explorer");

        panel = CreatePanedWindow(eui->top);

        form = CreateForm(panel);
        PlaceGridChild(panel, form, 0, 0); /* in case if CreatePanedWindow creates a grid */

        eui->tree = CreateTree(form);
        AddTreeHighlightItemsCB(eui->tree, highlight_cb, eui);
        AddTreeContextMenuCB(eui->tree, menu_cb, eui);
        AddTreeDropItemsCB(eui->tree, drop_cb, eui);
        FormAddVChild(form, eui->tree);

        fr = CreateFrame(form, NULL);
        eui->idstr = CreateText(fr, "ID string:");
        AddTextActivateCB(eui->idstr, text_explorer_cb, eui);
        FormAddVChild(form, fr);
        FormFixateVChild(fr);
        
        eui->scrolled_window = CreateScrolledWindow(panel);
        PlaceGridChild(panel, eui->scrolled_window, 1, 0); /* in case if CreatePanedWindow creates a grid */

        PanedWindowSetMinWidth(form, 150);
        WidgetSetWidth(form, 250);

        WidgetManage(form);

#ifdef HAVE_LESSTIF
# if !defined(SF_BUG_993209_FIXED) && !defined(SF_BUG_993209_NOT_FIXED)
#  error "You should check whether SF bug #993209 is fixed in your version of LessTif."
#  error "Then define either SF_BUG_993209_FIXED or SF_BUG_993209_NOT_FIXED, accordingly."
#  error "See http://sourceforge.net/tracker/index.php?func=detail&aid=993209&group_id=8596&atid=108596."
# endif
# ifdef SF_BUG_993209_NOT_FIXED
        /* A dirty workaround */
        eui->scrolled_window = CreateVContainer(eui->scrolled_window);
# endif
#endif

        eui->project_ui = create_project_ui(eui);
        WidgetUnmanage(eui->project_ui->top);

	eui->ssd_ui = create_ssd_ui(eui);
        WidgetUnmanage(eui->ssd_ui->top);

	eui->frame_ui = create_frame_ui(eui);
        WidgetUnmanage(eui->frame_ui->top);

	eui->graph_ui = create_graph_ui(eui);
        WidgetUnmanage(eui->graph_ui->top);

	eui->set_ui = create_set_ui(eui);
        WidgetUnmanage(eui->set_ui->top);

	eui->axisgrid_ui = create_axisgrid_ui(eui);
        WidgetUnmanage(eui->axisgrid_ui->top);

	eui->axis_ui = create_axis_ui(eui);
        WidgetUnmanage(eui->axis_ui->top);

	eui->object_ui = create_object_ui(eui);
        WidgetUnmanage(eui->object_ui->top);

	eui->atext_ui = create_atext_ui(eui);
        WidgetUnmanage(eui->atext_ui->top);

	eui->region_ui = create_region_ui(eui);
        WidgetUnmanage(eui->region_ui->top);

        eui->aacbuts = CreateAACDialog(eui->top, panel, explorer_aac, eui);

        WidgetManage(eui->tree);

        /* Menu popup */
        eui->popup = CreatePopupMenu(eui->tree);
        eui->popup_hide_bt = CreateMenuButton(eui->popup,
            "Hide", '\0', hide_cb, eui);
        eui->popup_show_bt = CreateMenuButton(eui->popup,
            "Show", '\0', show_cb, eui);

        CreateMenuSeparator(eui->popup);

        eui->popup_delete_bt = CreateMenuButton(eui->popup,
            "Delete", '\0', delete_cb, eui);
        eui->popup_duplicate_bt = CreateMenuButton(eui->popup,
            "Duplicate", '\0', duplicate_cb, eui);

        /* Project menu popup */
        eui->project_popup = CreatePopupMenu(eui->tree);
        eui->project_popup_show_bt = CreateMenuButton(eui->project_popup,
            "Show", '\0', project_show_cb, eui);

        CreateMenuSeparator(eui->project_popup);

        eui->project_popup_save_bt = CreateMenuButton(eui->project_popup,
            "Save", '\0', project_save_cb, eui);
        eui->project_popup_save_as_bt = CreateMenuButton(eui->project_popup,
            "Save as...", '\0', project_save_as_cb, eui);
        eui->project_popup_revert_to_saved_bt = CreateMenuButton(eui->project_popup,
            "Revert to saved", '\0', project_revert_to_saved_cb, eui);

        CreateMenuSeparator(eui->project_popup);

        eui->project_popup_close_bt = CreateMenuButton(eui->project_popup,
            "Close", '\0', project_close_cb, eui);

        init_quark_tree(eui);

        if (!q && gapp->gp) {
            select_quark_explorer(gproject_get_top(gapp->gp));
        }
    }
#ifdef QT_GUI
    /* TODO: use resources */
    WidgetSetSize(gui->eui->top, 650, 600);
#endif
    DialogRaise(gui->eui->top);
    
    if (q) {
        select_quark_explorer(q);
    }

    update_undo_buttons(gapp->gp);

    unset_wait_cursor();
}
Exemplo n.º 18
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;
}
Exemplo n.º 19
0
GraphUI *create_graph_ui(ExplorerUI *eui)
{
    GraphUI *ui;
    Widget tab, fr, rc, rc1;

    OptionItem opitems[4] = {
        {SCALE_NORMAL, "Linear"     },
        {SCALE_LOG,    "Logarithmic"},
        {SCALE_REC,    "Reciprocal" },
        {SCALE_LOGIT,  "Logit"      }
    };
    
    ui = xmalloc(sizeof(GraphUI));

    /* ------------ Tabs -------------- */

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


    /* ------------ Main tab -------------- */

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

    fr = CreateFrame(ui->main_tp, "Presentation");
    rc1 = CreateVContainer(fr);

    rc = CreateHContainer(rc1);
    ui->graph_type = CreateOptionChoiceVA(rc, "Type:",
        "XY graph",          GRAPH_XY,
        "XY chart",          GRAPH_CHART,
        "Polar graph",       GRAPH_POLAR,
        "Smith chart (N/I)", GRAPH_SMITH,
        "Fixed",             GRAPH_FIXED,
        "Pie chart",         GRAPH_PIE,
        NULL);
    AddOptionChoiceCB(ui->graph_type, oc_explorer_cb, eui);
    ui->stacked = CreateToggleButton(rc, "Stacked chart");
    AddToggleButtonCB(ui->stacked, tb_explorer_cb, eui);

    rc = CreateHContainer(rc1);
    ui->flip_xy = CreateToggleButton(rc, "Flip XY (N/I)");
    AddToggleButtonCB(ui->flip_xy, tb_explorer_cb, eui);


    fr = CreateFrame(ui->main_tp, "X axis");
    rc1 = CreateVContainer(fr);
    
    rc = CreateHContainer(rc1);
    ui->start_x = CreateTextItem(rc, 10, "Start:");
    AddTextItemCB(ui->start_x, titem_explorer_cb, eui);
    ui->stop_x = CreateTextItem(rc, 10, "Stop:");
    AddTextItemCB(ui->stop_x, titem_explorer_cb, eui);

    rc = CreateHContainer(rc1);
    ui->scale_x = CreateOptionChoice(rc, "Scale:", 0, 4, opitems);
    AddOptionChoiceCB(ui->scale_x, axis_scale_cb, eui);
    AddOptionChoiceCB(ui->scale_x, oc_explorer_cb, eui);

    ui->invert_x = CreateToggleButton(rc, "Invert axis");
    AddToggleButtonCB(ui->invert_x, tb_explorer_cb, eui);
        
    fr = CreateFrame(ui->main_tp, "Y axis");
    rc1 = CreateVContainer(fr);
    
    rc = CreateHContainer(rc1);
    ui->start_y = CreateTextItem(rc, 10, "Start:");
    AddTextItemCB(ui->start_y, titem_explorer_cb, eui);
    ui->stop_y = CreateTextItem(rc, 10, "Stop:");
    AddTextItemCB(ui->stop_y, titem_explorer_cb, eui);

    rc = CreateHContainer(rc1);
    ui->scale_y = CreateOptionChoice(rc, "Scale:", 0, 4, opitems);
    AddOptionChoiceCB(ui->scale_y, axis_scale_cb, eui);
    AddOptionChoiceCB(ui->scale_y, oc_explorer_cb, eui);

    ui->invert_y = CreateToggleButton(rc, "Invert axis");
    AddToggleButtonCB(ui->invert_y, tb_explorer_cb, eui);

    fr = CreateFrame(ui->main_tp, "2D+ graphs");
    ui->znorm = CreateTextItem(fr, 10, "Z normalization");
    AddTextItemCB(ui->znorm, titem_explorer_cb, eui); 

    fr = CreateFrame(ui->main_tp, "XY charts");
    ui->bargap = CreateSpinChoice(fr, "Bar gap:", 5,
        SPIN_TYPE_FLOAT, -1.0, 1.0, 0.005);
    AddSpinChoiceCB(ui->bargap, sp_explorer_cb, eui);


    /* ------------ Locator tab -------------- */

    ui->locator_tp = CreateTabPage(tab, "Locator");
    ui->loc_type = CreateOptionChoiceVA(ui->locator_tp,
        "Locator display type:",
	"None",       GLOCATOR_TYPE_NONE,
	"[X, Y]",     GLOCATOR_TYPE_XY,
	"[Phi, Rho]", GLOCATOR_TYPE_POLAR,
	NULL);
    AddOptionChoiceCB(ui->loc_type, oc_explorer_cb, eui);

    fr = CreateFrame(ui->locator_tp, "X format");
    ui->loc_fx = CreateFormatChoice(fr);
    AddFormatChoiceCB(ui->loc_fx, format_explorer_cb, eui);
    
    fr = CreateFrame(ui->locator_tp, "Y format");
    ui->loc_fy = CreateFormatChoice(fr);
    AddFormatChoiceCB(ui->loc_fy, format_explorer_cb, eui);

    fr = CreateFrame(ui->locator_tp, "Fixed point");
    rc = CreateVContainer(fr);
    ui->fixedp = CreateToggleButton(rc, "Enable");
    AddToggleButtonCB(ui->fixedp, tb_explorer_cb, eui);
    rc1 = CreateHContainer(rc);
    ui->locx = CreateTextItem(rc1, 10, "X:");
    AddTextItemCB(ui->locx, titem_explorer_cb, eui);
    ui->locy = CreateTextItem(rc1, 10, "Y:");
    AddTextItemCB(ui->locy, titem_explorer_cb, eui);


    SelectTabPage(tab, ui->main_tp);

    ui->top = tab;
    
    return ui;
}