From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/9614 Path: main.gmane.org!not-for-mail From: Giuseppe Bilotta Newsgroups: gmane.comp.tex.context Subject: Re[2]: [NTG-context] tooltips Date: Mon, 21 Oct 2002 17:56:01 +0200 Sender: ntg-context-admin@ref.vet.uu.nl Message-ID: <17835324293.20021021175601@iol.it> References: <5.1.0.14.1.20021020235850.00ac0120@remote-1> <20021021142630.32689d53.morawski@gmx.net> Reply-To: Giuseppe Bilotta NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1035399916 4437 80.91.224.250 (23 Oct 2002 19:05:16 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 19:05:16 +0000 (UTC) Cc: ntg-context@ntg.nl Original-Received: from hermes.hrz.uni-giessen.de (hermes.hrz.uni-giessen.de [134.176.2.15]) by osiris.hrz.uni-giessen.de (8.11.6+Sun/8.11.6) with ESMTP id g9LG1pe05273 for ; Mon, 21 Oct 2002 18:01:51 +0200 (MEST) Original-Received: from ref.vet.uu.nl by hermes.hrz.uni-giessen.de with ESMTP for Guenter.Partosch@hrz.uni-giessen.de; Mon, 21 Oct 2002 18:01:35 +0200 Original-Received: from ref.ntg.nl (localhost.localdomain [127.0.0.1]) by ref.ntg.nl (Postfix) with ESMTP id 3FD9F10B12; Mon, 21 Oct 2002 18:01:18 +0200 (MEST) Original-Received: from smtp1.libero.it (smtp1.libero.it [193.70.192.51]) by ref.ntg.nl (Postfix) with ESMTP id 6EA7B10B0B for ; Mon, 21 Oct 2002 18:00:34 +0200 (MEST) Original-Received: from [151.29.130.215] (151.29.130.215) by smtp1.libero.it (6.5.028) id 3DA3107F00602A78; Mon, 21 Oct 2002 18:00:05 +0200 X-Mailer: The Bat! (v1.60q) Business X-Priority: 3 (Normal) Original-To: Jens-Uwe Morawski In-Reply-To: <20021021142630.32689d53.morawski@gmx.net> Errors-To: ntg-context-admin@ref.vet.uu.nl X-BeenThere: ntg-context@ref.ntg.nl X-Mailman-Version: 2.0.13 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.comp.tex.context:9614 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:9614 Monday, October 21, 2002 Jens-Uwe Morawski wrote: JUM> On Sun, 20 Oct 2002 23:59:31 +0200 JUM> Hans Hagen wrote: >> i come back to the tooltips later JUM> before i forget it, i would like to give here an additional idea JUM> about this topic: JUM> IMO, the whole thing should be more general, maybe by calling it JUM> 'balloons' or 'balloonwidget'. The usage in \footnote, \tooltip or JUM> \cite is only an instance of the more general balloon-object. JUM> For example, i would like to use such a ballon-widget as a JUM> dropdown-menu in an interactive document that contains JUM> a list of chapters, ...: JUM> \balloon[placement={below,centered}, JUM> frameclass=DropMenu, JUM> opendirection=down, JUM> openaction=OnClick] JUM> {Chapters} JUM> {\placelist JUM> [chapter] JUM> [criterium=all, JUM> alternative=a, JUM> pagenumber=no, JUM> interaction=all]} JUM> and tooltips are then: JUM> \defineballoon[tooltip][...] I have a draft implementation for this. By now, the only thing that can be configured is the framecommand. I decided to use this instead of a frameclass because it's even more flexible (with frameclass, you need to define a different frame class for each different ballon type, even if changes are small; this way, small changes can be applied more easily when defining new tooltips.) Put the following code in your cont-new.tex file or in your cont-loc.tex file (whichever you use for customizations), until Hnas decides to pass it to the core. I hope to come out myself with more customization options, but I would have to study fields and co. Maybe I'll leave that to Hans though. BTW, your stuff seems to more oriented towards what Hans called "helps" rather than tooltips, but I don't know much about this feature. Anyway, here's the code for custom balloons. Hope I didn't reinvent the wheel ... ===== BEGIN CODE ===== % Redefine tooltips as a subclass of the more generic balloon % class \startconstants all framecommand: framecommand \stopconstants \def\defineballoon[#1][#2]{% \@EA\def\csname#1\endcsname {\dodoubleempty\doballoon[#1]}% \@EA\def\csname\e!stel#1\e!in\endcsname {\dodoubleempty\setupballon[#1]}% \setupballoon[#1][#2]} % Currently only supports framecommand \def\setupballoon[#1][#2]{% \getparameters[balloon:#1:][#2] } \def\doballoon[#1][#2]#3#4% {\bgroup \setupfields[\v!reset]% \useJSscripts[fld]% \setbox0\hbox {\mindermeldingen \nextsystemfield \trialtypesettingtrue \setbox0=\hbox{#3}% \trialtypesettingfalse \definesymbol [\currentsystemfield:txt] [{\getvalue{balloon:#1:\c!framecommand}{#4}}]% \trialtypesettingtrue \setbox2=\hbox{\symbol[\currentsystemfield:txt]}% \trialtypesettingfalse \definefield [\currentsystemfield:txt][check] [dummy][\currentsystemfield:txt][\currentsystemfield:txt]% \setupfield [dummy] [\c!kader=\v!uit, \c!gebieduit=JS(Hide_Field{\currentsystemfield:txt}), \c!optie=\v!verborgen]% \hbox to \zeropoint {\dimen0\wd2\advance\dimen0 -\wd0 \doifelse{#2}\v!links {\hskip-\dimen0} {\doif{#2}\v!midden {\hskip-.5\dimen0}}% \lower\openlineheight % this needs to be configurable \hbox to \zeropoint {\fitfield[\currentsystemfield:txt]}}% \dimen0=\ifdim\wd0=\zeropoint 3em\else\wd0\fi % Should the following be configurable too? \definesymbol [\currentsystemfield:but] [{\framed[\c!hoogte=2ex,\c!breedte=\dimen0,\c!kader=\v!uit]{}}]% \definefield [\currentsystemfield:but][push] [dummy][\currentsystemfield:but][\currentsystemfield:but]% \setupfield [dummy] [\c!kader=\v!uit, \c!optie=, \c!gebiedin=JS(Vide_Field{\currentsystemfield:txt}), \c!gebieduit=JS(Hide_Field{\currentsystemfield:txt})]% \lower2ex % this should be configurable \hbox to \zeropoint {\fitfield[\currentsystemfield:but]}% #3}% \ht0=\ht\strutbox\dp0=\dp\strutbox\box0 \egroup} % Redefines the old tooltip with the new command ... \defineballoon[tooltip][\c!framecommand={\inframed[\c!kader=\v!uit,\c!achtergrond=\v!raster]}] ===== END CODE ===== -- Giuseppe "Oblomov" Bilotta _______________________________________________ ntg-context mailing list ntg-context@ref.ntg.nl http://ref.ntg.nl/mailman/listinfo/ntg-context