[NTG-context] radiobuttons and other widgets

Henning Hraban Ramm texml at fiee.net
Mon Aug 5 17:07:59 CEST 2019


This is a feature request or wish:

I would be glad to have a module (e.g. "fakefields") as a drop-in replacement that overwrites the field commands (\setupfield, \definefield, \definesubfield, \field) with a version that doesn’t create form fields but just \inframeds that look the same.


\setupfield[setup name][options][keyval options] would map to \defineframed[setup name][keyval options]

\definefield[name][type][setup name][content values][default content] would map to \defineframed[nameField][keyval options] and inherit (how?) from "class name".

Don’t know how \definesubfield would work and how to setup the relationship to a special radiobutton type.

\field[name] would finally call \nameField{}

\setupfields doesn’t work anyway.

e.g.

\setupfield[MMshortString][reset,horizontal][width=45mm,option=printable,frame=off,bottomframe=on,height=2em,offset=0.5mm,frameoffset=1mm]

\definefield[Name][line][MMshortString][]

\field[Name]

would result in 

\inframed[width=45mm,frame=off,bottomframe=on,height=2em,offset=0.5mm,frameoffset=1mm]{}

while 

\setupfield[MMradio][frame=on, corner=round, height=0.75em, width=0.75em, align=bottom, offset=-0.5mm, frameoffset=0mm]
\definefield[GRB][radio][MMradio][RByes,RBno][RByes]
\definesubfield[RByes][][]
\definesubfield[RBno][][]

\field[RByes] I agree.
\field[RBno] I don’t agree.

would result in 

\inframed[frame=on, corner=round, height=0.75em, width=0.75em, align=bottom, offset=-0.5mm, frameoffset=0m]{} I agree.


I’d try it myself, but I know it’s over my head. I guess I loverlooked something important.
But probably it’s quite easy to do in Lua?



Greetlings, Hraban
---
https://www.fiee.net
http://wiki.contextgarden.net
https://www.dreiviertelhaus.de
GPG Key ID 1C9B22FD



More information about the ntg-context mailing list