ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* first element in radio field
@ 2004-10-04 11:50 Peter Rolf
  2004-10-05 16:19 ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Rolf @ 2004-10-04 11:50 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 484 bytes --]

Hello all!

This is my first attempt with fields, so I am not sure if this is a bug
in context or my fault :)
Anyway, the first element of my radio field is indented, while the following
elements are ok. This is the case in horizontal and vertical arrangment.
I added a minimal example...

ConTeXt  ver: 2004.10.1  fmt: 2004.10.3  int: english  mes: german
systems        : pdfTeX version 111 -> please update
systems        : eTeX version 201 -> too old (bugs)

Greetings,

  Peter


[-- Attachment #2: Radio.tex --]
[-- Type: text/plain, Size: 1641 bytes --]

% interface=en output=pdftex
\setupcolors[state=start]
\setupinteraction[state=start]

\starttext

\showmakeup


\def\Buttonheight{8mm}
\def\Buttonwidth{40mm}

\def\ButtonUnselected#1{\framed[frame=off,strut=no,offset=overlay,align={right,lohi},
  width=\Buttonwidth,height=\Buttonheight]
  {\xii#1}}
\def\ButtonSelected#1{\framed[strut=no,offset=overlay,width=\Buttonwidth,height=\Buttonheight,
  align={right,lohi},background=color,backgroundcolor=lightgray,frame=on]
  {\xii#1}}


\definesymbol[TbuttonA] [{\ButtonUnselected{Normal}}]
\definesymbol[TbuttonB] [{\ButtonSelected{InArea}}]
\definesymbol[TbuttonC] [{\ButtonSelected{LMbutton}}]

\definesymbol[TbuttonX] [{\ButtonUnselected{NormalX}}]
\definesymbol[TbuttonY] [{\ButtonSelected{InAreaX}}]
\definesymbol[TbuttonZ] [{\ButtonSelected{LMbuttonX}}]


\setupfield[button]
  [width=40mm,
   height=8mm,
   align=right,
   distance=0mm,
   fieldoffset=0bp,
   offset=none,
   strut=no,
   depth=0pt,
   frame=off,
   leftframe=on,
   rightframe=on,
  ]

\setupfield[radiofield][vertical] % same for horizontal+\hbox
  [align=right,
   distance=0mm,
   offset=none,
   strut=no,
   fieldoffset=0mm,
   frame=on,
   empty=yes,
   option=empty,
  ]

\definefield[Radio1][radio][radiofield][Button1,Button2,Button3][Button1]

\definesubfield[Button1] [button] [{TbuttonA,TbuttonB,TbuttonC},{TbuttonX,TbuttonY,TbuttonZ}]
\definesubfield[Button2] [button] [{TbuttonA,TbuttonB,TbuttonC},{TbuttonX,TbuttonY,TbuttonZ}]
\definesubfield[Button3] [button] [{TbuttonA,TbuttonB,TbuttonC},{TbuttonX,TbuttonY,TbuttonZ}]


\noindent
\vbox{%
\field[Button1]
\field[Button2]
\field[Button3]
}

\stoptext

[-- Attachment #3: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

^ permalink raw reply	[flat|nested] 4+ messages in thread
* Re: first element in radio field
@ 2004-10-06 12:52 Peter Rolf
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Rolf @ 2004-10-06 12:52 UTC (permalink / raw)


Moin!

First of all thanx to Hans and Willi for testing. It seems that I have to
update my (pdf)etex to a newer version. No bug: lucky Hans, unlucky me ;)


Willi Egger wrote:

> Hi Peter
>
> I tried your example wit the alpha version:
> This is pdfeTeXk, Version 3.141592-1.11a-2.1 (Web2c 7.5.2)
> ...
> ConTeXt  ver: 2004.10.1  fmt: 2004.10.2  int: english  mes: english
>
> Indentation as mentioned in your mail I can not see. -- however there 
> are three things I do not really understand:
>
> 1. Though the frames are turned off for the unselected buttons, there 
> are left and righthand lines along the buttonboxes.


a result of \showmakeup (struts?)

> 2. When pointing on the first botton it turns correctly into the gray 
> area but with changing the text into "InAreaX", but this text can not 
> be selected in order to have it remaining.


the names are not well choosen....
the prefix "X" in the button name means, that this button is inactive 
(X-ing off);
only one button can be active in a radio field

> 3 When clicking on the second button the contents of the first butten 
> changes into the value "NormalX" ...
>
> May be I do not get the idea of the radio-button ...
>
maybe this is not a good example for learning radio fields :)

> Willi
>
> Hans Hagen wrote:
>
>> Peter Rolf wrote:
>>
>>> Hello all!
>>>
>>> This is my first attempt with fields, so I am not sure if this is a bug
>>> in context or my fault :)
>>> Anyway, the first element of my radio field is indented, while the 
>>> following
>>> elements are ok. This is the case in horizontal and vertical 
>>> arrangment.
>>> I added a minimal example...
>>>
>>> ConTeXt  ver: 2004.10.1  fmt: 2004.10.3  int: english  mes: german
>>> systems        : pdfTeX version 111 -> please update
>>> systems        : eTeX version 201 -> too old (bugs)
>>
>>
>>
>>
>> it looks ok here, do others have the same problem?
>>
>> (\showmakeup may not be that handy in such cases)
>>
>>  > \noindent
>>  > \vbox{%
>>  > \field[Button1]
>>  > \field[Button2]
>>  > \field[Button3]
>>  > }
>>
>>
>> may better be:
>>
>> \noindent \vbox{\forgetall ....}
>
>
.....

Greetings,

   Peter

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-10-06 12:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-04 11:50 first element in radio field Peter Rolf
2004-10-05 16:19 ` Hans Hagen
2004-10-05 19:00   ` Willi Egger
2004-10-06 12:52 Peter Rolf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).