From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/115036 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?q?Jan-Erik_H=C3=A4ggl=C3=B6f_via_ntg-context?= Newsgroups: gmane.comp.tex.context Subject: Re: Issue with interactive checkboxes Date: Tue, 24 May 2022 08:08:25 +0200 Message-ID: <318475D8-31CD-4F49-A8E6-E1B4F269B99F@gmail.com> References: <89C350A5-B676-477E-9C44-0BBA69B2EAF1@gmail.com> <82c7f877-471a-72ed-51eb-920eb8674ebe@gmx.es> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.80.82.1.1\)) Content-Type: multipart/mixed; boundary="===============1052920901777007386==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20979"; mail-complaints-to="usenet@ciao.gmane.io" Cc: =?utf-8?B?SmFuLUVyaWsgSMOkZ2dsw7Zm?= , Pablo Rodriguez To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue May 24 08:09:15 2022 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ntNjH-0005DM-H0 for gctc-ntg-context-518@m.gmane-mx.org; Tue, 24 May 2022 08:09:15 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 393B628A007; Tue, 24 May 2022 08:08:33 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VdeTLhlUtcQz; Tue, 24 May 2022 08:08:30 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id AA8A2289FF8; Tue, 24 May 2022 08:08:30 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 11CCC289FED for ; Tue, 24 May 2022 08:08:29 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eA0zmd_J7b9W for ; Tue, 24 May 2022 08:08:27 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.208.173; helo=mail-lj1-f173.google.com; envelope-from=skrantajanneman@gmail.com; receiver= Original-Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id AB775289E5C for ; Tue, 24 May 2022 08:08:27 +0200 (CEST) Original-Received: by mail-lj1-f173.google.com with SMTP id m11so8216758ljc.1 for ; Mon, 23 May 2022 23:08:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=e+ndqNJkDybxfqE7ISi6jDvwd03P8c8VMv2rDq4UBFE=; b=WyMCnuNHCurZoPGg2P6NjD6XJ6g0lP9k7xJZdnadZB+hOyjoPt1a4Go3MtOMf80Hcq EQ7VxqiaIW1uhWSRLe3oHFBqx5LA/h/pVd72EQWaJ/bvgp/MmfDboz9CLJq9N7lsg2mH UMtpDhX6pG5mbthy2BpMgu6iz/Nle6hnbaON5StI0wSRAdflJIWzy6kqplRJCTpRgpWz KkzGqrIy7YPwg4V8TZa0p16p/cccXCBcKkMEz4Mm+1Cch9NIHIkDf2nxlytIIVggk0zw JFyiCOrSnFFfia0w751ylQL0wjZuMIwntW8JjvwnhmL21UrK2loj61DN3ORqg57vT/su qG+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=e+ndqNJkDybxfqE7ISi6jDvwd03P8c8VMv2rDq4UBFE=; b=KIwkuo+QRV/Nae+dVpgWsbWrCLbTpQ8Wx9p+8MtkNaFTtFtE6RdxgsUDcoKZfHrZ8L kt3id9CZKfpZoTzYLDLOccmN+1ej9xnNC/d+hGMCH+d4TDfLilxb/QAi3H6u10IbE+PP 3b6HYEhdgA41GgHnKuwkDXT7t12jlhk5Dc9MX9B4Xo3zj1k1w0jNGWTWLx/s0zNbLC88 kPjpQsQsBBpCoBCFOr/dS/2+qyxGlF9ZYS/Y8CaaWts2MeOmsfMahQ2Jh/yIfhTK/o1/ rMW4GZDIgBIt107U3Cy4uS09U4RaUGLu4lokLx4nJT7G6p4Cs9M6h7+z9j16xjOVT5wR 2zMw== X-Gm-Message-State: AOAM533AWQXRgVl8lttYZfEI7wrgJefFX/oYWCkISsO2xqfG+Ra95y7H F4IPQ7BXSI56w0eN9YILD1R1OilEAxiBTw== X-Google-Smtp-Source: ABdhPJz75E0MZaK1VpVYJEMFBq3Q8JkRUCPX6R52G6htRDgQKTtTVqd+UCo8//F0u0ZzYIAjjmcsHQ== X-Received: by 2002:a2e:8805:0:b0:253:bfdc:6b31 with SMTP id x5-20020a2e8805000000b00253bfdc6b31mr15021120ljh.495.1653372506878; Mon, 23 May 2022 23:08:26 -0700 (PDT) Original-Received: from smtpclient.apple (h-98-128-229-7.NA.cust.bahnhof.se. [98.128.229.7]) by smtp.gmail.com with ESMTPSA id d25-20020ac24c99000000b00477b624c0a8sm2347908lfl.180.2022.05.23.23.08.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 May 2022 23:08:26 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.3696.80.82.1.1) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.io gmane.comp.tex.context:115036 Archived-At: --===============1052920901777007386== Content-Type: multipart/alternative; boundary="Apple-Mail=_01625020-C67E-474A-B253-4DBA8DA9563D" --Apple-Mail=_01625020-C67E-474A-B253-4DBA8DA9563D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 I=E2=80=99ve tried this \setupinteraction[state=3Dstart] = \definesymbol[yes][{\externalfigure[check-mark-svgrepo-com.svg][conversion= =3Dmp]}] \definesymbol[no][] \newcount\chk \def\chk{% \global \advance \chk by 1 \setupfield[setup1][width=3D0.5cm, height=3D0.5cm,rulethickness=3D1pt, = corner=3Dround, framecolor=3Dred]% \definefield[checkme\the\chk][check][setup1][yes,no][no]% \field[checkme\the\chk]% } \starttext \chk \chk \chk \stoptext But it gives the error =E2=80=9D You can=E2=80=99t use \global after = \advance=E2=80=9D But this example works fine \setupinteraction[state=3Dstart] \newcount\clozecount \def\mycloze{% \global \advance \clozecount by 1 \definefield[uniqcloze\the\clozecount][line]% \field[uniqcloze\the\clozecount]% } \starttext Frogs have four \mycloze\ and two eyes. Frogs have four \mycloze\ and two eyes. Frogs have four \mycloze\ and two eyes. Frogs have four \mycloze\ and two eyes. \stoptext =46rom=20 = https://tex.stackexchange.com/questions/560042/how-to-create-unique-clozes= -in-context-in-a-pdf-that-users-can-type-in > 24 maj 2022 kl. 07:44 skrev Jan-Erik H=C3=A4ggl=C3=B6f = : >=20 > Thank you, unfortunately it has no effect. Even if I make a macro, = still it is the same field. >=20 >> 23 maj 2022 kl. 21:59 skrev Pablo Rodriguez via ntg-context = : >>=20 >> On 5/23/22 13:11, Jan-Erik H=C3=A4ggl=C3=B6f via ntg-context wrote: >>> HI! >>>=20 >>> Tried to make a checklist in an interactive document. >>>=20 >>> The problem seems to be that all checks/uncecks in same click, not = each >>> individually. >>>=20 >>> Is there something wrong with my code? >>=20 >> Hi Jan-Erik, >>=20 >> you basically put the same field twice. >>=20 >> Add something like: >>=20 >> \definefield [check-you] [check] [setup 3] [yes,no] [no] >>=20 >> \define\chka{\field[check-you]} >>=20 >> \chka >>=20 >> Checks will be different then. >>=20 >> I hope it helps, >>=20 >> Pablo >> = __________________________________________________________________________= _________ >> If your question is of interest to others as well, please add an = entry to the Wiki! >>=20 >> maillist : ntg-context@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 >> = __________________________________________________________________________= _________ >=20 --Apple-Mail=_01625020-C67E-474A-B253-4DBA8DA9563D Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 I=E2=80=99ve tried this

\setupinteraction[state=3Dstart]

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

\newcount\chk
\def\chk{%
\global \advance \chk by = 1
\setupfield[setup1][width=3D0.5cm, = height=3D0.5cm,rulethickness=3D1pt, corner=3Dround, = framecolor=3Dred]%
\definefield[checkme\the\chk][check][setup1][yes,no][no]%
=
\field[checkme\the\chk]%
}

\starttext

\chk

\chk

\chk

\stoptext

But it gives the error = =E2=80=9D You can=E2=80=99t use \global after \advance=E2=80=9D

But this example works = fine

\setupinteraction[state=3Dstart]

\newcount\clozecount
\def\mycloze{%
  \global \advance \clozecount by 1
  \definefield[uniqcloze\the\clozecount][line]%
  \field[uniqcloze\the\clozecount]%
}

\starttext

Frogs have four \mycloze\ and two eyes.
Frogs have four \mycloze\ and two eyes.
Frogs have four \mycloze\ and two eyes.
Frogs have four \mycloze\ and two eyes.

\stoptext

From 


24 = maj 2022 kl. 07:44 skrev Jan-Erik H=C3=A4ggl=C3=B6f <skrantajanneman@gmail.com>:

Thank = you, unfortunately it has no effect. Even if I make a macro, still it is = the same field.

23 maj 2022 kl. 21:59 skrev Pablo Rodriguez via ntg-context = <ntg-context@ntg.nl>:

On = 5/23/22 13:11, Jan-Erik H=C3=A4ggl=C3=B6f via ntg-context wrote:
HI!

Tried to make a checklist in an interactive document.

The problem seems to be that all = checks/uncecks in same click, not each
individually.

Is there something wrong with my code?

Hi Jan-Erik,

you basically put the same field twice.

Add something like:

= \definefield [check-you] [check] [setup 3] [yes,no] [no]
\define\chka{\field[check-you]}

= \chka

Checks will be different then.

I hope it helps,

Pablo
_______________________________________________________________= ____________________
If your question is of interest to = others as well, please add an entry to the Wiki!

maillist : ntg-context@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
_______________________________________________________________= ____________________


= --Apple-Mail=_01625020-C67E-474A-B253-4DBA8DA9563D-- --===============1052920901777007386== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============1052920901777007386==--