[latex3-commits] [git/LaTeX3-latex3-pdfresources] radiobuttons: docu (0f72134)

Ulrike Fischer fischer at troubleshooting-tex.de
Wed May 26 00:38:45 CEST 2021


Repository : https://github.com/latex3/pdfresources
On branch  : radiobuttons
Link       : https://github.com/latex3/pdfresources/commit/0f721345f563370cf8d4dbdf523c21853a3e716e

>---------------------------------------------------------------

commit 0f721345f563370cf8d4dbdf523c21853a3e716e
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Wed May 26 00:38:45 2021 +0200

    docu


>---------------------------------------------------------------

0f721345f563370cf8d4dbdf523c21853a3e716e
 l3pdffield-checkbox.dtx  |  39 +++++++++++++++-
 l3pdffield-textfield.dtx | 118 ++++++++++++++++++++++++++++++++++++++++++++---
 2 files changed, 150 insertions(+), 7 deletions(-)

diff --git a/l3pdffield-checkbox.dtx b/l3pdffield-checkbox.dtx
index 3414c4d..b856b10 100644
--- a/l3pdffield-checkbox.dtx
+++ b/l3pdffield-checkbox.dtx
@@ -235,6 +235,13 @@
 % values for different instances, if one wants to confuse the user.
 % \end{function}
 %
+% \begin{function}{value,default}
+%  \begin{syntax}
+%   |value| = |Yes|\verb"|"|Off|\\
+%   |default| = |Yes|\verb"|"|Off|\\
+%  \end{syntax}
+% With checkboxes this two key are simply an alternative input for |checked|.
+% \end{function}
 %
 % \subsection{Using with hyperref}
 % The \cs{CheckBox} command from hyperref also prints a label, something that the
@@ -432,6 +439,8 @@
     \group_begin:
     \use:c {@@/checkbox/default_appearances:}
     \cs_set_eq:NN\@@_appearance_handler:nnn \@@_checkbox_appearance_handler:nnn
+    \cs_set_eq:NN\@@_value_handler:n   \@@_checkbox_value_handler:n
+    \cs_set_eq:NN\@@_default_handler:n \@@_checkbox_default_handler:n
 %    \end{macrocode}
 % Setting up the defaults.
 %    \begin{macrocode}
@@ -493,9 +502,37 @@
    ,checked .default:n = {true}
    ,checked .groups:n  = {checkbox}
  }
+\keys_define:nn { pdffield  }
+ {
+   ,__value .choice:
+   ,__value / Off .code:n =
+     {
+       \pdfdict_put:nnx { l_@@/field }{V} { /Off }
+       \pdfdict_put:nnx { l_@@/field }{DV}{ /Off }
+       \pdfannot_dict_put:nnn {widget}{AS}{ /Off }
+     }
+   ,__value / Yes .code:n =
+     {
+       \pdfdict_put:nnx { l_@@/field }{V} { /Yes }
+       \pdfdict_put:nnx { l_@@/field }{DV}{ /Yes }
+       \pdfannot_dict_put:nnn {widget}{AS}{ /Yes }
+     }
+ }
+%    \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@@_checkbox_value_handler:n,\@@_checkbox_default_handler:n}
+% |value| and |default| do the same as checked.
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_checkbox_value_handler:n #1
+  {
+    \keys_set:nn{pdffield}{__value={#1}}
+  }
+\cs_new_protected:Npn \@@_checkbox_default_handler:n #1
+  {
+    \keys_set:nn{pdffield}{__value={#1}}
+  }
 %    \end{macrocode}
 % \end{macro}
-%
 % \begin{macro}{\@@_checkbox_appearance_handler:nnn}
 % Appearances must create a dictionary, so we define a special handler.
 % \Arg{name} is the xform name without the /Yes, /Off, \Arg{type} is N, R, or D,
diff --git a/l3pdffield-textfield.dtx b/l3pdffield-textfield.dtx
index be5e0ab..85f3f09 100644
--- a/l3pdffield-textfield.dtx
+++ b/l3pdffield-textfield.dtx
@@ -360,6 +360,112 @@
 % \end{documentation}
 %
 % \begin{implementation}
+% \DoNotIndex
+%  {\\
+% ,\bitset_clear:N
+% ,\bitset_new:Nn
+% ,\bitset_set_false:Nn
+% ,\bitset_set_true:Nn
+% ,\bitset_to_arabic:N
+% ,\bitset_item:Nn
+% ,\bool_new:N
+% ,\box_dp:N
+% ,\box_ht:N
+% ,\clist_map_inline:nn
+% ,\color_export:nnN
+% ,\color_set:nn
+% ,\color_set:nnn
+% ,\color_select:n
+% ,\cs_new_protected:Npn
+% ,\cs_new_protected:cpn
+% ,\cs_set_eq:NN
+% ,\cs_gset_eq:cN
+% ,\cs_set_protected:Npn
+% ,\cs_generate_variant:Nn
+% ,\cs_gset_eq:NN
+% ,\c_space_tl
+% ,\csname
+% ,\dim_eval:n
+% ,\dim_new:N
+% ,\dim_to_decimal_in_bp:n
+% ,\endcsname
+% ,\exp_args:Ne
+% ,\fboxsep
+% ,\fp_eval:n
+% ,\f at size
+% ,\group_begin:
+% ,\group_end:
+% ,\hbox_to_wd:nn
+% ,\hfill
+% ,\hook_gput_code:nnn
+% ,\int_eval:n
+% ,\int_compare:nNnT
+% ,\l_keys_choice_int
+% ,\keys_define:nn
+% ,\keys_set:nn
+% ,\mode_leave_vertical:
+% ,\msg_error:nnn
+% ,\msg_error:nnnn
+% ,\msg_new:nnn
+% ,\msg_warning:nn
+% ,\msg_warning:nnn
+% ,\msg_warning:nnnnn
+% ,\NeedsTeXFormat
+% ,\normalsize
+% ,\paperheight
+% ,\paperwidth
+% ,\pdf_name_from_unicode_e:n
+% ,\pdf_object_if_exist:nTF
+% ,\pdf_object_if_exist:nF
+% ,\pdf_object_new:nn
+% ,\pdf_object_ref:n
+% ,\pdf_object_ref_last:
+% ,\pdf_object_unnamed_write:nn
+% ,\pdf_object_write:nn
+% ,\pdf_string_from_unicode:nnN
+% ,\pdfannot_box_ref_last:
+% ,\pdfannot_dict_put:nnn
+% ,\pdfannot_dict_remove:nn
+% ,\pdfannot_widget_box:nnn
+% ,\pdfdict_if_empty:nTF
+% ,\pdfdict_get:nnN
+% ,\pdfdict_new:n
+% ,\pdfdict_put:nnn
+% ,\pdfdict_remove:nn
+% ,\pdfdict_use:n
+% ,\pdfmanagement_add:nnn
+% ,\pdfmeta_standard_verify:nTF
+% ,\pdfxform_if_exist:nTF
+% ,\pdfxform_new:nnn
+% ,\pdfxform_ref:n
+% ,\phantom
+% ,\prg_do_nothing:
+% ,\ProvidesExplPackage
+% ,\quark_if_no_value:NT
+% ,\raisebox
+% ,\rule
+% ,\seq_gput_right:Nn
+% ,\seq_if_exist:NTF
+% ,\seq_new:N
+% ,\seq_use:Nn
+% ,\smash
+% ,\str_if_empty:NTF
+% ,\str_if_in:NnTF
+% ,\str_new:N
+% ,\strut
+% ,\strutbox
+% ,\tl_put_right:Nn
+% ,\tl_if_empty:NTF
+% ,\tl_if_empty:NT
+% ,\tl_if_empty:NF
+% ,\tl_put_left:Nn
+% ,\tl_if_empty:nTF
+% ,\tl_if_head_eq_charcode:nNTF
+% ,\tl_new:N
+% ,\tl_set:Nn
+% ,\tl_to_str:n
+% ,\use:c
+%   }
 % \section{\pkg{l3pdffield-textfield} Implementation}
 %    \begin{macrocode}
 %<*package>
@@ -378,17 +484,17 @@
 % The default appearances are a cross (\cs{texttimes}),
 % Every appearance should have two versions and follow the naming
 % module/\meta{name}/Yes and module/\meta{name}/Off.
-%  \begin{macro}{@@/textfield/default_appearances:}
+%  \begin{macro}{\@@_textfield_default_appearances:}
 %  This defines the standard appearance. It is setup at the first
 %  use of a textfield.
 %    \begin{macrocode}
-\cs_new_protected:cn {@@/textfield/default_appearance:}
+\cs_new_protected:Npn {\@@_textfield_default_appearances:}
   {
     \pdffield_appearance:nn {pdffield/textfield/default}
      {
        { \color_select:n{black!5!white}\rule{\paperwidth}{\paperheight} }
      }
-    \cs_gset_eq:cN {@@/textfield/default_appearance:} \prg_do_nothing:
+    \cs_gset_eq:NN \@@_textfield_default_appearances: \prg_do_nothing:
   }
 %    \end{macrocode}
 % \end{macro}
@@ -414,7 +520,7 @@
   {
     \group_begin:
     \cs_set_eq:NN\@@_V_handler:nN \@@_textfield_V_handler:nN
-    \use:c {@@/textfield/default_appearance:}
+    \@@_textfield_default_appearances:
 %    \end{macrocode}
 % Setting up the defaults.
 %    \begin{macrocode}
@@ -521,11 +627,11 @@
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_textfield_value_handler:n #1
   {
-    \keys_set:nn{pdffield}{V={#1}
+    \keys_set:nn{pdffield}{V={#1}}
   }
 \cs_new_protected:Npn \@@_textfield_default_handler:n #1
   {
-    \keys_set:nn{pdffield}{DV={#1}
+    \keys_set:nn{pdffield}{DV={#1}}
   }
 %    \end{macrocode}
 % \subsection{user commands}





More information about the latex3-commits mailing list.