root/widgets/arrow.r

Revision 112, 1.0 kB (checked in by ashley, 8 months ago)

Added pill.r
Scroller fixes
Major color / theme management changes (in progress)

Line 
1 arrow: make rebface [
2         tip:    {
3                 USAGE:
4                         arrow
5                         arrow 10
6                         arrow data 'up
7                         arrow data 'down
8                         arrow data 'left
9                         arrow data 'right
10
11                 DESCRIPTION:
12                         An arrow (default down) on a square button face with height set to width.
13         }
14         size:   5x-1
15         data:   'down
16         feel:   make default-feel [
17                 redraw: make function! [face act pos] [
18                         all [act = 'show face/color: either face/data [colors/state-light] [colors/theme-light]]
19                 ]
20                 engage: make function! [face act event] [
21                         do select [
22                                 time    [all [face/data face/action/on-click face]]
23                                 down    [face/data: on]
24                                 up              [face/data: off face/action/on-click face]
25                                 over    [face/data: on]
26                                 away    [face/data: off]
27                         ] act
28                         show face
29                 ]
30         ]
31         effect: reduce ['arrow colors/page 'rotate 0]
32         rebind: make function! [] [effect/arrow: colors/page]
33         init:   make function! [] [
34                 all [negative? size/y size/y: size/x]
35                 effect/rotate: select [up 0 right 90 down 180 left 270] data
36                 data: off ; redefine data
37         ]
38 ]
Note: See TracBrowser for help on using the browser.