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 

Ahk Editor with Sgui, Intellisense, more...

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> General Chat
View previous topic :: View next topic  
Author Message
Invalid User



Joined: 14 Feb 2005
Posts: 442
Location: Texas, Usa

PostPosted: Fri Oct 21, 2005 9:25 pm    Post subject: Ahk Editor with Sgui, Intellisense, more... Reply with quote

Some time ago, I read here on the forum ideas of making added features to SmartGui. As I remember understanding it, the new features would allow a gui script to be edited in real-time updating the visual version that SmartGui(hereby known as SGUI) uses. In addition editing the visual version would edit the scripted version. This, I thought was a great idea--so I thought why not menus too?

I started thinking about how to develop such an editor and realized just how to do it, and still provide a professional feel. I developed an icon and a image based toolbar and started away.

...But I went bigger than the really big/cool functions mentioned above. When I script is opened, how would it be broken down? How could I keep coded lines intact while still being able to manipulate the Gui or Menus if I wanted? There was (and still is much) to think about.

I came to the solution to divide each script in to its main sections, by label and section classification. The sections are the auto-execute section, the gui creation sections, and the menu creation sections. The last two are executed by Gosub labels from within the AutoExe section. The labels can be broken down into Functions, Menu Labels(Labels that are executed from a menuitem that is), Gui Labels(Labels that are executed from controls on a Gui), Hotkey Labels, and Timer Labels(Labels that are used in a timed routine). (Note: the script anyilizer is limited to the style of scripting I use, regarding tabs and spaces. It also is limited by not allowing for comments on certain lines, and several small things that are easy tofix, but I will have more on that later.)

After each label and its text is defined your ready to look at a very organized version of the script, so I started to think that this may be for the neophyte to the advanced, because each label is very easy to keep track of so that large scripts with many labels would be easy to maintain. Also you could limit yourself to looking at a single labels contents with out looking at the text of surrounding labels, often putting things back into proportion.

Now why talk about all this? ...Well with the recent events in my life, I have had very little time to dedicate to this project, and I think it has alot to offer to the AHK community. So I wanted to allow my current progress to become open source so that everyone here can help work on it so that maybe its done before there is v2(if ever). What I am attempting to say is that, I think the community could really benefit from this project, but may never get to see that day due to no one knowing of my work and my lack of time to devote to getting a working version out to you.

A folder is downloadable from www.autohotkey.net that contains every thing you need to have a look at whats going on.
http://www.autohotkey.net/file/users/Members/Invalid%20User/Gui%20Edit.zip
There are the following features that are currently done:

Open File
Dynamic files(multiple files can be opened)
Toggle thru files with "Window" menu
Window title indicates what script is active
Close File (May be buggy, closes and clears mem used by script
Ability to create and delete Labels used in the script
Undo/Redo(Unlimited, know to be buggy)
WordWrap On/Off

Planned features:

Those above
font size
Type Face
Advanced string searching
Scripts testable
Macros recorder
Intellisense
SGUI Feel/features
Visual mode(acts like compiled version)
Edit mode
String Replacing
...the sky is the limit


If you have questions on what is what after looking at the script, feel free to ask.
----------------------------
Notes:
The file anylizer that classifies the labels and sections is dependent on several things.

1. The last label must end with a Return with out leading spaces or tabs Ex:
Code:
MyLastLabel:
;My Comments here
MyVar++
Return

because returns used in a tabbed if-statment are not the final return

2. The following comment would not be seen as part of any labels text because it is between labels
Bad Ex:
Code:

Mysub:
Myvar++
Return
;The following routine does... this and that and adds one to Myvar
Myothersub:
This=that
Myvar++
Return


Good Ex:
Code:
Mysub:
Myvar++
Return
Myothersub:
;The following routine does... this and that and adds one to Myvar
This=that
Myvar++
Return


3. Comment must not be on the same line as a label, comment the labels function below the Label, as above

What not to do
Code:

Mylabel: ;This is a label


There are many more that will be discovered and the whole process may be precieved as buggy if you use a different style than the script is written in, so look to it for example. You can open the script itself for a demo on how it should work.

The anylizer is included so that it can be updated with little fear of harming the main script, it will only affect the way an opened file is handled. Also, because its included, besure to update the file name that is used where ever it is included, otherwise new changes to the anylizer will not be seen.
_________________
my lame sig Smile
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Invalid User



Joined: 14 Feb 2005
Posts: 442
Location: Texas, Usa

PostPosted: Fri Oct 21, 2005 9:36 pm    Post subject: Reply with quote

I was just reading futher work by hajos and toralf that could be added to convert scripts to match the syntax dependent anylizer. Bravo!
_________________
my lame sig Smile
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Sat Oct 22, 2005 2:36 am    Post subject: Reply with quote

It looks like you've accomplished a lot, and also provided some good documentation about existing and future features.

I hope someone will see this and decide to built upon it. But even if they don't, I think quite a few people will learn things from it that they can apply to their own projects.

Thanks.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> General Chat All times are GMT
Page 1 of 1

 
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