[latex3-commits] [git/LaTeX3-latex3-pdfresources] testlinkstuff: choice, radio (bb83de6)
Ulrike Fischer
fischer at troubleshooting-tex.de
Sun May 5 13:34:23 CEST 2019
Repository : https://github.com/latex3/pdfresources
On branch : testlinkstuff
Link : https://github.com/latex3/pdfresources/commit/bb83de69baa036f512e2ccca43209671f0c08f76
>---------------------------------------------------------------
commit bb83de69baa036f512e2ccca43209671f0c08f76
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Sun May 5 13:34:23 2019 +0200
choice, radio
>---------------------------------------------------------------
bb83de69baa036f512e2ccca43209671f0c08f76
hluatex-experimental.def | 67 ++++++++++++++++++++++++++--------------------
test-pdfresources.tex | 11 +++++---
2 files changed, 46 insertions(+), 32 deletions(-)
diff --git a/hluatex-experimental.def b/hluatex-experimental.def
index b8e5ef3..fdf72b6 100644
--- a/hluatex-experimental.def
+++ b/hluatex-experimental.def
@@ -1077,7 +1077,10 @@
}{%
}%
}
-%\ExplSyntaxOn
+\ExplSyntaxOn
+%% check if the attr should be set through
+%% hooks.
+%% check if options are missing.
\def\@TextField[#1]#2{% parameters, label
\def\Fld at name{#2}%
\let\Fld at default\ltx at empty
@@ -1102,32 +1105,29 @@
\leavevmode
\HyAnn at AbsPageLabel
\Hy at escapeform\PDFForm at Text
- %\show\PDFForm at Text
- \pdfstartlink user {\PDFForm at Text}\relax
- %\pdf_link_user:nnn
-% \driver_pdf_raw_link_begin_user:nnw {}
-% {widget} %perhaps we need more types??
-% {\PDFForm at Text}
- %{
+ \pdf_link_user:nnn
+ {widget} %perhaps we need more types??
+ {\PDFForm at Text}
+ {
\MakeTextField{\Fld at width}{\Fld at height}
- %}
- \pdfendlink
-% \driver_pdf_link_end:
+ }
\HyField at AddToFields
}%
\endgroup
}
-%\ExplSyntaxOff
+
\def\@ChoiceMenu[#1]#2#3{% parameters, label, choices
- \def\Fld at name{#2}%
+ \def\Fld at name{#2}
\let\Fld at default\relax
\let\Fld at value\relax
- \def\Fld at width{\DefaultWidthofChoiceMenu}%
- \def\Fld at height{\DefaultHeightofChoiceMenu}%
+ \def\Fld at width{\DefaultWidthofChoiceMenu}
+ \def\Fld at height{\DefaultHeightofChoiceMenu}
\begingroup
\Fld at menulength=0 %
\@tempdima\z@
- \@for\@curropt:=#3\do{%
+ \clist_map_variable:nNn { #3 } \@curropt
+ %\@for\@curropt:=#3\do
+ {%
\expandafter\Fld at checkequals\@curropt==\\%
\Hy at StepCount\Fld at menulength
\settowidth{\@tempdimb}{\@currDisplay}%
@@ -1135,7 +1135,7 @@
}%
\advance\@tempdima by 15\p@
\begingroup
- \HyField at SetKeys{#1}%
+ \HyField at SetKeys{#1}
\edef\x{\endgroup
\noexpand\expandafter
\noexpand\HyField at SetKeys
@@ -1187,10 +1187,13 @@
}%
\endgroup
}
+
\def\@@Radio#1{%
\Fld at listcount=0 %
\EdefEscapeName\Fld at default{\Fld at default}%
- \@for\@curropt:=#1\do{%
+ \clist_map_variable:nNn { #1 } \@curropt
+ %\@for\@curropt:=#1\do
+ {%
\expandafter\Fld at checkequals\@curropt==\\%
\EdefEscapeName\@currValue{\@currValue}%
\Hy at StepCount\Fld at listcount
@@ -1198,22 +1201,28 @@
\leavevmode
\HyAnn at AbsPageLabel
\Hy at escapeform\PDFForm at Radio
- \pdfstartlink user {%
- \PDFForm at Radio
- /AP<<%
- /N<<%
- /\@currValue\space \DingObject
- >>%
- >>%
- }%
- \relax
- \MakeRadioField{\Fld at width}{\Fld at height}\pdfendlink
+ \pdf_link_user:nnn
+ {widget} %perhaps we need more types??
+ %\pdfstartlink user
+ {
+ \PDFForm at Radio
+ /AP
+ <<
+ /N
+ <<
+ /\@currValue\c_space_tl \DingObject
+ >>
+ >>
+ }
+ { \MakeRadioField{\Fld at width}{\Fld at height} }
+ %\pdfendlink
\ifnum\Fld at listcount=1 %
\HyField at AddToFields
\fi
- \space % deliberate space between radio buttons
+ \c_space_tl % deliberate space between radio buttons
}%
}
+\ExplSyntaxOff
\newcount\Fld at listcount
\def\@@Listbox#1{%
\HyField at PDFChoices{#1}%
diff --git a/test-pdfresources.tex b/test-pdfresources.tex
index ee887f6..8ae6e5e 100644
--- a/test-pdfresources.tex
+++ b/test-pdfresources.tex
@@ -12,7 +12,7 @@
\ExplSyntaxOn
\driver_pdf_compresslevel:n {0}
\driver_pdf_objects_disable:
-
+\cs_set:Nn \__driver_pdf_AR_fix: {}
%\driver_pdf_catalog_gput:nn {Lang}
\ExplSyntaxOff
\usepackage{xcolor,listings}
@@ -27,7 +27,7 @@
]{hyperref}
-\usepackage[ocgcolorlinks]{ocgx2}
+%\usepackage[ocgcolorlinks]{ocgx2}
\hypersetup{pdfview=FitV 50,pdfinfo={blub=bla,blb=zzz}}
@@ -41,13 +41,18 @@
\textwidth=5cm
\begin{document}
%
-%\url{www.xxx.com}
%abc\newpage blb\newpage ccc
%
%\tableofcontents
%\section{abc}
\makeatletter%\show\Hy at pstringdef
\begin{Form}
+\url{www.xxx.com}
+\ChoiceMenu{yyy}{aaa,bbb,ccc,dddd}
+
+\ChoiceMenu[radio]{radio}{aaa,bbb,ccc,dddd}
+
+
\TextField{abc}
\TextField{cde}
abc
More information about the latex3-commits
mailing list