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

* Re: [NTG-context] Frames (collection of)
  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
  0 siblings, 2 replies; 12+ messages in thread
From: Jens-Uwe Morawski @ 2002-10-17 23:52 UTC (permalink / raw)


On Thu, 17 Oct 2002 19:06:12 +0200
Giuseppe Bilotta <gip.bilotta@iol.it> wrote:

> Hello,
> 
> I'm working on an extension of tooltips (see attached file) whose
> primary goal is for use "instead of" footnotes in interactive
> documents.
 
> Suggestions for improvements are more than welcome

I really would like to see this feature as part of the core:
\setupfootnotes[...,location=tooltip,...]

This way one can use the normal \footnote command for a print
and interactive version of a document.

Jens
_______________________________________________
ntg-context mailing list
ntg-context@ref.ntg.nl
http://ref.ntg.nl/mailman/listinfo/ntg-context


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

* Re: [NTG-context] Frames (collection of)
  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
  1 sibling, 0 replies; 12+ messages in thread
From: Bruce D'Arcus @ 2002-10-18  0:50 UTC (permalink / raw)



On Thursday, October 17, 2002, at 07:52 PM, Jens-Uwe Morawski wrote:

>>
>> I'm working on an extension of tooltips (see attached file) whose
>> primary goal is for use "instead of" footnotes in interactive
>> documents.
>
>> Suggestions for improvements are more than welcome
>
> I really would like to see this feature as part of the core:
> \setupfootnotes[...,location=tooltip,...]
>
> This way one can use the normal \footnote command for a print
> and interactive version of a document.

I agree.  I was thinking about this issue recently with HTML (why 
bother putting footnote/endnote text at the end of a page when you can 
put it in a tooltip?).

It might (?) be worthwhile to also have an option for tooltip display 
of bibliographic references as well...

Bruce

_______________________________________________
ntg-context mailing list
ntg-context@ref.ntg.nl
http://ref.ntg.nl/mailman/listinfo/ntg-context


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

* Re[2]: [NTG-context] Frames (collection of)
  2002-10-17 23:52 ` Jens-Uwe Morawski
  2002-10-18  0:50   ` Bruce D'Arcus
@ 2002-10-18 13:04   ` Giuseppe Bilotta
  2002-10-19 10:48     ` Jens-Uwe Morawski
  1 sibling, 1 reply; 12+ messages in thread
From: Giuseppe Bilotta @ 2002-10-18 13:04 UTC (permalink / raw)
  Cc: ntg-context


Friday, October 18, 2002 Jens-Uwe Morawski wrote:

JUM> On Thu, 17 Oct 2002 19:06:12 +0200
JUM> Giuseppe Bilotta <gip.bilotta@iol.it> wrote:

>> Hello,
>> 
>> I'm working on an extension of tooltips (see attached file) whose
>> primary goal is for use "instead of" footnotes in interactive
>> documents.
 
>> Suggestions for improvements are more than welcome

JUM> I really would like to see this feature as part of the core:
JUM> \setupfootnotes[...,location=tooltip,...]

JUM> This way one can use the normal \footnote command for a print
JUM> and interactive version of a document.

There are at least three things that need to be done to add this
to the core in a fully ConTeXtish way:

(1) add frame classes
(2) add tooltip classes
(3) have footnotes accept "tooltip" as an option

Something which might also be needed is a more complex "show"
command for the tip, so that it always shows on screen (if it
fits). I don't know if this can be done though, and it surely has
a lower priority than the above three. Hans?

-- 
Giuseppe "Oblomov" Bilotta

_______________________________________________
ntg-context mailing list
ntg-context@ref.ntg.nl
http://ref.ntg.nl/mailman/listinfo/ntg-context


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

* Re: Re[2]: [NTG-context] Frames (collection of)
  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
  0 siblings, 1 reply; 12+ messages in thread
From: Jens-Uwe Morawski @ 2002-10-19 10:48 UTC (permalink / raw)


On Fri, 18 Oct 2002 15:04:10 +0200
Giuseppe Bilotta <gip.bilotta@iol.it> wrote:

> 
> Friday, October 18, 2002 Jens-Uwe Morawski wrote:
> 
> JUM> On Thu, 17 Oct 2002 19:06:12 +0200
> JUM> Giuseppe Bilotta <gip.bilotta@iol.it> wrote:
> 
> >> Hello,
> >> 
> >> I'm working on an extension of tooltips (see attached file) whose
> >> primary goal is for use "instead of" footnotes in interactive
> >> documents.
>  
> >> Suggestions for improvements are more than welcome
> 
> JUM> I really would like to see this feature as part of the core:
> JUM> \setupfootnotes[...,location=tooltip,...]
> 
> JUM> This way one can use the normal \footnote command for a print
> JUM> and interactive version of a document.
> 
> There are at least three things that need to be done to add this
> to the core in a fully ConTeXtish way:
> 
> (1) add frame classes

if you mean something like
\defineframed[<name>]
\setupframed[<name>][...]
\<name>{..text..}

then i think this on the wish list of many ConteXt users.
Commands that currently support framed-parameters could then
support a parameter framedclass=<name>

> (2) add tooltip classes

in the other mail-thread we agree that for tooltips the whole word
should be an active area. IMO, this is not the best solution. If we
can use tooltips for footnotes or bib-entries in the future, those
elements will show a mark/symbol in the text, but for normal tooltips
the problem is that nothing shows the reader of the document that
there is a tooltip available. I think it is not a common practice to
read a document and scan constantly the words with the pointing
device. Thus, there should be also for normal tooltips a symbol or
something else that indicates the tooltip.

Best,
  Jens
_______________________________________________
ntg-context mailing list
ntg-context@ref.ntg.nl
http://ref.ntg.nl/mailman/listinfo/ntg-context


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

* Re[4]: [NTG-context] Frames (collection of)
  2002-10-19 10:48     ` Jens-Uwe Morawski
@ 2002-10-19 12:31       ` Giuseppe Bilotta
  2002-10-20 16:51         ` Hans Hagen
  0 siblings, 1 reply; 12+ messages in thread
From: Giuseppe Bilotta @ 2002-10-19 12:31 UTC (permalink / raw)
  Cc: ntg-context


Saturday, October 19, 2002 Jens-Uwe Morawski wrote:

>> (1) add frame classes

JUM> if you mean something like
JUM> \defineframed[<name>]
JUM> \setupframed[<name>][...]
JUM> \<name>{..text..}

JUM> then i think this on the wish list of many ConteXt users.
JUM> Commands that currently support framed-parameters could then
JUM> support a parameter framedclass=<name>

That's exactly what I mean.

>> (2) add tooltip classes

JUM> in the other mail-thread we agree that for tooltips the whole word
JUM> should be an active area. IMO, this is not the best solution. If we
JUM> can use tooltips for footnotes or bib-entries in the future, those
JUM> elements will show a mark/symbol in the text, but for normal tooltips
JUM> the problem is that nothing shows the reader of the document that
JUM> there is a tooltip available. I think it is not a common practice to
JUM> read a document and scan constantly the words with the pointing
JUM> device. Thus, there should be also for normal tooltips a symbol or
JUM> something else that indicates the tooltip.

If we have tooltip classes, these options (including size and
fitting of the active area to the content) could be configured per
class.

-- 
Giuseppe "Oblomov" Bilotta

_______________________________________________
ntg-context mailing list
ntg-context@ref.ntg.nl
http://ref.ntg.nl/mailman/listinfo/ntg-context


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

* Re[4]: [NTG-context] Frames (collection of)
  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
  0 siblings, 2 replies; 12+ messages in thread
From: Hans Hagen @ 2002-10-20 16:51 UTC (permalink / raw)
  Cc: Jens-Uwe Morawski, ntg-context

At 02:31 PM 10/19/2002 +0200, Giuseppe Bilotta wrote:

>Saturday, October 19, 2002 Jens-Uwe Morawski wrote:
>
> >> (1) add frame classes
>
>JUM> if you mean something like
>JUM> \defineframed[<name>]
>JUM> \setupframed[<name>][...]
>JUM> \<name>{..text..}
>
>JUM> then i think this on the wish list of many ConteXt users.
>JUM> Commands that currently support framed-parameters could then
>JUM> support a parameter framedclass=<name>
>
>That's exactly what I mean.

ah, and i thought that you were reading sources -) but you've missed this 
one: there is actually something \defineframed already, also for local 
purposes there are \presetlocalframed and \localframed used all around context

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

_______________________________________________
ntg-context mailing list
ntg-context@ref.ntg.nl
http://ref.ntg.nl/mailman/listinfo/ntg-context


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

* Re[5]: [NTG-context] Frames (collection of)
  2002-10-20 16:51         ` Hans Hagen
@ 2002-10-20 19:39           ` Giuseppe Bilotta
  2002-10-21 11:46           ` Re[4]: " Jens-Uwe Morawski
  1 sibling, 0 replies; 12+ messages in thread
From: Giuseppe Bilotta @ 2002-10-20 19:39 UTC (permalink / raw)
  Cc: ntg-context


Sunday, October 20, 2002 Hans Hagen wrote:
>> >> (1) add frame classes
>>
>>JUM> if you mean something like
>>JUM> \defineframed[<name>]
>>JUM> \setupframed[<name>][...]
>>JUM> \<name>{..text..}
>>
>>JUM> then i think this on the wish list of many ConteXt users.
>>JUM> Commands that currently support framed-parameters could then
>>JUM> support a parameter framedclass=<name>
>>
>>That's exactly what I mean.

HH> ah, and i thought that you were reading sources -) but you've missed this 
HH> one: there is actually something \defineframed already, also for local 
HH> purposes there are \presetlocalframed and \localframed used all around context

Hey mister, I *do* read the sources 8D but I just happen to not be
able to keep all of them in mind at the same time 8D

I'll have a look at this. Also, what about tooltip-like things?

-- 
Giuseppe "Oblomov" Bilotta

_______________________________________________
ntg-context mailing list
ntg-context@ref.ntg.nl
http://ref.ntg.nl/mailman/listinfo/ntg-context


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

* Re: Re[4]: [NTG-context] Frames (collection of)
  2002-10-20 16:51         ` Hans Hagen
  2002-10-20 19:39           ` Re[5]: " Giuseppe Bilotta
@ 2002-10-21 11:46           ` Jens-Uwe Morawski
  2002-10-21 13:13             ` Re[6]: " Giuseppe Bilotta
  2002-10-21 13:31             ` Re[4]: " Taco Hoekwater
  1 sibling, 2 replies; 12+ messages in thread
From: Jens-Uwe Morawski @ 2002-10-21 11:46 UTC (permalink / raw)


On Sun, 20 Oct 2002 18:51:21 +0200
Hans Hagen <pragma@wxs.nl> wrote:

> At 02:31 PM 10/19/2002 +0200, Giuseppe Bilotta wrote:
> 
> >Saturday, October 19, 2002 Jens-Uwe Morawski wrote:
> >
> > >> (1) add frame classes
> >
> >JUM> if you mean something like
> >JUM> \defineframed[<name>]
> >JUM> \setupframed[<name>][...]
> >JUM> \<name>{..text..}
> >
> >JUM> then i think this on the wish list of many ConteXt users.
> >JUM> Commands that currently support framed-parameters could then
> >JUM> support a parameter framedclass=<name>
> >
> >That's exactly what I mean.
> 
> ah, and i thought that you were reading sources -) but you've missed this 
> one: there is actually something \defineframed already, also for local 
> purposes there are \presetlocalframed and \localframed used all around context

Giuseppe has the advantage to be able to read the sources, but not me.
Can you please give a short summary about how the macros you mentioned
can be used. I've tried the interface: 
\defineframed[<name>]
\setupframed[<name>][...]
\<name>{..text..}

but besides \defineframed it is not working.

Thanks.
  Jens
_______________________________________________
ntg-context mailing list
ntg-context@ref.ntg.nl
http://ref.ntg.nl/mailman/listinfo/ntg-context


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

* Re[6]: [NTG-context] Frames (collection of)
  2002-10-21 11:46           ` Re[4]: " Jens-Uwe Morawski
@ 2002-10-21 13:13             ` Giuseppe Bilotta
  2002-10-21 13:31             ` Re[4]: " Taco Hoekwater
  1 sibling, 0 replies; 12+ messages in thread
From: Giuseppe Bilotta @ 2002-10-21 13:13 UTC (permalink / raw)
  Cc: ntg-context


Monday, October 21, 2002 Jens-Uwe Morawski wrote:

JUM> Giuseppe has the advantage to be able to read the sources, but not me.
JUM> Can you please give a short summary about how the macros you mentioned
JUM> can be used. I've tried the interface: 
JUM> \defineframed[<name>]
JUM> \setupframed[<name>][...]
JUM> \<name>{..text..}

JUM> but besides \defineframed it is not working.

Indeed it seems \setupframed does not accept <name>s, and
\setup<name> does not exist either.

It seems to work with \defineframedtext, though. Hans, what's the
difference between the two?

-- 
Giuseppe "Oblomov" Bilotta

_______________________________________________
ntg-context mailing list
ntg-context@ref.ntg.nl
http://ref.ntg.nl/mailman/listinfo/ntg-context


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

* Re: Re[4]: [NTG-context] Frames (collection of)
  2002-10-21 11:46           ` Re[4]: " Jens-Uwe Morawski
  2002-10-21 13:13             ` Re[6]: " Giuseppe Bilotta
@ 2002-10-21 13:31             ` Taco Hoekwater
  2002-10-21 20:30               ` Jens-Uwe Morawski
  1 sibling, 1 reply; 12+ messages in thread
From: Taco Hoekwater @ 2002-10-21 13:31 UTC (permalink / raw)
  Cc: ntg-context


The \setupframed doesnt work precisely this way. Here is a 'real life' example:


\defineframed[warning]
	[background=color,
        backgroundcolor=red,
        frame=on]
\setupcolors[state=start]

\starttext
\warning{Look out!}
\stoptext


On Mon, 21 Oct 2002 13:46:58 +0200, Jens-Uwe wrote:

> Giuseppe has the advantage to be able to read the sources, but not me.
> Can you please give a short summary about how the macros you mentioned
> can be used. I've tried the interface: 
> \defineframed[<name>]
> \setupframed[<name>][...]
> \<name>{..text..}
> 
> but besides \defineframed it is not working.
> 
> Thanks.
>   Jens
> _______________________________________________
> ntg-context mailing list
> ntg-context@ref.ntg.nl
> http://ref.ntg.nl/mailman/listinfo/ntg-context


-- 
groeten,

Taco
_______________________________________________
ntg-context mailing list
ntg-context@ref.ntg.nl
http://ref.ntg.nl/mailman/listinfo/ntg-context


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

* Re: Re[4]: [NTG-context] Frames (collection of)
  2002-10-21 13:31             ` Re[4]: " Taco Hoekwater
@ 2002-10-21 20:30               ` Jens-Uwe Morawski
  0 siblings, 0 replies; 12+ messages in thread
From: Jens-Uwe Morawski @ 2002-10-21 20:30 UTC (permalink / raw)


On Mon, 21 Oct 2002 15:31:38 +0200
Taco Hoekwater <taco@elvenkind.com> wrote:

> 
> The \setupframed doesnt work precisely this way.

Grmmph. :)

>Here is a 'real life' example:
> \defineframed[warning]
> 	[background=color,
>         backgroundcolor=red,
>         frame=on]
> \setupcolors[state=start]
> 
> \starttext
> \warning{Look out!}
> \stoptext

Many thanks.

Best,
  Jens
_______________________________________________
ntg-context mailing list
ntg-context@ref.ntg.nl
http://ref.ntg.nl/mailman/listinfo/ntg-context


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