Re: [NTG-context] radiobuttons and other widgets

2019-08-05 Thread Henning Hraban Ramm
This is a feature request or wish:

I would be glad to have a module (e.g. "fakefields") as a drop-in replacement 
that overwrites the field commands (\setupfield, \definefield, \definesubfield, 
\field) with a version that doesn’t create form fields but just \inframeds that 
look the same.


\setupfield[setup name][options][keyval options] would map to 
\defineframed[setup name][keyval options]

\definefield[name][type][setup name][content values][default content] would map 
to \defineframed[nameField][keyval options] and inherit (how?) from "class 
name".

Don’t know how \definesubfield would work and how to setup the relationship to 
a special radiobutton type.

\field[name] would finally call \nameField{}

\setupfields doesn’t work anyway.

e.g.

\setupfield[MMshortString][reset,horizontal][width=45mm,option=printable,frame=off,bottomframe=on,height=2em,offset=0.5mm,frameoffset=1mm]

\definefield[Name][line][MMshortString][]

\field[Name]

would result in 

\inframed[width=45mm,frame=off,bottomframe=on,height=2em,offset=0.5mm,frameoffset=1mm]{}

while 

\setupfield[MMradio][frame=on, corner=round, height=0.75em, width=0.75em, 
align=bottom, offset=-0.5mm, frameoffset=0mm]
\definefield[GRB][radio][MMradio][RByes,RBno][RByes]
\definesubfield[RByes][][]
\definesubfield[RBno][][]

\field[RByes] I agree.
\field[RBno] I don’t agree.

would result in 

\inframed[frame=on, corner=round, height=0.75em, width=0.75em, align=bottom, 
offset=-0.5mm, frameoffset=0m]{} I agree.


I’d try it myself, but I know it’s over my head. I guess I loverlooked 
something important.
But probably it’s quite easy to do in Lua?



Greetlings, Hraban
---
https://www.fiee.net
http://wiki.contextgarden.net
https://www.dreiviertelhaus.de
GPG Key ID 1C9B22FD

___
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
___


Re: [NTG-context] radiobuttons

2019-08-05 Thread Henning Hraban Ramm
Of course the behaviour depends on the PDF viewer… :-(
In Acrobat Pro 9 the radiobuttons work while I highlight form fields; if I 
switch that off, all options are checked.
In Adobe Reader DC you can’t switch off form field highlighting.
Preview.app only highlights on mouseover and checks all radiobuttons.
PDF Studio (that I try to establish as a cheap alternative to Acrobat Pro) 
sometimes shows an error after asking if I’d like to activate JavaScript and 
won’t open my form document at all.

Since I need also a non-interactive version for printout, and since ConTeXt 
doesn’t reserve the space of form fields if I switch off interaction, I used to 
remove form fields with Acrobat.
In previous versions (I can prove 2018-11) ConTeXt used its own frames for 
radiobuttons and checkboxes. Now it seems to use options of the PDF form fields 
that look different in viewers and disappear if I delete the field…

Custom symbols of radiobuttons and checkboxes are displayed constantly (that 
used to work only in MkII 10 years before or so, probably due to changes in 
Acrobat), and it’s not possible to use different symbols for checkend and 
unchecked



Hraban

> Am 2019-08-05 um 10:03 schrieb Henning Hraban Ramm :
> 
> Hi, coming back to an old form project I find that something changed WRT to 
> form fields.
> 
> For one, some fields appear smaller and shifted upwards – I managed to fix 
> that with setups.
> 
> What I can’t change is behaviour of radiobuttons: if I click one, all rbs of 
> one group activate, and I can’t deactivate them any more.
> 
> In my project all of the fields are duplicated on other pages, and while all 
> other fields’ contents get copied, it doesn’t work for radiobuttons; my 
> minimal example unfortunately can’t show that.
> 
> 
> \setupinteraction[state=start]
> 
> \setupfield[MMradio][
>  option=printable,
>  frame=overlay, corner=round,
>  height=1em, width=1em,
>  align=bottom,
> ]
> 
> \definefield[chooseTeX][radio][MMradio][rbContext,rbLatex,rbOther][rbContext]
> \definesubfield[rbContext][][]
> \definesubfield[rbLatex][][]
> \definesubfield[rbOther][][]
> 
> \starttext
> 
> I want to use \field[rbContext] \CONTEXT\ \field[rbLatex] \LaTeX\ 
> \field[rbOther] other.
> 
> \page
> 
> Just to confirm:
> I want to use \field[rbContext] \CONTEXT\ \field[rbLatex] \LaTeX\ 
> \field[rbOther] other.
> 
> 
> \stoptext
> 
> 
> Greetlings, Hraban
> ___
> 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
> ___

___
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
___


[NTG-context] lmtx

2019-08-05 Thread Hans Hagen

Hi,

As we're progressing with the lmtx project (aka luametatex + context) 
the codebase gets adapted a bit. There are a few things that you need to 
keep an eye on:


- As we test with lua 5.4 it can be that you need to wipe the
  cache after an update due to differences in byte code. This
  is only needed when you run into issues. At some point there
  might be a split in lua code (for luatex and luametatex) as
  5.2 (luajittex, not evolving), 5.3 (luatex, stable frozen)
  and 5.4 (luametatex, experimental progressing) have a couple
  of different properties that we might want to benefit from.

- The code base gets split in "Mark Four" and "Mark Fourty"
  files. Some of these are permanent, some can be temporary. It
  can for instance relate to features in and experiments with
  the engine. The only convenient way to test things is in
  'real situations' and often issues can be solved fast.

- As we're experimenting with metafun (and luagraph and ...) we
  also explore new interfaces. This results in a different
  codebase but should go unnoticed for existing code. Of course
  metafun 2.0 (hip and modern internet version speak) can bring
  interesting new things in the end.

As usual, happy testing.

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
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
___


[NTG-context] radiobuttons

2019-08-05 Thread Henning Hraban Ramm
Hi, coming back to an old form project I find that something changed WRT to 
form fields.

For one, some fields appear smaller and shifted upwards – I managed to fix that 
with setups.

What I can’t change is behaviour of radiobuttons: if I click one, all rbs of 
one group activate, and I can’t deactivate them any more.

In my project all of the fields are duplicated on other pages, and while all 
other fields’ contents get copied, it doesn’t work for radiobuttons; my minimal 
example unfortunately can’t show that.


\setupinteraction[state=start]

\setupfield[MMradio][
  option=printable,
  frame=overlay, corner=round,
  height=1em, width=1em,
  align=bottom,
]

\definefield[chooseTeX][radio][MMradio][rbContext,rbLatex,rbOther][rbContext]
\definesubfield[rbContext][][]
\definesubfield[rbLatex][][]
\definesubfield[rbOther][][]

\starttext

I want to use \field[rbContext] \CONTEXT\ \field[rbLatex] \LaTeX\ 
\field[rbOther] other.

\page

Just to confirm:
I want to use \field[rbContext] \CONTEXT\ \field[rbLatex] \LaTeX\ 
\field[rbOther] other.


\stoptext


Greetlings, Hraban
___
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
___