AutoHotkey Community

It is currently May 27th, 2012, 9:29 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 86 posts ]  Go to page 1, 2, 3, 4, 5, 6  Next
Author Message
 Post subject: Active GoTo v4
PostPosted: August 24th, 2006, 9:59 am 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
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!)

Image
(screenshot from Rubberduck's script)

DOWNLOAD

_________________
Image


Last edited by Rajat on August 31st, 2006, 11:38 pm, edited 5 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 27th, 2006, 3:46 pm 
Hello Rajat

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

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! :(


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 27th, 2006, 4:31 pm 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
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
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 27th, 2006, 4:48 pm 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
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
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 27th, 2006, 6:26 pm 
Offline

Joined: July 2nd, 2006, 7:59 pm
Posts: 87
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 :D


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 27th, 2006, 7:49 pm 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
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).

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 27th, 2006, 7:51 pm 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
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
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 27th, 2006, 7:54 pm 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
MsgBox wrote:
Do you mean a script that create's screen shots? If so, I can't find it! :(

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.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 27th, 2006, 8:14 pm 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
Have you updated the code or link? The code I get from the first post looks the same as before.

_________________
Ciao
toralf
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 27th, 2006, 8:55 pm 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
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.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 27th, 2006, 9:00 pm 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
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?

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 27th, 2006, 9:09 pm 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
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
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 27th, 2006, 9:12 pm 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
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
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 27th, 2006, 9:17 pm 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
i see some nice ideas in your post toralf, thanks... let me see what i can do tonight.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 27th, 2006, 9:17 pm 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
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
Image


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 86 posts ]  Go to page 1, 2, 3, 4, 5, 6  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google Feedfetcher, nomissenrojb, SKAN, Stigg and 17 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group