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

Re: Navigate Outline Clip

Expand Messages
  • vanwasdi
    ... This was very helpful! Thank you! Dirk ADAPTED CLIP ... H= Navigate Outline ;check if outline if not end ^!If ^$IsOutlineDoc$ = 1 Skip_2 ELSE Next ^!Info
    Message 1 of 6 , Mar 11, 2009
    • 0 Attachment
      --- In ntb-clips@yahoogroups.com, "Sheri" <silvermoonwoman@...> wrote:
      >
      > --- In ntb-clips@yahoogroups.com, "vanwasdi" <dirk.vanwassenhove@> wrote:
      > >
      > > This working clip popups a wizard to navigate an outline. I have some questions to refine it.
      > >
      > > CLIP
      > > -------------------------------------------------
      > > H="Navigate Outline"
      > > ;check if outline if not end
      > > ^!If ^$IsOutlineDoc$ = 1 Skip_2 ELSE Next
      > > ^!Info No outline! Clip stops.
      > > ^!Goto End
      > >
      > > ;clear variables en save document
      > > ^!ClearVariables
      > > ^!Save
      > >
      > > ;set focus to headings window and copy headings to clipboard
      > > ^!SetFocus OutLine
      > > ^!Keyboard Shift+F10 T
      > >
      > > ;sort headings
      > > ^!Set %Headings%=^$StrSort("^$GetClipboard$";False;True;False)$
      > >
      > > ;replace hard returns with | to prepare the content of the wizard
      > > ^!Set %Headings%=^$StrReplace("^p";"|";"^%Headings%";True;False)$
      > >
      > > ;wizard
      > > ^!Set %ChoosenHeading%=^?{(T=L;H=100)Type Choose a value=^%Headings%}
      > >
      > > ;goto choosen headng
      > > ^!TopicShow "^%ChoosenHeading%"
      > > ^!FocusDoc
      > > -------------------------------------------------
      > >
      > > QUESTIONS
      > >
      > > 1. As you can see the height of the wizard is set to 100 (H=100) but Notetab restricts that height to 35 or so. Is there a solution to that problem?
      >
      > I think you discovered a bug. If you use a setting greater than 34, it creates a second vertical scrollbar. Solution, do not use a setting greater than 34.
      >
      > > 2. When you have document with to much heading to fit in the wizard, you can not reach the last headings without using the mouse. When you chose the END key the last item is selected, but you can not see it. Any ideas?
      >
      > Using H=34 or less solves the problem. Otherwise you need to scroll the extra scrollbar to see the bottom.
      >
      > > 3.Can I set the width of the wizard?
      >
      > ^!SetWizardWidth npercent is available since version 5.7. For example ^!SetWizardWidth 200 sets wizards to be be twice as wide as normal.
      > >
      >
      > Here are a few other suggestions:
      >
      > 1. Do not use ^!ClearVariables. Clear only the variables used by your clip, so variables you may want to preserve (that exist in other clips) are not affected. Clear your individual variables at the end of the clip.
      >
      > 2. Don't use ^!Keyboard in your process to get the outline headers, not necessary and not reliable. You can use a loop with ^$GetTopicHeading(index)$. Where you do use ^!Keyboard, you need ample delays around it, to make sure the keystrokes hit the right window. When I first tried your clip, other existing clipboard text ended up in my wizard.
      >
      > 3. Don't use the clipboard, use a variable (which you clear at the end). Why bother the clipboard unless you need it? When you do need it, save the existing content and restore it afterwards.
      >
      > 4. Add an underscore to the beginning of the listbox content, that way there will be a selection bar at the top of the wizard, and it can be advanced using the keyboard.
      >
      > Hope helpful.
      >
      > Regards,
      > Sheri
      >
      -------------------------------------------------

      This was very helpful! Thank you!
      Dirk

      ADAPTED CLIP
      -------------------------------------------------
      H="Navigate Outline"
      ;check if outline if not end
      ^!If ^$IsOutlineDoc$ = 1 Skip_2 ELSE Next
      ^!Info No outline! Clip stops.
      ^!Goto End

      ;save document
      ^!Save

      ;loop to gather topic headings
      ^!Set %Counter%=1
      ^!Set %Headings%=
      :GatherHeadings
      ^!If ^%Counter% > ^$GetTopicCount$ SortHeadings
      ^!Set %Headings%=^%Headings%^$GetTopicName(^%Counter%)$|
      ^!Inc Counter
      ^!GoTo GatherHeadings

      :SortHeadings
      ^!Set %Headings%=^$StrSort("^%Headings%";False;True;False)$

      ;wizard
      ^!SetWizardWidth 150
      ^!Set %ChoosenHeading%=^?{(T=L;H=34)Which heading=_^%Headings%}

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

      ;clear variables
      ^!ClearVariable ^%Counter%
      ^!ClearVariable ^%Headings%
      ^!ClearVariable ^%ChoosenHeading%
    • Sheri
      ... Great, glad that helped! Here s a couple more little hints, ... 1. There are ^!IfTrue and ^!IfFalse commands, which would be slightly more direct than
      Message 2 of 6 , Mar 11, 2009
      • 0 Attachment
        --- In ntb-clips@yahoogroups.com, "vanwasdi" <dirk.vanwassenhove@...> wrote:
        >
        > This was very helpful! Thank you!
        > Dirk
        >
        > ADAPTED CLIP
        > -------------------------------------------------
        > H="Navigate Outline"
        > ;check if outline if not end
        > ^!If ^$IsOutlineDoc$ = 1 Skip_2 ELSE Next
        > ^!Info No outline! Clip stops.
        > ^!Goto End
        >
        > ;save document
        > ^!Save
        >
        > ;loop to gather topic headings
        > ^!Set %Counter%=1
        > ^!Set %Headings%=
        > :GatherHeadings
        > ^!If ^%Counter% > ^$GetTopicCount$ SortHeadings
        > ^!Set %Headings%=^%Headings%^$GetTopicName(^%Counter%)$|
        > ^!Inc Counter
        > ^!GoTo GatherHeadings
        >
        > :SortHeadings
        > ^!Set %Headings%=^$StrSort("^%Headings%";False;True;False)$
        >
        > ;wizard
        > ^!SetWizardWidth 150
        > ^!Set %ChoosenHeading%=^?{(T=L;H=34)Which heading=_^%Headings%}
        >
        > ;goto choosen headng
        > ^!TopicShow "^%ChoosenHeading%"
        > ^!FocusDoc
        >
        > ;clear variables
        > ^!ClearVariable ^%Counter%
        > ^!ClearVariable ^%Headings%
        > ^!ClearVariable ^%ChoosenHeading%
        >

        Great, glad that helped! Here's a couple more little hints,

        > ^!If ^$IsOutlineDoc$ = 1 Skip_2 ELSE Next

        1. There are ^!IfTrue and ^!IfFalse commands, which would be slightly more direct than plain ^!If in this case.

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

        For example, before :GatherHeadings, use

        ^!SetHintInfo Getting Headers

        and then in the next section, :SortHeadings, use

        ^!SetHintInfo

        With that change, I don't think you'll notice any difference in speed between your loop and the previous clip's grabbing all topics at once from the clipboard.

        Regards,
        Sheri
      • vanwasdi
        Final version. Many thanks to Sheri. Dirk CLIP ... H= Navigate Outline ;pops up a wizard with outline headings sorted in ascending order ;allows to navigate
        Message 3 of 6 , Mar 13, 2009
        • 0 Attachment
          Final version. Many thanks to Sheri.
          Dirk

          CLIP
          -------------------------------------------------
          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
          ;http://tech.groups.yahoo.com/group/ntb-clips/message/19011

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

          :Outline


          ;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
          :GatherHeadings
          ^!If ^%Counter% > ^$GetTopicCount$ SortHeadings
          ^!Set %Headings%=^%Headings%^$GetTopicName(^%Counter%)$^%NL%
          ^!Inc Counter
          ^!GoTo GatherHeadings


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

          ;wizard
          ;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%"
          ^!FocusDoc

          ;clear variables
          ^!ClearVariable ^%Counter%
          ^!ClearVariable ^%Headings%
          ^!ClearVariable ^%ChoosenHeading%
        • hsavage
          ... Citizen matrix printer, to avoid this expensive problem. ... Brito, Larry is probably correct, you will have to download the printer-drivers if you have
          Message 4 of 6 , Mar 14, 2009
          • 0 Attachment
            abetsent wrote:
            > Friends,
            >
            > I always used a HP ink jet printer with ntp, all ok.
            >
            > Because I use an expensive ink cartridge every 15 days, I purchased a
            Citizen matrix printer, to avoid this expensive problem.
            >
            > Brito

            Brito,

            Larry is probably correct, you will have to download the printer-drivers
            if you have any hope of getting it to work correctly.

            You can Google Citizen Printers or follow this link to a driver download
            page.

            http://www.driverfiles.net/Printers/Citizen/page,level2,389,12,resultpage1.html
            --
            ·············································
            ºvº SL_day# 073 - created 2009.03.14_08.58.59

            *DROVE TOO LONG*
            • *DRIVER SNOOZING*
            • *WHAT HAPPENED*
            • *NEXT IS NOT AMUSING*
            • *BurmaShave*

            € hrs € hsavage € pobox € com
          Your message has been successfully submitted and would be delivered to recipients shortly.