diff options
author | Karl Berry <karl@freefriends.org> | 2009-11-22 00:08:06 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-11-22 00:08:06 +0000 |
commit | 85c2888835a33844b01fcf9a536dd6d481c99c49 (patch) | |
tree | 0eca919dcbbfb176d139c427781c67e4254066eb /Master/texmf-dist/tex | |
parent | 37c4a5be1d1d1c895526e9c5ae9e5918fb133d80 (diff) |
new latex package popupmenu (21oct09)
git-svn-id: svn://tug.org/texlive/trunk@16116 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/popupmenu/popupmenu.sty | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/popupmenu/popupmenu.sty b/Master/texmf-dist/tex/latex/popupmenu/popupmenu.sty new file mode 100644 index 00000000000..6a89759eb57 --- /dev/null +++ b/Master/texmf-dist/tex/latex/popupmenu/popupmenu.sty @@ -0,0 +1,79 @@ +%% +%% This is file `popupmenu.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% popupmenu.dtx (with options: `copyright,package') +%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% popupmenu.sty package, 2009-10-15 %% +%% Copyright (C) 2009 D. P. Story %% +%% dpstory@acrotex.net %% +%% storyd@nwfsc.edu %% +%% %% +%% This program can redistributed and/or modified under %% +%% the terms of the LaTeX Project Public License %% +%% Distributed from CTAN archives in directory %% +%% macros/latex/base/lppl.txt; either version 1 of the %% +%% License, or (at your option) any later version. %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{popupmenu} + [2009/10/20 v.7 Provides support for popup menus (dps)] +\RequirePackage{xkeyval} +\define@key{menustruct}{title}[]{\def\menustruct@title{#1}} +\define@boolkey{menustruct}{marked}[true]{} +\define@boolkey{menustruct}{enabled}[true]{} +\define@key{menustruct}{return}[]{\def\menustruct@return{#1}} +\let\pum@holdtoks\@empty +\newcommand{\@AddToMenuToks}{\g@addto@macro\pum@holdtoks} +\def\pum@updateindex{\advance\count\z@\@ne + \edef\pum@rc{\pum@topindex[\the\count\z@]}\edef\itemindex{'\pum@rc'}} +\def\pum@initIndexMenu#1{\count\z@=-1\relax\edef\pum@rc{#1}% + \edef\pum@topindex{\pum@rc}} +\newenvironment{popupmenu}[1]{\pum@initIndexMenu{}% + \let\pum@holdtoks\@empty + \toks@={\pum@mytab}\@makeother\~ + \gdef\msarg{#1}\@AddToMenuToks{\@gobble}% + \let\item\pum@item +}{% + \expandafter\xdef\csname\msarg\endcsname{% + var \msarg\space = [ \pum@holdtoks^^J];}% +} +\newcommand{\pum@item}[1]{\pum@updateindex + \setkeys{menustruct}{title,marked=false,enabled,return,#1}% + \edef\tmp@exp{,^^J\the\toks@ + {cName: "\menustruct@title"% + \ifKV@menustruct@marked, bMarked: true\fi% + \ifKV@menustruct@enabled\else, bEnabled: false\fi% + \ifx\menustruct@return\@empty\else, + cReturn: "\menustruct@return"\fi}}% + \expandafter\@AddToMenuToks\expandafter{\tmp@exp}% +} +\begingroup +\catcode`<=1 \catcode`\>=2 \@makeother\{ \@makeother\} +\gdef\pum@lbrace<{>\gdef\pum@rbrace<}> +\endgroup +\def\pum@mytab{\space\space\space\space} +\newenvironment{submenu}[1]{\pum@updateindex + \pum@initIndexMenu{\pum@rc.oSubMenu}\edef\temp@toks{\the\toks@}% + \toks@=\expandafter{\temp@toks\pum@mytab}% + \setkeys{menustruct}{title,marked=false,enabled,return,#1}% + \edef\tmp@exp{,^^J\the\toks@ + \noexpand\pum@lbrace cName: "\menustruct@title"% + \ifKV@menustruct@marked, bMarked: true\fi% + \ifKV@menustruct@enabled\else, bEnabled: false\fi, + oSubMenu:^^J\the\toks@[}% + \expandafter\@AddToMenuToks\expandafter{\tmp@exp\@gobble}% +}{% + \edef\tmp@exp{^^J\the\toks@ ]\pum@rbrace}% + \expandafter\@AddToMenuToks\expandafter{\tmp@exp}% +} +\def\popUpMenu(#1){app.popUpMenuEx.apply( app, #1 )} +\providecommand{\urlPath}[1]{\def\pum@urlName{#1}% + \hyper@normalise\pum@urlPath} +\def\pum@urlPath#1{\expandafter\xdef\pum@urlName{#1}} +\endinput +%% +%% End of file `popupmenu.sty'. |