check: make rebface [ tip: { USAGE: check "Option" check "Option" data true check "Option" data false DESCRIPTION: Tristate check-box with a green tick for Yes, a red cross for No, and empty being Unknown. Left and right mouse clicks alternate between Yes/No and Unknown respectively. OPTIONS: 'info specifies read-only 'bistate disables right-click state } size: -1x5 text: "" effect: [draw [pen colors/outline-light fill-pen colors/page box 0x0 0x0]] font: default-font para: default-para-indented feel: make default-feel [ p1: as-pair 2 sizes/cell + 2 p2: -4x-4 + p1 + as-pair sizes/cell * 3 sizes/cell * 3 redraw: make function! [face act pos] [ all [ act = 'show clear skip face/effect/draw 7 unless none? face/data [ insert tail face/effect/draw reduce either face/data [ ['pen colors/state-dark 'line-width sizes/cell / 3 'line as-pair 2 sizes/cell * 3 as-pair sizes/cell * 1.5 p2/y as-pair p2/x p1/y] ][ ['pen colors/state-dark 'line-width sizes/cell / 3 'line p1 p2 'line as-pair p2/x p1/y as-pair p1/x p2/y] ] ] ] ] over: make function! [face act pos] [ face/effect/draw/pen: either act [colors/state-dark] [colors/outline-light] show face ] engage: make function! [face act event] [ do select [ down [face/data: either none? face/data [true] [none] face/action/on-click face] alt-down [ unless find face/options 'bistate [ face/data: either none? face/data [false] [none] face/action/on-click face ] ] away [face/feel/over face false 0x0] ] act ] ] rebind: make function! [] [ feel/p1: as-pair 2 sizes/cell + 2 feel/p2: -4x-4 + feel/p1 + as-pair sizes/cell * 3 sizes/cell * 3 ] init: make function! [] [ all [negative? size/x size/x: 10000 size/x: 4 + para/origin/x + first size-text self] effect/draw/6/y: sizes/cell effect/draw/7: as-pair sizes/cell * 3 sizes/cell * 4 ; info option if find options 'info [ feel/redraw self 'show none effect/draw/4: colors/outline-light feel: make default-feel [] ] ] ]