From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/61580 Path: news.gmane.org!not-for-mail From: Cecil Westerhof Newsgroups: gmane.comp.tex.context Subject: Perfecting my checkbox functionalities Date: Fri, 10 Sep 2010 10:05:39 +0200 Message-ID: <87iq2ekoq4.fsf@linux-lqcw.site> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1284105950 20637 80.91.229.12 (10 Sep 2010 08:05:50 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 10 Sep 2010 08:05:50 +0000 (UTC) To: NTG ConTeXt mailing list Original-X-From: ntg-context-bounces@ntg.nl Fri Sep 10 10:05:48 2010 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OtycG-0003Ao-9D for gctc-ntg-context-518@m.gmane.org; Fri, 10 Sep 2010 10:05:48 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id ED43FCA67A; Fri, 10 Sep 2010 10:05:47 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 6EYf6pwL5y7a; Fri, 10 Sep 2010 10:05:45 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 13CB6CA665; Fri, 10 Sep 2010 10:05:45 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 51E25CA665 for ; Fri, 10 Sep 2010 10:05:43 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id NR-aGLIXxsWK for ; Fri, 10 Sep 2010 10:05:40 +0200 (CEST) Original-Received: from filter3-nij.mf.surf.net (filter3-nij.mf.surf.net [195.169.124.154]) by balder.ntg.nl (Postfix) with ESMTP id AB9A3CA64F for ; Fri, 10 Sep 2010 10:05:40 +0200 (CEST) Original-Received: from mail-ew0-f41.google.com (mail-ew0-f41.google.com [209.85.215.41]) by filter3-nij.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id o8A85cu5018955 for ; Fri, 10 Sep 2010 10:05:39 +0200 Original-Received: by ewy28 with SMTP id 28so1903520ewy.14 for ; Fri, 10 Sep 2010 01:05:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :message-id:user-agent:mime-version:content-type; bh=WHMGl10pq9kcgWpBs7w3uAFToSm+zYY+ezvbQ6LHHYI=; b=QdQfKmVGQXG+6M1cjYunDpZ9Mzoh02DC83A4MPc1hMlonMxvOnvm7huPCSj3bTT+j6 9cygP5CmztL4v3S9PRNCDXe1MjM/vnzySvrH4sqkhsk5nF6pk06xsmPQaMOKsViyRJge d3GUDzal/eF/nwcKZ7IYyrf5L6q/2Kg1fXEE8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:message-id:user-agent:mime-version :content-type; b=oAGXcBd2LJfJbxktBCdHlx/2sz/NO6EjHV+lYeQkCeesncr0CrjvA8jNrKla/sXDTY ecyZSqRg1b+a86sSD/Nou7ZXEZ0FEdB+E/lKzMWFmxQU1kQ12BYQkagey+E9fsqhdp/y Gpgtl7jX2sAORKtRXm9wSWke2BjzIZ1jw2mnM= Original-Received: by 10.213.27.138 with SMTP id i10mr342570ebc.52.1284105938779; Fri, 10 Sep 2010 01:05:38 -0700 (PDT) Original-Received: from linux-lqcw.site (84-53-123-169.wxdsl.nl [84.53.123.169]) by mx.google.com with ESMTPS id u9sm3470487eeh.11.2010.09.10.01.05.35 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 10 Sep 2010 01:05:35 -0700 (PDT) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.215.41; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0dD4U5D99 - 3fd179f60e6d - 20100910 X-Scanned-By: CanIt (www . roaringpenguin . com) on 195.169.124.154 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:61580 Archived-At: 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 ___________________________________________________________________________________