Scolling faces
[1/6] from: al::bri::xtra::co::nz at: 15-Dec-2001 9:49
How does one make a scrolling face that responds to the scroll wheel of a
Microsoft mouse? Using Rebol/View desktop and opening a textfile, the editor
comes up and the text can be scrolled up or down. But using Scroll-Panel by
Jeff Kreis doesn't do this.
Andrew Martin
ICQ: 26227169 http://valley.150m.com/
[2/6] from: petr:krenzelok:trz:cz at: 14-Dec-2001 22:16
Andrew Martin wrote:
>How does one make a scrolling face that responds to the scroll wheel of a
>Microsoft mouse? Using Rebol/View desktop and opening a textfile, the editor
<<quoted lines omitted: 3>>
>ICQ: 26227169 http://valley.150m.com/
>-><-
IIRC you need to trap special kind of event inside your engage function
- 'scroll-line and 'scroll-page ... We should not imo specify it
separately - it should be imo incorporated into vid styles natively, or
we will see mixture of reblets with various behaviors ....
-pekr-
[3/6] from: rebol:optushome:au at: 15-Dec-2001 7:44
Hi Andrew,
The two events you need to trap are. scroll-line and scroll-page.
scroll-line detects the mouse scroll
scroll-page is mouse scroll +
Pseudo example below
detect: func [face event][
switch event/type [
scroll-line [do-myscroll event/offset/y * lineheight]
scroll-page [do-myscroll event/offset/y * pageheight]
]
]
The returned value for event/offset/y for scroll-line varies depending on
the mousescroll settings on the persons machine (ie how many lines they set
for mouse scrolling in their mouse software prefs, I have 3 in my prefs)
For most cases the values returned are.(or multiples there of)
for scroll-line
scrolling button forward: -3
scrolling button backward: 3
for scroll-page
scrolling button forward up: -1
scrolling button backward: 1
Cheers,
Allen K
[4/6] from: al:bri:xtra at: 15-Dec-2001 12:15
pekr wrote:
> We should not imo specify it separately - it should be imo incorporated
into vid styles natively, or we will see mixture of reblets with various
behaviors ....
We are all ready getting that mix of behaviour. I've been going through the
RebSites and trying various methods of scrolling. There's a lot of ways that
don't work. For example, keyboard shortcuts don't work, scroll wheel not
working, scroll-bar that are "sticky". It can be very frustrating.
Andrew Martin
Who's not afraid to use a mouse scroll-wheel...
ICQ: 26227169 http://valley.150m.com/
[5/6] from: al:bri:xtra at: 15-Dec-2001 12:16
Thanks, Allen!
How does one switch 'detect functions? The methods I tried (trying to get
arrow keys to work) didn't seem to work for me. Any examples?
Andrew Martin
ICQ: 26227169 http://valley.150m.com/
[6/6] from: petr:krenzelok:trz:cz at: 15-Dec-2001 6:02
Andrew Martin wrote:
>pekr wrote:
>>We should not imo specify it separately - it should be imo incorporated
<<quoted lines omitted: 5>>
>don't work. For example, keyboard shortcuts don't work, scroll wheel not
>working, scroll-bar that are "sticky". It can be very frustrating.
Yes, very frustrating. It should be avoided imo. VID needs to be patched
imo, in the standard distro. I can't accept opinion, stating programmers
are free to do it themselves. If using standard leads to different
behaviors, it should be probably extended to meet most used ones. Let's
see what IOS comes with ...
As fro Allen's suggestiong to use 'detect - is that needed? I would not
probably use detect, as it is called in native level every time any
event occurs to the face, and could slow execution down with heavy gui
stuff imo. But I can be wrong ... Why not to use 'engage?
-pekr-
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted