Rebol 编程/scroll-para
外观
< Rebol 编程
SCROLL-PARA tf sf
滚动文本界面,给定一个滚动/滑块界面。
SCROLL-PARA 是一个函数值。
- tf -- 要滚动的文本界面 (类型:任何)
- sf -- 滚动界面 (类型:任何)
scroll-para: func [ "Scroll a text face, given a scroller/slider face." tf "Text face to scroll" sf "Scroller face" /local tmp ][ if none? tf/para [exit] tmp: tf/para/margin + tf/para/origin + size-text tf tmp: min 0x0 tf/size - tmp - either tf/edge [2 * tf/edge/size] [0x0] either sf/size/x > sf/size/y [tf/para/scroll/x: sf/data * first tmp] [ tf/para/scroll/y: sf/data * second tmp ] show tf ]