From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/115048 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[solved] Date: Tue, 24 May 2022 23:08:20 +0200 Message-ID: <92AFE49A-5135-4D73-9DC5-70B954BB687F@gmail.com> References: <89C350A5-B676-477E-9C44-0BBA69B2EAF1@gmail.com> <82c7f877-471a-72ed-51eb-920eb8674ebe@gmx.es> <318475D8-31CD-4F49-A8E6-E1B4F269B99F@gmail.com> <791494A0-D65B-4F30-B2EF-31F0CECB4BEC@gmail.com> 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="===============2086806686922428160==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9900"; 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 23:09:17 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 1ntbmH-0002P6-2D for gctc-ntg-context-518@m.gmane-mx.org; Tue, 24 May 2022 23:09:17 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 38E02289996; Tue, 24 May 2022 23:08:31 +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 cJY4C7wZXfWJ; Tue, 24 May 2022 23:08:27 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 2DA2A289F92; Tue, 24 May 2022 23:08:27 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 7CEEC289F84 for ; Tue, 24 May 2022 23:08:25 +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 sGi33c2NWNjZ for ; Tue, 24 May 2022 23:08:23 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.167.51; helo=mail-lf1-f51.google.com; envelope-from=skrantajanneman@gmail.com; receiver= Original-Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) (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 28143289996 for ; Tue, 24 May 2022 23:08:23 +0200 (CEST) Original-Received: by mail-lf1-f51.google.com with SMTP id w14so32831866lfl.13 for ; Tue, 24 May 2022 14:08:23 -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=FqRTw0VW5m2074GMgXuXVRRO6WOFvEY6WDx1QJ3a8R8=; b=Bm38do3wpE8N8Xlo6/z7DgduDpRyW0dGjEpzPM4+be4FkwFHLVkuJRt09FFFGly0V0 e2Mv6TngwWSRM9TxGb9/Bb/1eaoKD++tLJX22AzaWicObOW/rToVOZTNIfC4RGhUaopi ESAj31URTLHUvOEn6ITkhciU+GiAVbZWBbp45mxAaMGAUfE4jPLXUzIetHb8MeBamzTd 9Qf3NqJrmXy8EOlyEzHWK/zhceXoh4giAVZEq8dBLMP+VyUkCpV4vP6RiXrmGduCgsx7 OsUVIcK0L6/2SQmBYqD3qoV1ScH0Wdpy9WqeeneyZk1SdqxznRvV1ZR/gFdCPfXA+wkr tZ5g== 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=FqRTw0VW5m2074GMgXuXVRRO6WOFvEY6WDx1QJ3a8R8=; b=TJMIau6CdVUArLvP4Ah209WaLz5e+ijCYdbTTS2PE5WiQM9kMlQFvc6waBRCHJKNF9 pgxWuu6xBK4pNlO4uofkuRa6TtvHkdvzMukIEJLY6EzcUBJOU7RkrKovXnhUVdJ1Zs9u A90ArrmRBAx4wy1C7P9gfiz+SesIt/i5orXKjWekn6i1J6n2bbT6+o7G8PhhYsmxXKEE SWW1gzsYd4jXk7IuKVnTTEuDD6M3z3hbdlEQjed/tgGtndZhjaUgQfNbA+UyFmYelSRK FXFOLQiNW7g3Ien8yI5dfB3crIyuNoqxRD3E+wqYgaZDZFL4wlWMzT89tMHzdapJEDe7 XXZw== X-Gm-Message-State: AOAM530lRLkAwTq6XA2K62yL67hEucZZdCEqduFnoKWT6CD5LNJi5qAR 6Ypdr4DxNuZbNndlUOesuKCQz59OtA3OTw== X-Google-Smtp-Source: ABdhPJyu259C8ocX27NXOC0Z83M3X9mbgj/eQ5KnclqlmFJu0TJ0N8ZhQqkouEVz9b52qK2si5yvsw== X-Received: by 2002:a05:6512:110c:b0:477:a454:f0b5 with SMTP id l12-20020a056512110c00b00477a454f0b5mr20585942lfg.548.1653426502070; Tue, 24 May 2022 14:08:22 -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 u18-20020a05651220d200b00477c8127e50sm2650730lfr.122.2022.05.24.14.08.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 May 2022 14:08:21 -0700 (PDT) In-Reply-To: <791494A0-D65B-4F30-B2EF-31F0CECB4BEC@gmail.com> 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:115048 Archived-At: --===============2086806686922428160== Content-Type: multipart/alternative; boundary="Apple-Mail=_B03A2550-C993-4824-8410-88E6E15B5657" --Apple-Mail=_B03A2550-C993-4824-8410-88E6E15B5657 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 I=E2=80=99ve tested on my Mac OS Monterey 12.3.1 and the same phenomena = as firefox it also is on google chrome. > 24 maj 2022 kl. 10:18 skrev Jan-Erik H=C3=A4ggl=C3=B6f = : >=20 > HI Again! >=20 > I discovered what went wrong, such a silly syntax error, here comes a = working code: >=20 > \setupinteraction[state=3Dstart] >=20 > = \definesymbol[yes][{\externalfigure[check-mark-svgrepo-com.svg][conversion= =3Dmp]}] > \definesymbol[no][] >=20 > \newcount\chk > \def\checkmark{% > \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]% > } >=20 > \starttext >=20 > \checkmark\ >=20 > \checkmark\ >=20 > \checkmark\ >=20 > \stoptext >=20 > Sorry to bother the list but maybe it is helpful for someone. >=20 > Regards >=20 > /Jan-Erik >=20 >> 24 maj 2022 kl. 08:08 skrev Jan-Erik H=C3=A4ggl=C3=B6f = >: >>=20 >> I=E2=80=99ve tried this >>=20 >> \setupinteraction[state=3Dstart] >>=20 >> = \definesymbol[yes][{\externalfigure[check-mark-svgrepo-com.svg][conversion= =3Dmp]}] >> \definesymbol[no][] >>=20 >> \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]% >> } >>=20 >> \starttext >>=20 >> \chk >>=20 >> \chk >>=20 >> \chk >>=20 >> \stoptext >>=20 >> But it gives the error =E2=80=9D You can=E2=80=99t use \global after = \advance=E2=80=9D >>=20 >> But this example works fine >>=20 >> \setupinteraction[state=3Dstart] >>=20 >> \newcount\clozecount >> \def\mycloze{% >> \global \advance \clozecount by 1 >> \definefield[uniqcloze\the\clozecount][line]% >> \field[uniqcloze\the\clozecount]% >> } >>=20 >> \starttext >>=20 >> 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. >>=20 >> \stoptext >>=20 >> =46rom=20 >>=20 >> = https://tex.stackexchange.com/questions/560042/how-to-create-unique-clozes= -in-context-in-a-pdf-that-users-can-type-in = >>=20 >>> 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 >>=20 >=20 --Apple-Mail=_B03A2550-C993-4824-8410-88E6E15B5657 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 I=E2=80=99ve tested on my Mac OS Monterey 12.3.1 and the same = phenomena as firefox it also is on google chrome.



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

HI Again!

I discovered what went = wrong, such a silly syntax error, here comes a working code:

\setupinteraction[state=3Dstart]

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

\newcount\chk
\def\checkmark{%
\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

\checkmark\

\checkmark\

\checkmark\

\stoptext

Sorry to bother the list = but maybe it is helpful for someone.

Regards

/Jan-Erik

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

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=_B03A2550-C993-4824-8410-88E6E15B5657-- --===============2086806686922428160== 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== --===============2086806686922428160==--