AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Active GoTo v4
Goto page 1, 2, 3, 4, 5, 6  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Rajat



Joined: 28 Mar 2004
Posts: 1718

PostPosted: Thu Aug 24, 2006 9:59 am    Post subject: Active GoTo v4 Reply with quote

Active GoTo


v4 Changes:
- List Auto-Updates if there is a change in the sections (or their positions) in the script.
- The auto-update changes the order of the list ONLY if there is a change in the sections in the script,
and not if the change is only in their positions
- Support for hotstrings added
- Support for same line comments on section line added/improved
- If there are no sections in a file (eg. a new script), the ActiveGoTo window doesn't pop up.
- The hotkey Win+Tab toggles the gui hide/show. (Thanks toralf)
- The GUI only shows up when its hotkey is pressed, and not automatically (Thanks toralf)
- All Hotkeys context sensitive (Thanks toralf)
- The refresh hotkey (F5) is gone
- Removed support for .au3 scripts (Don't even know why I added that in the first place!)

v3 Changes:
- Auto update of list based on the currently open file in editor.
- Pressing F5 will refresh the list
- Check if the file open in editor is a script or not

v2 Changes:
- The ActiveGoto GUI gets hidden when neither it or Editor window are active (Thanks MsgBox)
- Support for OTB added (Thanks toralf)
- The alphabetical sort of function list is now optional (Thanks toralf)
- Hotkeys are now easily configurable (Thanks toralf)
- Some code optimizations


When you're working on a big script (say having 400-500 or maybe a couple of thousand lines) then what do you hate most? If you're like me then you hate scrolling from one part of the script to another the most... to counter that I'd made the bookmark script which remembered line contents so the bookmarks always worked (here). Though the advantage it had was that only the sections i wanted were bookmarked, the problem problem was that i still had to create those bookmarks. i didn't like that much either.

So that brings us to this script...

You run this script (preferably by a hotkey) and whatever the current script in your fav editor is, its instantly scanned and All Sections (including hotkey sections) and All Functions are presented as a sorted list of searchable bookmarks!!.. just select the section and press enter.(if you've used my 320MPH script then you'll find yourself at home).

A handy feature is Win+Left key to travel directly between last two used sections without using the ActiveGoto GUI.

Another very helpful feature is that when the script starts it presents a sorted list of sections, but as you keep using it, the recently traversed sections are moved to the top of the list, to make them easily accessible the next time.


Keyboard Help:

Win + Tab : Show Active Goto Window
Win + Left : Goto last browsed control
Esc : Hide Active Goto Window
Up/Down : Browse section list


Its set for PSPad but you can change it to whatever editor you like, it has just 2 reqmts:
- Editor must have a Goto Line cmd
- Editor window's title shows file path

Except Notepad probably every editor has those!

I've been using this for a while and it now is a necessity for me while scripting. (imagine that the current SGUI has about 100 sections!)


(screenshot from Rubberduck's script)

DOWNLOAD
_________________


Last edited by Rajat on Thu Aug 31, 2006 11:38 pm; edited 5 times in total
Back to top
View user's profile Send private message
MsgBox
Guest





PostPosted: Sun Aug 27, 2006 3:46 pm    Post subject: Reply with quote

Hello Rajat

WHAT! Three days, 77 views and nobody has left a comment for this brilliant script! Disgraceful, thats what I say. Smile

Thanks Rajat.

Navigation in PSPad is so much easier now.

I made a small change (to suit my personal preference!), and that is to hide the gui when PSPad is not active. If you don't mine, I will post it here.
Code:
EWCheck:
   IfWinNotExist, ahk_id %EWID%,, ExitApp
   ; Hide if editor is not active.
   IfWinNotActive ahk_id %MWID%
   {
      IfWinNotActive ahk_id %EWID%
         DllCall( "AnimateWindow", "Int", MWID, "Int", 300, "Int", 0x00050002 )
   }
Return


Rajat wrote:
When you're working on a big script (say having 400-500 or maybe a couple of thousand lines) then what do you hate most? If you're like me then you hate scrolling from one part of the script to another the most...

On ANY script large OR small that requires you to scroll, this is useful! (IMHO)
Quote:
(screenshot from Rubberduck's script)

Do you mean a script that create's screen shots? If so, I can't find it! Sad
Back to top
toralf



Joined: 31 Jan 2005
Posts: 3842
Location: Bremen, Germany

PostPosted: Sun Aug 27, 2006 4:31 pm    Post subject: Reply with quote

Hi Rajat,

I missed your post, until MagBox revived it. Thank you to you both.

I have already two requests:
1) I'm a fan of OTB, could you extend the script for these?
2) I like to order my labels/subroutines. So it would help me to have the labels in the GUI in the order they are in the file. To be able to switch between the alphabetic and ordered list, I would like to have ListView Control. But I guess in that case the "recently traversed sections are moved to the top of the list" will not work anymore.
_________________
Ciao
toralf
Back to top
View user's profile Send private message Send e-mail Visit poster's website
toralf



Joined: 31 Jan 2005
Posts: 3842
Location: Bremen, Germany

PostPosted: Sun Aug 27, 2006 4:48 pm    Post subject: Reply with quote

Playing with it I realized more requests, please don't be offended, I just write them down for you to consider them.

1) My windows is german, so PSPads GoTo window is called "Gehe zu..." Maybe you could make it set that depending on the "A_Language"?

2) My notebook doesn't have a win key, could you change the script to easily modify the hotkeys? I used Ctrl instead of Win
_________________
Ciao
toralf
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Hardeep



Joined: 02 Jul 2006
Posts: 87

PostPosted: Sun Aug 27, 2006 6:26 pm    Post subject: Reply with quote

Hi Rajat,

I have been using EditPlus for the same reason. It already has this feature built-in....but when working with other editors your script is really helpful.

Nice effort...Thanks Very Happy
Back to top
View user's profile Send private message
Rajat



Joined: 28 Mar 2004
Posts: 1718

PostPosted: Sun Aug 27, 2006 7:49 pm    Post subject: Reply with quote

I've updated the script with these changes:
- The ActiveGoto GUI gets hidden when neither it or Editor window are active (Thanks MsgBox)
- Support for OTB added (Thanks toralf)
- The alphabetical sort of function list is now optional (Thanks toralf)
- Hotkeys are now easily configurable (Thanks toralf)
- Some code optimizations


hi MsgBox,
thanks for your kind words and review. I've updated the code with your change.

toralf,
I've done all the changes you requested except the language change, as that'll still add support for only PSPad, while for anyone who doesn't use the default english PSPad installation, he has only a li'l change to doin the config section at script's top only once (whether for another language or for another editor).
_________________
Back to top
View user's profile Send private message
toralf



Joined: 31 Jan 2005
Posts: 3842
Location: Bremen, Germany

PostPosted: Sun Aug 27, 2006 7:51 pm    Post subject: Reply with quote

When I work on my code a lot and the line numbers change, the label names change, how can I refresh the list?
_________________
Ciao
toralf
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Rajat



Joined: 28 Mar 2004
Posts: 1718

PostPosted: Sun Aug 27, 2006 7:54 pm    Post subject: Reply with quote

MsgBox wrote:

Do you mean a script that create's screen shots? If so, I can't find it! Sad

no, i just meant that the script whose sections ActiveGoto is showing in the screenshot is made by Rubberduck (i had it open at that time and i grabbed a screenshot from there)

by the way, when i made it initially, it had support for au3 scripts' sections as well... i've not re-checked it lately, though it probably still does support them.
_________________
Back to top
View user's profile Send private message
toralf



Joined: 31 Jan 2005
Posts: 3842
Location: Bremen, Germany

PostPosted: Sun Aug 27, 2006 8:14 pm    Post subject: Reply with quote

Have you updated the code or link? The code I get from the first post looks the same as before.
_________________
Ciao
toralf
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Rajat



Joined: 28 Mar 2004
Posts: 1718

PostPosted: Sun Aug 27, 2006 8:55 pm    Post subject: Reply with quote

Thanks for pointing that out. I used PSPad's ftp to update the file directly, but I must've messed up somewhere... i hope its fine now.
_________________
Back to top
View user's profile Send private message
Rajat



Joined: 28 Mar 2004
Posts: 1718

PostPosted: Sun Aug 27, 2006 9:00 pm    Post subject: Reply with quote

toralf wrote:
When I work on my code a lot and the line numbers change, the label names change, how can I refresh the list?

yeah that's true... currently re-loading ActiveGoto is the only way. i guess i should make it so that when a section is selected to be opened, it should re-scan the whole file to find its new position... might make it a little slower but would be accurate... what do you think?
_________________
Back to top
View user's profile Send private message
toralf



Joined: 31 Jan 2005
Posts: 3842
Location: Bremen, Germany

PostPosted: Sun Aug 27, 2006 9:09 pm    Post subject: Reply with quote

I guess it could be done automatically, e.g. when Ctrl+s is pressed, it can be scaned again, or if the title is missing a "*" (e.g. the user has pressed the save button or run the script which auto-saves). But Maybe a reload button will make it as well.

At the same time it could be monitored, if the file (window title) changes. I normally have multiple files open, so when I switch between files, I would like to see the list of sections for that file.

It also came to my mind, that your script will not recognize PSPad, when there is no file open. Then the title is "PSPad", but I guess that is rare.

Your script reads the whole file and "loop,parse" through the var. Is that faster then "loop,read" through the file? Since you want to have this operation fast, I guess this loop should be speed optinized as much as possible. E.g. make the file type decision outside of that loop. etc.
_________________
Ciao
toralf
Back to top
View user's profile Send private message Send e-mail Visit poster's website
toralf



Joined: 31 Jan 2005
Posts: 3842
Location: Bremen, Germany

PostPosted: Sun Aug 27, 2006 9:12 pm    Post subject: Reply with quote

What is the reason for
Code:
   CurrLine = %A_LoopField%
   Check = %CurrLine%
   Check = %Check%
If you want to trim spaces away, wouldn't one of these lines have been enough.?!?
_________________
Ciao
toralf
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Rajat



Joined: 28 Mar 2004
Posts: 1718

PostPosted: Sun Aug 27, 2006 9:17 pm    Post subject: Reply with quote

i see some nice ideas in your post toralf, thanks... let me see what i can do tonight.
_________________
Back to top
View user's profile Send private message
toralf



Joined: 31 Jan 2005
Posts: 3842
Location: Bremen, Germany

PostPosted: Sun Aug 27, 2006 9:17 pm    Post subject: Reply with quote

And I guess the hotkeys can be simplified to
Code:
#IfWinActive, ahk_group MWGrp
Up:: ControlSend, ListBox1, {Up}, %MainWnd%
Down:: ControlSend, ListBox1, {Down}, %MainWnd%
#IfWinActive

_________________
Ciao
toralf
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page 1, 2, 3, 4, 5, 6  Next
Page 1 of 6

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group