[REBOL] Re: RFC: Forms generator / RAD dialect
From: atruter:hih:au at: 21-Aug-2002 10:08
<SNIP>
But I hate repetitive tasks, especially creating very
basic GUI forms. So why not use Rebol for this?
Thing like this shouldn't be written by hand:
lab "Company" company: fld return
</SNIP>
I agree, but isn't the answer just to make better use of styles. eg.
<CODE>
to-width: func [x] [
75 + 8 * x - 8
]
stylize/master [
; VID types
lbl: lbl blue to-width 1
field: field to-width 1
date-field: field [
if not empty? face/text [
either none? attempt [to-date face/text] [
clear face/text
][
face/text: form to-date face/text
show face
]
]
]
; Derived types
lab-address: lbl "Address:"
fld-address: field to-width 3
lab-date: lbl "Date:"
fld-date: date-field
lab-code: lbl "Code:"
fld-code: field
]
view layout [
across lab-address fld-address
return lab-date fld-date
lab-code fld-code
]
</CODE>
Defining things in this manner means we can easily make global changes to
both VID types and our derived types. I believe this approach is more
efficient than trying to create a dialect that is used to essentially
achieve the same result, but feel free to point out the flaws in my logic /
approach. ;)
Regards,
Ashley