Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Red [Needs: View]
L: charset "ABCDEFGHI"
N: charset "123456789"
D: union N charset "0"
p: []
repeat y 9 [
repeat x 9 [
col: either x = 1 [#"^(2028)"][#"A" + (x - 2)]
ref: to word! append form col y - 1
header?: (y = 1) or (x = 1)
append p set ref make face! [
size: 90x24
type: pick [text field] header?
offset: -20x10 + as-pair
((x - 1) * size/x + 2)
((y - 1) * size/y + 1)
text: form case [
y = 1 [col]
x = 1 [y - 1]
'else [copy ""]
]
para: make para! [
align: pick [center right] header?
]
extra: object [
name: form ref
formula: old: none
]
actors: context [
on-create: on-unfocus: function [f e][
f/color: none
if rel: f/extra/old [react/unlink rel 'all]
text: copy f/text
f/extra/formula: copy text
if #"=" = f/extra/formula/1 [
if rel: f/extra/old [react/unlink rel 'all]
parse remove text [
any [
p: L N not ["/" skip not N] insert p " " insert "/data "
| L skip
| p: some D opt [dot some D] insert p " " insert " "
| skip
]
]
f/text: rejoin [f/extra/name "/data: any [math/safe [" text {] "#UND"]}]
if f/data [any [react f/extra/old: f/data do f/data]]
]
]
on-focus: func [f e][
f/text: any [f/extra/formula f/text]
f/color: yello
]
]
]
]
]
view make face! [
type: 'window
text: "PicoSheets demo"
size: 840x250
pane: p
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment