Loading ...
Sorry, an error occurred while loading the content.

19013Re: Navigate Outline Clip

Expand Messages
  • vanwasdi
    Mar 13, 2009
    • 0 Attachment
      Final version. Many thanks to Sheri.

      H="Navigate Outline"
      ;pops up a wizard with outline headings sorted in ascending order
      ;allows to navigate with keyboard (e.g. first caracter of heading, ;PageUp/PageDown)
      ;thanks to Sheri for the helpful suggestions

      ;check if outline if not end
      ^!IfTrue ^$IsOutlineDoc$ Outline ELSE Next
      ^!Info No outline! Clip stops.
      ^!Goto End


      ;loop to gather topic headings
      ^!Set %Counter%=1
      ^!Set %Headings%=

      ;For performance, you can set the status text before and after your
      ;loop. Otherwise the status text is constantly updating and if there
      ;are many topics that can actually slow down the execution.
      ^!SetHintInfo Getting Headers
      ^!If ^%Counter% > ^$GetTopicCount$ SortHeadings
      ^!Set %Headings%=^%Headings%^$GetTopicName(^%Counter%)$^%NL%
      ^!Inc Counter
      ^!GoTo GatherHeadings

      ;sort headings
      ^!Set %Headings%=^$StrSort("^%Headings%";False;True;False)$
      ;replace hard returns with | to prepare for wizard
      ^!Set %Headings%=^$StrReplace("^p";"|";"^%Headings%";True;False)$

      ;underscore necessary for navigation
      ;Notetab currently restricts the heigth of the wizard to 34
      ^!SetWizardWidth 150
      ^!Set %ChoosenHeading%=^?{(T=L;H=34)Which heading=_^%Headings%}

      ;goto choosen headng
      ^!TopicShow "^%ChoosenHeading%"

      ;clear variables
      ^!ClearVariable ^%Counter%
      ^!ClearVariable ^%Headings%
      ^!ClearVariable ^%ChoosenHeading%
    • Show all 6 messages in this topic