From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/4077 Path: main.gmane.org!not-for-mail From: "Giuseppe Bilotta" Newsgroups: gmane.comp.tex.context Subject: My ideas for tooltips Date: Wed, 14 Feb 2001 22:34:12 +0100 Sender: owner-ntg-context@let.uu.nl Message-ID: <00a301c096d2$0f28bb00$a3ccfea9@nuovo> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0005_01C096D6.40DA7400" X-Trace: main.gmane.org 1035394767 22657 80.91.224.250 (23 Oct 2002 17:39:27 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 17:39:27 +0000 (UTC) Original-To: "ConTeXt" Xref: main.gmane.org gmane.comp.tex.context:4077 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:4077 This is a multi-part message in MIME format. ------=_NextPart_000_0005_01C096D6.40DA7400 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit The attached file presents my latest ideas on tooltips, with some tests (in Italian, but even if you don't understand what's written, it doesn't matter). The only point is: displayed formulas don't work. Any ideas on why? (the relative text is commented out). Giuseppe Bilotta Using Microsoft products is like having sex without condoms---but much less pleasurable ------=_NextPart_000_0005_01C096D6.40DA7400 Content-Type: application/octet-stream; name="gb-tips.tex" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="gb-tips.tex" \unprotect=0A= =0A= \def\gbtooltip%=0A= {\dosingleempty\dogbtooltip}=0A= \newdimen\gbarea=0A= \newdimen\gbwidth=0A= \newcount\gbtrunc=0A= \newcount\gbintarea=0A= =0A= \long\def\dogbtooltip[#1]#2#3%=0A= {\bgroup =0A= \setupfields[\v!reset]%=0A= \useJSscripts[fld]%=0A= \setbox0=3D\hbox=0A= {\mindermeldingen=0A= \nextsystemfield=0A= \setbox0=3D\hbox{#2}%=0A= \setbox2\hbox{#3}%=0A= \gbarea\ht2\advance\gbarea by\dp2%=0A= \dimensiontocount{\gbarea}{\gbintarea}%=0A= \dimensiontocount{\wd2}{\gbtrunc}%=0A= \multiply\gbintarea by\gbtrunc%=0A= \divide\gbintarea by2% l=3D \sqrt{\frac{A}{2}}=0A= \findlines%=0A= \definesymbol=0A= [\currentsystemfield:txt]=0A= [{\framed[\c!kader=3D\v!uit,\c!achtergrond=3D\v!raster]%=0A= {\hbox{\vbox{\hsize\gbwidth\relax#3}}}}]%=0A= \setbox2=3D\hbox{\symbol[\currentsystemfield:txt]}%=0A= \definefield=0A= [\currentsystemfield:txt][check]=0A= [dummy][\currentsystemfield:txt][\currentsystemfield:txt]%=0A= \setupfield=0A= [dummy]=0A= [\c!kader=3D\v!uit,\c!optie=3D\v!verborgen]%=0A= \hbox to \!!zeropoint=0A= {\dimen0=3D\wd2\advance\dimen0 by -\wd0=0A= \doifelse{#1}{\v!links}=0A= {\hskip-\dimen0}=0A= {\doif{#1}{\v!midden}=0A= {\hskip-.5\dimen0}}%=0A= \dimen0\ht2\advance\dimen0by\dp2%=0A= \advance\dimen0by.5\openlineheight=0A= \lower\dimen0\hbox to \!!zeropoint=0A= {\fitfield[\currentsystemfield:txt]}}%=0A= \dimen0=3D\ifdim\wd0=3D\!!zeropoint 3em\else\wd0\fi=0A= \definesymbol=0A= [\currentsystemfield:but]=0A= = [{\framed[\c!hoogte=3D2ex,\c!breedte=3D\dimen0,\c!kader=3D\v!uit]{}}]%=0A= \definefield=0A= [\currentsystemfield:but][push]=0A= [dummy][\currentsystemfield:but][\currentsystemfield:but]%=0A= \setupfield=0A= [dummy]=0A= [\c!kader=3D\v!uit,=0A= \c!optie=3D,=0A= \c!gebiedin=3DJS(Vide_Field{\currentsystemfield:txt}),=0A= \c!gebieduit=3DJS(Hide_Field{\currentsystemfield:txt})]%=0A= \lower\ht0\hbox to \!!zeropoint=0A= {\fitfield[\currentsystemfield:but]}%=0A= #2}%=0A= \ht0=3D\ht\strutbox\dp0=3D\dp\strutbox\box0=0A= \egroup}=0A= =0A= \newcount\gblines=0A= \newcount\gbtemparea=0A= \def\findlines{% Find the number of lines that better fit the area=0A= \gblines0\relax%=0A= \loop\advance\gblines1%=0A= \dimensiontocount{\strutheight}{\gbtemparea}%=0A= \multiply\gbtemparea\gblines%=0A= \multiply\gbtemparea\gbtemparea%=0A= \ifnum\gbtemparea<\gbintarea\repeat%=0A= \gbwidth\strutheight\multiply\gbwidth by\gblines%=0A= \multiply\gbwidth by2\relax%=0A= }=0A= \protect=0A= =0A= \setupinteraction[state=3Dstart,openaction=3DResetForm]=0A= =0A= \useencoding[windows]=0A= \starttext=0A= =0A= %\tracingmacros=3D2=0A= Ecco del testo con un mio \gbtooltip[middle]{tooltip}{Questo tooltip = dovrebbe avere=0A= un rettangolo con dimensioni circa in rapporto due ad uno}; facciamo=0A= \gbtooltip{ancora una prova}{\switchtobodyfont[small]=0A= Stavolta con qualcosa di molto pi=F9 lungo; e perch=E9 no, mettiamoci=0A= anche una formula, $x^2+y^2=3Dr^2$, tanto per vedere come si comporta il=0A= \TeX\ in queste situazioni~\dots\ sembra che si comporti molto bene;=0A= allunghiamo ancora per essere sicuri che il rapporto 2:1 (in effetti = minore)=0A= vada bene anche per testi molto lunghi. Sembra non dare nessun = fastidio~\dots\=0A= e se lo definissimo \tex{long} ed usassimo un \tex{par} in mezzo, come = sarebbe?=0A= Non possiamo perch=E9 \CONTEXT\ definisce \tex{definesymbol} come = non-\tex{long}.=0A= Hm. Comunque, questo testo =E8 posizionato vicino al bordo della pagina; = sembra=0A= che AcroRead non se ne curi, e sposti la finestra per farla rientrare = nell'area=0A= visibile; ora faremo qualche esperimento a zoom diversi per esserne = sicuri.=0A= No, pare di no. Se =E8 troppo grosso va fuori. Bene.}; infine ne = facciamo un'altra,=0A= perch=E9 voglio togliermi una \gbtooltip[right]{curiosit=E0}{La = curiosit=E0 consiste=0A= nel sapere come si comporta il mio algoritmo in presenza di cose tipo=0A= %\placeformula\startformula=0A= %\sin^2 \alpha + \cos^2\alpha =3D 1,=0A= %\stopformula=0A= ovvero la cosiddetta {\en displayed math}}.=0A= %\tracingmacros=3D0=0A= \stoptext ------=_NextPart_000_0005_01C096D6.40DA7400--