Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

AHKCodeViewer


  • Please log in to reply
28 replies to this topic
Roland
  • Members
  • 307 posts
  • Last active: Mar 09 2014 07:55 PM
  • Joined: 08 Jun 2006
Okay, I wrote three functions - one to get a list of every label and function definition in a file, one to extract a funtion and one to extract a subroutine. I also added a Gui to demostrate a bit how they could be used (and because I always wanted to try the - amazing - Splitter ... thanks at this point ... and the new - and also amazing - TreeView control). Really though, this is only an experiment and I don't know where it's headed. I just thought I'd throw it out there - maybe someone finds it useful.

Note: PhiLho has written a similar script you might want to take a look at.

Edit:
As those who attempted to use the previous version of this script surely noticed, it was quite buggy. Seeing that we now have RegEx's, however, it should be possible to get it to work.
It's almost guaranteed that there are still some bugs. Please let me know when you find one.

Posted Image

Note: You can...

*Drag&Drop files and folders
*Remove file from the treeview with right-click context menu

Get it here

Eleria
  • Members
  • 98 posts
  • Last active: Jul 05 2007 02:51 AM
  • Joined: 09 May 2006
:shock:

Truely awesome Roland !
So many applications possible ^_^
Posted Image

Roland
  • Members
  • 307 posts
  • Last active: Mar 09 2014 07:55 PM
  • Joined: 08 Jun 2006

Truely awesome Roland !


Thanks. :)

robiandi
  • Guests
  • Last active:
  • Joined: --
@Roland: Many thanks for this great script!

Roland
  • Members
  • 307 posts
  • Last active: Mar 09 2014 07:55 PM
  • Joined: 08 Jun 2006

Roland: Many thanks for this great script!


You're welcome.

There are a few problems right now, but mostly with the OTB style. In any case, I should have them fixed soon.

Roland
  • Members
  • 307 posts
  • Last active: Mar 09 2014 07:55 PM
  • Joined: 08 Jun 2006
OneTrueBrace was a little more complicated than I thought :? , but I think I've got it now. I updated the code.

Roland
  • Members
  • 307 posts
  • Last active: Mar 09 2014 07:55 PM
  • Joined: 08 Jun 2006
I just edited the original post.

Elevator_Hazard
  • Members
  • 297 posts
  • Last active: Feb 07 2011 12:10 AM
  • Joined: 28 Oct 2006
How about another program just like this but lets you edit that function or subroutine?

If this program already does that, sorry.
Changed siggy at request of ahklerner :D

jballi
  • Members
  • 1029 posts
  • Last active:
  • Joined: 01 Oct 2005
I'm liking this script. Thanks for sharing. :)

A couple of ideas/comments...

You might want to rename the post/script to something different since it does a heck of lot more than just view functions. Something like AHKViewer or AHKCodeViewer.

Also, a fixed font for the code side of the viewer might be more appropriate since it is code we're looking at.

An option for AOT might be helpful for persons like me who like to use the drag & drop feature.


These are just ideas. Once again, thanks for sharing. :)

PhiLho
  • Moderators
  • 6850 posts
  • Last active: Jan 02 2012 10:09 PM
  • Joined: 27 Dec 2005
Interesting, there are some other similar scripts, like my List functions (+ labels + hotstuff) in an AutoHotkey script, not necessarily with GUI. The treeview is under used here.

A couple of ideas/comments...

I see three of them... :-)

Also, a fixed font for the code side of the viewer might be more appropriate since it is code we're looking at.

It depends on taste, I edit AutoHotkey code in SciTE with a proportional font.

An option for AOT might be helpful for persons like me who like to use the drag & drop feature.

What is AOT?
Posted Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")

jballi
  • Members
  • 1029 posts
  • Last active:
  • Joined: 01 Oct 2005

Interesting, there are some other similar scripts, like my List functions (+ labels + hotstuff) in an AutoHotkey script, not necessarily with GUI. The treeview is under used here.

Although this script was originally designed so that the developer can easily find and extract code from a script (a very noble requirement), the beauty and simplicity of the design allows for it to be a fairly effective AHK code viewer. I agree that it would be nice to add children for hotkeys and hotstrings but I didn't want to appear too greedy.

I see three of them... :-)

Sorry 'bout that. My calculator program crashed when I was trying to add up the total number ideas/comments. I had to manually calculate the total and... :oops:

Also, a fixed font for the code side of the viewer might be more appropriate since it is code we're looking at.

It depends on taste, I edit AutoHotkey code in SciTE with a proportional font.

Definitely a personal taste thing. I have a lot of code that don't look right displayed with a proportional font. I guess I could modify the code...

What is AOT?

I too hate people that casually use uncommon or undocumented TLA's (three letter acronym) as though everyone knows what they mean. AOT is a TLA for "Always On Top". Please accept my apology for the UTLA (undocumented three letter acronym).

majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006
define:Word usualy helps on google, or just Word
Posted Image

PhiLho
  • Moderators
  • 6850 posts
  • Last active: Jan 02 2012 10:09 PM
  • Joined: 27 Dec 2005

define:Word usualy helps on google, or just Word

There is also Acronym Finder, but the problem with TLA is ambiguity: AOT returns 27 definitions, including Always On Time, As Opposed To, Absolutely Off Topic and some other more or less likely candidates...

I tend to use acronyms too, hoping they are common enough to be unambiguous, like FYI, IIRC, AFAIK and so on.
You, majkinetor, are recently fond of "ofc", which mean, I guess, "of course".

I have a lot of code that don't look right displayed with a proportional font.

I usually edit scripting languages, often informal and short code, with proportional fonts, easier for the eye and offering more code in one line, and compiled languages (C, Java...) with fixed-width font (Andale Mono or Bitstream Vera Sans Mono). Anyway, I made for SciTE a shortcut key to quickly switch back and forth to fixed-width font in case of need (fancy comments, comparison of strings, etc.).
Posted Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")

polyethene
  • Members
  • 5519 posts
  • Last active: May 17 2015 06:39 AM
  • Joined: 26 Oct 2012
My only suggestion would be to use a fixed width font. Other than that it's great.

btw. urbandictionary is great for debugging leetspeak and finding acronyms.

autohotkey.com/net Site Manager

 

Contact me by email (polyethene at autohotkey.net) or message tidbit


Roland
  • Members
  • 307 posts
  • Last active: Mar 09 2014 07:55 PM
  • Joined: 08 Jun 2006

You might want to rename the post/script to something different since it does a heck of lot more than just view functions. Something like AHKViewer or AHKCodeViewer.


Good idea.

Also, a fixed font for the code side of the viewer might be more appropriate since it is code we're looking at.


I figured my addiction to Comic Sans would cause an uproar :) I actually meant to change it before uploading, but then forgot.
I changed the font for the edit to one that PhiLho suggested; you can change it to whatever you like though.

An option for AOT might be helpful for persons like me who like to use the drag & drop feature.


I never think of that as I'm used to using NiftyWindows to set any window AOT whenever I want.
You can turn on AOT in the settings section now.