ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] Frames (collection of)
@ 2002-10-17 17:06 Giuseppe Bilotta
  2002-10-17 23:52 ` Jens-Uwe Morawski
  0 siblings, 1 reply; 12+ messages in thread
From: Giuseppe Bilotta @ 2002-10-17 17:06 UTC (permalink / raw)


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

Hello,

I'm working on an extension of tooltips (see attached file) whose
primary goal is for use "instead of" footnotes in interactive
documents. While I managed to write the core of the stuff in a
rather short time, I need some changes in the core to make sure
they work fully as designed.

In particular, I need two things:

(1) a way to disable counter increments during trial typesetting
(2) a way to define "classes" of frames, with specific options to
be set (once and for all, but configurable by the user)
independently of the frame settings. (Just like for itemgroups).

Could these be implemented in the ConTeXt core?

-- 
Giuseppe "Oblomov" Bilotta

P.S. A short notice on how I use them:

  \usemodule[xtips]
  \long\def\footnote#1{%
       \long\def\fncontent{%
          \tf\switchtobodyfont[xx]\setupinterlinespace#1\par}%
       \xtooltip{\blue\high{*}}{\fncontent}%
       }


Suggestions for improvements are more than welcome

[-- Attachment #2: t-xtips.tex --]
[-- Type: application/octet-stream, Size: 3378 bytes --]

%D \module
%D   [      file=t-tips,
%D        version=2002.10.17,
%D          title=\CONTEXT\ Style File,
%D       subtitle=Extended Tooltips,
%D         author=Giuseppe Bilotta,
%D           date=\currentdate,
%D      copyright={Giuseppe Bilotta}]

\newdimen\xtooltipwidth
\newdimen\xtooltipheight
\newbox\xtooltipbox

\long\def\xtooltipfindwidth#1{% Find the best width
    \dontcomplain
    \setbox\xtooltipbox\vbox{#1}%
    \xtooltipwidth\wd\xtooltipbox
    \advance\xtooltipwidth10pt
    \loop
      \advance\xtooltipwidth-10pt
      \setbox\xtooltipbox\vbox{\hsize\xtooltipwidth#1}%
      \xtooltipheight\ht\xtooltipbox\advance\xtooltipheight\dp\xtooltipbox
      \multiply\xtooltipheight2\relax
      \ifnum\xtooltipwidth>\xtooltipheight
    \repeat
    \advance\xtooltipwidth10pt
    }

\def\xtooltip%
  {\dosingleempty\doxtooltip}

% FIXME: this is to prevent formula counters from increasing.
% Must be fixed in core!
\let\originaldododoformulenummer\dododoformulenummer

\long\def\doxtooltip[#1]#2#3{%
  % Speedup: since tooltips don't change the actual typesetting,
  % we save time by not typesetting them during trial runs.
  % We *might* need to put something like an 
  % \hbox{#2} during trials, though. I need to test this.
  \iftrialtypesetting\else
  \bgroup
    % Determine size for tooltip box
    \trialtypesettingtrue
    \def\dododoformulenummer##1##2##3##4{}% No formula numbers
    \xtooltipfindwidth{#3}%
    % End
    \long\def\xtooltipcontent{%
      \vbox{\hsize\xtooltipwidth\relax#3}}%
    \setupframed[framecorner=round,corner=round,align=normal,offset=5pt]%
    % We have to change the previous, make it customizable
    % Something like a tooltipframe ...
    \trialtypesettingfalse
    \let\dododoformulenummer\originaldododoformulenummer
    \let\inframed\framed
    \tooltip[#1]{#2}\xtooltipcontent\relax
  \egroup
  \fi}

\endinput

\setupcolors[state=start]
\setupinteraction[state=start]

\useencoding[windows]
\starttext
Ecco del testo con un mio \gbtooltip[middle]{tooltip}{Questo
tooltip dovrebbe avere un rettangolo con dimensioni circa in
rapporto due ad uno}; facciamo \gbtooltip{ancora una
prova}{\switchtobodyfont[small] Stavolta con qualcosa di molto più
lungo; e perché no, mettiamoci anche una formula, $x^2+y^2=r^2$,
tanto per vedere come si comporta il \TeX\ in queste
situazioni~\dots\ sembra che si comporti molto bene; allunghiamo
ancora per essere sicuri che il rapporto 2:1 (in effetti minore)
vada bene anche per testi molto lunghi. Sembra non dare nessun
fastidio~\dots\ e se lo definissimo \tex{long} ed usassimo un
\tex{par} in mezzo, come sarebbe? Non possiamo perché \CONTEXT\
definisce \tex{definesymbol} come non-\tex{long}. Hm. Comunque,
questo testo è posizionato vicino al bordo della pagina; sembra
che AcroRead non se ne curi, e sposti la finestra per farla
rientrare nell'area visibile; ora faremo qualche esperimento
a zoom diversi per esserne sicuri. No, pare di no. Se è troppo
grosso va fuori. Bene.}; infine ne facciamo un'altra, perché
voglio togliermi una \gbtooltip[right]{curiosità}{La curiosità
consiste nel sapere come si comporta il mio algoritmo in presenza
di cose tipo
\placeformula\startformula
\sin^2 \alpha + \cos^2\alpha = 1,
\stopformula
ovvero la cosiddetta {\en displayed math}}.
\stoptext 

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

end of thread, other threads:[~2002-10-21 20:30 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-17 17:06 [NTG-context] Frames (collection of) Giuseppe Bilotta
2002-10-17 23:52 ` Jens-Uwe Morawski
2002-10-18  0:50   ` Bruce D'Arcus
2002-10-18 13:04   ` Re[2]: " Giuseppe Bilotta
2002-10-19 10:48     ` Jens-Uwe Morawski
2002-10-19 12:31       ` Re[4]: " Giuseppe Bilotta
2002-10-20 16:51         ` Hans Hagen
2002-10-20 19:39           ` Re[5]: " Giuseppe Bilotta
2002-10-21 11:46           ` Re[4]: " Jens-Uwe Morawski
2002-10-21 13:13             ` Re[6]: " Giuseppe Bilotta
2002-10-21 13:31             ` Re[4]: " Taco Hoekwater
2002-10-21 20:30               ` Jens-Uwe Morawski

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