Brian,
I haven't been able to duplicate any mouse activity using ped8
plus your 4 functions.
Are locales an issue? Try removing the local definitions
in the material from ped8?
What are example values leading to the index error (run debug?)
I don't see at a glance why a scrollbar position couldn't be added
to a mouse movement, but ped8 is circa 1998 if I recall, so
I don't claim to remember how it was put together.
Best,
Cliff
Brian Schott wrote:
In a continuing attempt to produce what Cliff is
calling a "mouse editor" I have been adapting Cliff's script
j601/addons/graphics/fvj3/ped8d.ijs and would like help with
the adaptation. The script .../ped8d.ijs currently employs
horizontal and vertical scrollbars to move an image around
and I would like to use the mouse instead. By adding the
following code I have been able to make only a *single*
mouse edit that must be downward and/or to the right. (If I
make an additional mouse edit or an edit that is not
downward and/or to the right, then an index error is thrown
and I can only recover control by doing an edit with the
horizontal/vertical scrollbar.)
The added 4 verbs below attempt to employ
"glcapture 2/0" with "2 {. ". sysdata" to move the image
"glsel 'pic'" by creating a new verb named "updatepic"
which is almost identical to the existing verb "updatebit"
(which is also shown *unaltered* here).
I think the main help I need is in understanding how
to make HP and VP inside updatepic behave like they do in
updatebit, i.e. between 0 and 433. (Actually I am surprised
that HP and VP vary between 0 and 433, instead of between 0
and 400, as I see when I use the debug "Watch Manager" to
observe them.)
**********4 new verbs, 1 old verb below*************
mousepos=: 3 : '2 {. ". sysdata'
paledit_pic_mbldown=:3 : 0
glsel 'pic'
glcapture 2
pos =: mousepos''
updatepic ''
display_pal ''
)
paledit_pic_mblup=:3 : 0
glsel 'pic'
glcapture 0
pos =: pos -~ mousepos''
updatepic ''
display_pal ''
)
updatepic=: 3 : 0
MAG=.".mag
in=.<.((i.%<:)400)*((400%99)*(99-MAG))+(MAG%99)*<:M<.N
HP=.<.(((".horpos)+{.pos)%99)*N->:{:in
VP=.<.(((".verpos)+{:pos)%99)*M->:{:in
bit=: (HP+in){"1 ((M-1)-|.VP+in){bitmap2
)
updatebit=: 3 : 0
MAG=.".mag
in=.<.((i.%<:)400)*((400%99)*(99-MAG))+(MAG%99)*<:M<.N
HP=.<.((".horpos)%99)*N->:{:in
VP=.<.((".verpos)%99)*M->:{:in
bit=: (HP+in){"1 ((M-1)-|.VP+in){bitmap2
)
**********4 new verbs, 1 old verb above*************
On Thu, 26 Apr 2007, Cliff Reiter wrote:
+ Brian,
[snip]
+
+ Not to discourage you, but if you think about how many hours
+ you would need to create your mouse editor, and the equivalent $,
+ you could probably buy a much nicer camera with better movie
+ capabilities. Still, you have a very interesting project going.
+
[snip]
+ Happy movie making,
+ Best,
+ Cliff
+
+ >
+
+ --
+ Clifford A. Reiter
+ Mathematics Department, Lafayette College
+ Easton, PA 18042 USA, 610-330-5277
+ http://www.lafayette.edu/~reiterc
Thank you,
(B=)
Brian Schott
Atlanta, GA, USA
schott DOT bee are eye eh en AT gee em ae eye el DOT com
http://schott.selfip.net/~brian/
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
--
Clifford A. Reiter
Mathematics Department, Lafayette College
Easton, PA 18042 USA, 610-330-5277
http://www.lafayette.edu/~reiterc
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm