ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Perfecting my checkbox functionalities
@ 2010-09-10  8:05 Cecil Westerhof
  2010-09-10 16:00 ` Wolfgang Schuster
  0 siblings, 1 reply; 2+ messages in thread
From: Cecil Westerhof @ 2010-09-10  8:05 UTC (permalink / raw)
  To: NTG ConTeXt mailing list

I am learning to work with ConTeXt. At the moment I have the following
defined:
    \newdimen\CheckBoxMargin
    \CheckBoxMargin=2em
    \newdimen\CheckBoxWidth
    \CheckBoxWidth=2.5em
    \newdimen\CheckBoxDistance
    \CheckBoxDistance=.5em
    \definesymbol[CheckBox][{[~~~]}]
    \def\startcheckbox[#1]{
      \blank
      \leftaligned{#1}
      \startitemize[packed, intro, joinedup][margin=\CheckBoxMargin,
                    symbol=CheckBox, width=\CheckBoxWidth,
                    distance=\CheckBoxDistance]
    }

    \def\stopcheckbox{
      \stopitemize
      \blank
      \crlf
    }

    \def\GetNiveauOfService[#1]{
      \blank
      #1 {\switchtobodyfont[0.5em](1 = low, 9 = high)}
      \startitemize[packed, intro, joinedup, columns][n=9,
                    symbol=CheckBox, width=\CheckBoxWidth,
                    distance=\CheckBoxDistance]
      \dorecurse{9}{
        \item \recurselevel
      }
      \stopcheckbox
    }

I have a few questions about this.

In GetNiveauOfService 9 is used three times. I like DRY, so I was
wondering if there would be a better way to do this?

Next step would be that the number of checkboxes could be a parameter.
The default would be nine and if given, the given value would be used.
How would I do this?

Then the 'normal' checkboxes. The default is one column. But I would
like to have the possibility to use a parameter to for example make
checkboxes in three columns. How would I do this?

Lastly, in GetNiveauOfService there is text. How can I make this
language dependent. For example in English I want:
    (1 = low, 9 = high)
but in Dutch:
    (1 = weinig, 9 = veel)
and properly it would be a good idea to have two optional parameters
when you want other descriptions.
How would I do this?

-- 
Cecil Westerhof
M CLDWesterhof@gmail.com

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

Please do not send me Microsoft Office/Apple iWork documents.
Send OpenDocument instead! http://fsf.org/campaigns/opendocument/
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

end of thread, other threads:[~2010-09-10 16:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-10  8:05 Perfecting my checkbox functionalities Cecil Westerhof
2010-09-10 16:00 ` Wolfgang Schuster

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).