static ArcUI *create_arc_ui(Widget parent, ExplorerUI *eui) { ArcUI *ui; Widget rc, rc1; OptionItem 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 = CreateOptionChoice(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; }
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(); }
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(); }
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; }
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(); }