comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Problems with draw widget scrolling in IDL 5.0
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Problems with draw widget scrolling in IDL 5.0 [message #9759 is a reply to message #9692] Tue, 12 August 1997 00:00 Go to previous messageGo to previous message
Roberto Racca is currently offline  Roberto Racca
Messages: 3
Registered: August 1997
Junior Member
I have modified the small demo app which I originally posted
to include the ability to test the scrolling of the viewport under
software control. As I indicated in that post, the horizontal
scrolling fails to work when one attempts to move the viewport
to the left of its current position by means of set_draw_view.
The vertical scrolling appears to have no such problem, except that
there is a slight inconsistency between the maximum value to which it
can be set in software (y=199 in the demo) and the value to which it
can be 'pushed' manually (y=200), which is also the initial state. To
test the software-controlled scrolling, enter an X and a Y value in the
boxes below the draw widget and click the 'Scroll to:' button.
I have also heard from RSI support: apparently they knew already
about the bugs but missed the boat on 5.0.2. For your information,
the widget works perfectly in the UNIX (Linux) version.

Roberto

-------------- SAMPLE CODE. CUT HERE --------------------------------

pro testdraw_event, event

widget_control, event.top, get_uvalue = widgIDs
Draw = widgIDs(0)
Label = widgIDs(1)
Text1 = widgIDs(2)
Text2 = widgIDs(3)
widget_control, event.id, get_uvalue = tag
case tag of
"EXIT" : begin
widget_control, event.top, /destroy
return
end
"TOGGLE" : begin
erase, !p.background
geometry = widget_info(Draw, /geometry)
if geometry.draw_xsize eq 200 then begin
widget_control, Draw, draw_xsize = 400, draw_ysize = 400
tvscl, dist(400)
endif else begin
widget_control, Draw, draw_xsize = 200, draw_ysize = 200
tvscl, dist(200)
endelse
end
"DRAW" : ; viewport scroll event (do nothing here)
"SCROLL" : begin
widget_control, Text1, get_value = X_text
widget_control, Text2, get_value = Y_text
widget_control, Draw, set_draw_view = [fix(X_text),fix(Y_text)]
end
endcase

; Display the current viewport coordinates
widget_control, Draw, get_draw_view = temp
widget_control, Label, set_value="Viewport at: " + $
strtrim(string(temp(0)),2) + ", " + $
strtrim(string(temp(1)),2)

end


pro testdraw

Base1 = widget_base(title="Test of draw widget", /column)
Base2 = widget_base(Base1, /row)
But1 = widget_button(Base2, value="Toggle size", uvalue="TOGGLE")
But2 = widget_button(Base2, value="Exit", uvalue="EXIT")
Draw = widget_draw(Base1, xsize=200, ysize=200, $
x_scroll_size=200, y_scroll_size=200, $
uvalue="DRAW", /viewport_events)
Label = widget_label(Base1, value="Viewport a: 0, 0", $
/dynamic_resize, /align_left)
Base3 = widget_base(Base1, /row)
But3 = widget_button(Base3, value="Scroll to:", uvalue="SCROLL")
Text1 = widget_text(Base3, xsize=5, ysize=1, uvalue="SCROLL", $
/editable)
Text2 = widget_text(Base3, xsize=5, ysize=1, uvalue="SCROLL", $
/editable)

widget_control, Base1, set_uvalue = [Draw, Label, Text1, Text2]
widget_control, Base1, /realize
loadct, 5
tvscl, dist(200)

xmanager, "testdraw", Base1

end

--------- END OF SAMPLE CODE. CUT HERE ----------------------------

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Roberto Racca, Ph.D.
Vice President for Research and Development
JASCO Research Ltd, Victoria, B.C., CANADA
tel. +1.250.5441187 fax +1.250.5444916
rob@jasco.com http://www.jasco.com
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Efficient comparison of arrays
Next Topic: Arg_Present, XSurface, and Other Assorted Blunders

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 12:44:36 PDT 2025

Total time taken to generate the page: 7.27928 seconds