This repository was archived by the owner on Aug 31, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed
Toolset/palettes/inspector/behaviors Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -303,6 +303,42 @@ getProp editorExpandVertical
303303 return sExpandVertical
304304end editorExpandVertical
305305
306+ on rawKeyDown pKeyNum
307+ -- allow scroll wheel, pgup, & pgdn to scroll the text field
308+ -- bubble up to the parent if at either limit
309+ if the target contains "field" then
310+ local tScrollPosition , tScrollAmount , tScrollMax
311+ put the vScroll of the target into tScrollPosition
312+ put 0 into tScrollAmount
313+ switch pKeyNum
314+ case "65365"
315+ put 45 into tScrollAmount
316+ -- fall through
317+ case "65309"
318+ if tScrollPosition is 0 then pass rawKeyDown
319+ add 5 to tScrollAmount
320+ put max (0 , tScrollPosition - tScrollAmount ) into tScrollPosition
321+ break
322+ case "65366"
323+ put 45 into tScrollAmount
324+ -- fall through
325+ case "65308"
326+ add 5 to tScrollAmount
327+ put the formattedHeight of the target - \
328+ the height of the target into tScrollMax
329+ if tScrollPosition is tScrollMax then pass rawKeyDown
330+ put min (tScrollMax , tScrollPosition + tScrollAmount ) \
331+ into tScrollPosition
332+ break
333+ default
334+ pass rawKeyDown
335+ end switch
336+ set the vScroll of the target to tScrollPosition
337+ else
338+ pass rawKeyDown
339+ end if
340+ end rawKeyDown
341+
306342after openField
307343 select the text of the target
308344end openField
Original file line number Diff line number Diff line change 1+ # Allow scroll wheel to work in PI text fields
You can’t perform that action at this time.
0 commit comments