;+ ; HARDOPTS ; Set hardcopy options ; ; Usage ; hardopts, h ; Not intended for direct user usage ; ; Arguments: ; h struct in/out The hardcopy options. ; leader long input Group leader of the widget ; ; History: ; Original: 3/8/95; SJT ; Add timer event to push to front if obscured: 23/8/95; SJT ;- function Hopts_event, event widget_control, event.id, get_uvalue = but widget_control, event.handler, get_uvalue = settings, /no_copy iexit = 0 case but of 'COL': settings.opts.colour = event.value 'EPS': settings.opts.eps = event.value 'ORI': settings.opts.orient = event.value 'XSI': begin widget_control, event.id, get_value = sx settings.opts.size(0) = sx/10. end 'YSI': begin widget_control, event.id, get_value = sy settings.opts.size(1) = sy/10. end 'TIMEST': settings.opts.timestamp = event.value 'POP': begin widget_control, event.top, /show widget_control, event.id, timer = 2. end 'ACTION': begin iexit = event.value if (iexit eq 1) then for j = 0, 1 do begin widget_control, settings.cmid(j), get_value = cmd settings.opts.action(j) = cmd(0) endfor end Else: endcase widget_control, settings.spbase, sensitive = (settings.opts.eps ne 1) widget_control, event.handler, set_uvalue = settings, /no_copy return, {id:event.id, top:event.top, handler:event.handler, exited:iexit} end function Hardopts, h, leader, tname uvs = {opts:h, $ Cmid:lonarr(2), $ Spbase:0l} widget_control, leader, sensitive = 0 tlb = widget_base(title = 'Graffer Hard Copy', group_leader = leader) base = widget_base(tlb, /column) ; Basic toggle settings jb = widget_base(base, /row) junk = cw_bbselector(jb, ['Monochrome', 'Colour'], uvalue = $ 'COL', set_value = h.colour) junk = cw_bbselector(jb, ['Normal', 'Encapsulated'], uvalue = $ 'EPS', set_value = h.eps) junk = cw_bbselector(jb, ['Landscape', 'Portrait'], uvalue = $ 'ORI', set_value = h.orient) ; Page size cl = widget_base(base, /column, uvalue = 'POP') junk = widget_slider(cl, min = 0, max = 300, value = $ fix(10*h.size(0)), uvalue = 'XSI', title = $ 'X-size (mm)', xsize = 300) junk = widget_slider(cl, min = 0, max = 300, value = $ fix(10*h.size(1)), uvalue = 'YSI', title = $ 'Y-size (mm)', xsize = 300) ; Spool command uvs.spbase = widget_base(base, /column) jb = widget_base(uvs.spbase, /row) uvs.cmid(0) = graff_enter(jb, label = 'Spool Command:', value = $ h.action(0), uvalue = 'CMD', xsize = 12) uvs.cmid(1) = graff_enter(jb, value = h.action(1), uvalue = $ 'SFX', xsize = 8, label = tname+'.ps') junk = cw_bbselector(uvs.spbase, ['Off', 'On'], label_left = "Plot " + $ "timestamp", set_value = h.timestamp, uvalue = $ 'TIMEST') widget_control, uvs.spbase, sensitive = (h.eps ne 1) ; Quit button junk = cw_bgroup(base, ['Done', 'Cancel'], uvalue = 'ACTION', $ button_uvalue = [1, -1], /row) widget_control, base, set_uvalue = uvs, /no_copy widget_control, tlb, /real ; RYO widget management to allow us to get the values back from ; the event handler without using a common block, even after the ; hierarchy has been destroyed. widget_control, base, event_func = 'hopts_event' widget_control, cl, timer = 2. repeat begin ev = widget_event(base) endrep until (ev.exited ne 0) widget_control, base, get_uvalue = uvs, /no_copy h = uvs.opts widget_control, tlb, /destroy widget_control, leader, /sensitive return, ev.exited end