[NTG-context] Interactive checkbox in ConTeXt

Jan-Erik Hägglöf skrantajanneman at gmail.com
Sun May 22 12:27:18 CEST 2022


So far I accomplished this but problem is that when I check it checks all, not individually.

\setupinteraction[state=start]
\setupexternalfigures[location=global]

\definesymbol [yes] [{\externalfigure[check-mark-svgrepo-com.svg][conversion=mp]}]
\definesymbol [no] []


\setupfield
[setup 3]
[width=0.5cm, height=0.5cm,
rulethickness=1pt, corner=round, framecolor=red]


\definefield [check-me] [check] [setup 3] [yes,no] [no]

\define\chk{\field[check-me]}

\starttext

\chk	gfgkfgfghjl

\chk	dfdffdfff



\stoptext
-------------- next part --------------
A non-text attachment was scrubbed...
Name: check-mark-svgrepo-com.svg
Type: image/svg+xml
Size: 1370 bytes
Desc: not available
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20220522/6e265a23/attachment.svg>
-------------- next part --------------


> 22 maj 2022 kl. 10:47 skrev Jan-Erik Hägglöf <skrantajanneman at gmail.com>:
> 
> Thank you for the useful tip.
> 
> I’ve tested the example given below but ran into missing figure, maybe I need to reconstruct the MetaPost file as mentioned in setup. Se attached example:
> 
> Thanks in advance!
> 
> /Jan-Erik
> 
> \setupinteraction[state=start]
> \setupexternalfigures[location=global]
> 
> \definesymbol [yes] [{\externalfigure[mp-cont.502]}]
> \definesymbol [no] []
> 
> 
> \setupfield
> [setup 3]
> [width=2cm, height=2cm,
> rulethickness=3pt, corner=round, framecolor=red]
> 
> \definefield [check-me] [check] [setup 3] [yes,no] [no]
> 
> \starttext
> \field[check-me]
> \stoptext
> 
>> 20 maj 2022 kl. 12:28 skrev Henning Hraban Ramm via ntg-context <ntg-context at ntg.nl>:
>> 
>> Am 20.05.22 um 12:01 schrieb Jan-Erik Hägglöf via ntg-context:
>>> How do I accomplish a similar funktion like this, that is written in latex, but in context instead?
>>> LATEXCODE
>>> |\documentclass{article} \usepackage{hyperref} \begin{document} \begin{Form} \CheckBox[name=mycheckbox,checkboxsymbol=\ding{53}]{This is a check box:} \end{Form} \end{document}|
>> 
>> Have a look at https://wiki.contextgarden.net/Widgets and the "mwidget" manual.
>> 
>> Custom symbols work unreliably, depending of the viewer.
>> 
>> Hraban
>> ___________________________________________________________________________________
>> If your question is of interest to others as well, please add an entry to the Wiki!
>> 
>> maillist : ntg-context at ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
>> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>> wiki     : http://contextgarden.net
>> ___________________________________________________________________________________
> 



More information about the ntg-context mailing list