AutoGUI 2.0

Discuss the AutoGUI IDE with a GUI designer and a script editor.
ignign0kt
Posts: 2
Joined: 20 Sep 2014, 12:34

Re: AutoGUI 2.0

21 Dec 2017, 14:16

Just logged in to say this is amazing man. All this time I thought Scite was the go-to edit and GUI builder for ahk but this is incredible. Hope it stays active. Thanks!
User avatar
Alguimist
Posts: 205
Joined: 05 Oct 2015, 16:41

Re: AutoGUI 2.0

21 Dec 2017, 15:06

@ignign0kt: Thank you :D
User avatar
Alguimist
Posts: 205
Joined: 05 Oct 2015, 16:41

Re: AutoGUI 2.0

21 Dec 2017, 15:13

Version 2.1.0:
- Added: Auto-save. Unsaved files can be automatically saved at a specific interval (2 minutes by default) in the backup folder or current location. This is useful in case of a power outage, a system or application crash, etc.
- Fixed: "Save All" was not removing the asterisks from all tabs in the tab bar due to a change made in the previous version.

Details about auto-save and backup: AutoGUI creates a backup copy of the file in %TEMP%\AutoGUI before saving. The same directory is used by auto-save, which generates a unique name for every file. If the file has never been saved before, a random number is generated for name. Otherwise, the original name is preserved and followed by a hash signature of the file path (so that files with the same name in different locations do not overwrite each other). Credits to jNizM for the CRC32 function. Auto-save can optionally save the file in its current location. Backup files older than 30 days are automatically deleted by AutoGUI when it is launched. The configuration can be made in the Backup Settings dialog in the Options menu.

:arrow: Download
User avatar
Drugwash
Posts: 449
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

Re: AutoGUI 2.0

21 Dec 2017, 16:46

Don't ever delete anything automatically, let the user decide. They may work on those backups for testing purposes or keep them for, well, backup.
User avatar
Alguimist
Posts: 205
Joined: 05 Oct 2015, 16:41

Re: AutoGUI 2.0

21 Dec 2017, 17:43

Drugwash wrote:Don't ever delete anything automatically, let the user decide. They may work on those backups for testing purposes or keep them for, well, backup.

Too many files may accumulate if there isn't an automatic cleanup. If you want them there for a long time, change the value of "Delete backup copies older than...", in the backup settings dialog, to 99999 days.
User avatar
Drugwash
Posts: 449
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

Re: AutoGUI 2.0

22 Dec 2017, 04:08

Such setting may easily be overlooked or forgotten, in time. Besides, it would be more user-friendly to make it a checkbox, that is allow the user to explicitly disable that function. Lately I'm hosting test projects in my temp folder and the slightest bug may inadvertently delete valid useful files so I'd like to be able to control who deletes what and when.

If used space is a concern, make the script count and display its temporary folder's size (and number of files if HDD fragmentation is another concern) in an unobtrusive place, as a reminder to the user.
Just an idea. ;)
User avatar
Alguimist
Posts: 205
Joined: 05 Oct 2015, 16:41

Re: AutoGUI 2.0

22 Dec 2017, 15:35

Thanks, Drugwash. Auto-save is a new feature of the current version, but backup of files before saving was implemented in AutoGUI long ago. By that time, I was using the WinAPI function GetTempFileName, limited to 65535 unique file names. It is said that an IO exception is raised if it is used to create more files than the limit without deleting previous temp files. That's why the automatic cleanup was implemented by that time. Later I replaced GetTempFileName by a function that generates a random number using the maximum limit available (2147483647 or 0x7FFFFFFF, "the largest allowed integer value"). So, the purpose of the backup in AutoGUI is not the same of the traditional backup because it may not be easy to locate the file by its random name. Those temp files have an extension ".ahk.tmp", so it is unlikely that valid files will be deleted from the default backup directory %TEMP%\AutoGUI.
User avatar
Drugwash
Posts: 449
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

Re: AutoGUI 2.0

23 Dec 2017, 09:37

Wouldn't it be easier to just use A_Now (or any type of date-time formatted string) appended to the actual filename? Unless I'm missing something obvious. This way user can easily find their files - more so when they know exactly the date/time of the desired file(s) - and hopefully so would the script. This may further allow the user to selectively delete a chunk of files between dateA and dateB of their choice while keeping the rest (or the other way around).
That may sound like too many options, possibly confusing the user, but a careful choice of the defaults would satisfy most users while the others would still have room for personal preferences. Despite M$'s trend lately I like to have options. ;)
User avatar
Alguimist
Posts: 205
Joined: 05 Oct 2015, 16:41

Re: AutoGUI 2.0

23 Dec 2017, 13:26

Drugwash wrote:Wouldn't it be easier to just use A_Now (or any type of date-time formatted string) appended to the actual filename?

Files are saved simultaneously in auto-save and can be saved simultaneously with "Save All" for backups. So scripts with the same name in different locations can be overwriten if the uniqueness is given by a timestamp. The file name is preserved only for named files in auto-save, as I already mentioned, because the CRC32 of the path is appended to the original file name. Auto-save reuses the same file, while backup creates a new file before/when saving (they are cumulative, and that is the main reason for automatic cleanup). Auto-save associates a random number as backup name to unnamed files and saves every 2 minutes. Once saved, they are auto-saved only if SCI_GETMODIFY is true.
User avatar
Drugwash
Posts: 449
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

Re: AutoGUI 2.0

23 Dec 2017, 15:52

You could use name decorations ( such as file_yyyymmddhhMMss [1] ). When/if loaded those files can be undecorated by PathUndecorate().
Funnily enough I can't find an API that does automatic decoration.
I should shut up now. :)
User avatar
Alguimist
Posts: 205
Joined: 05 Oct 2015, 16:41

Re: AutoGUI 2.0

24 Dec 2017, 14:46

Version 2.1.1:
The feature "Highlight Identical Text" was crashing AutoGUI under some circumstances. I found a way to fix it in the source code of Notepad2-Mod. Credits to Aleksandar Lekov.

More tests are needed, though. If the problem persists, turn the feature off in the View menu.

:arrow: Download
User avatar
Drugwash
Posts: 449
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

Re: AutoGUI 2.0

25 Dec 2017, 05:27

Thanks for your work. Happy Holidays! :)
User avatar
Alguimist
Posts: 205
Joined: 05 Oct 2015, 16:41

Re: AutoGUI 2.0

27 Dec 2017, 00:40

Version 2.1.5:
- Fixed: detection of external file modification was broken since version 2.0.6.
- Added: Search menu > Go to Matching Brace (Ctrl+B).
- In the current version of AHK (1.1.27.00), the standard Help Viewer sidebar was replaced by a custom sidebar. The HTML pages are not listed in Project.hhp, a documentation config file, and jumping to a particular URL inside AutoHotkey.chm has stopped working. This is why an updated help file with the standard style is now (temporarily?) included with AutoGUI.
User avatar
Drugwash
Posts: 449
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

Re: AutoGUI 2.0

27 Dec 2017, 08:05

Alguimist wrote:[…] an updated help file with the standard style is now (temporarily?) included with AutoGUI.
Thank you very very very much for this!

If it's not too much for you, could you please explain in detail how to compile such a CHM file, preferrably with free tools? It'd be great if there were 9x-compatible tools but XP-compatible ones would do, for now. Feel free to use PM to avoid the off-topic here. Thank you.
User avatar
Alguimist
Posts: 205
Joined: 05 Oct 2015, 16:41

Re: AutoGUI 2.0

27 Dec 2017, 14:55

Drugwash wrote:If it's not too much for you, could you please explain in detail how to compile such a CHM file, preferrably with free tools?

Steps:
1. Download and install HTML Help Workshop from Microsoft.
2. Download AutoHotkey_L-Docs from GitHub.
3. Download a previous version of AutoHotkey_L-Docs (merge pull request #200 from 2 months ago).
4. Extract the files.
5. Replace Project.hhp and all files from docs\static with the old ones.
6. If new help pages were created, they need to be listed in two or three files: Project.hhp, data_index.js and data_toc.js, according to the syntax of each file. Pages recently added were: Program.htm, Concepts.htm and Language.htm.
7. Run compile_chm.ahk.
User avatar
Drugwash
Posts: 449
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

Re: AutoGUI 2.0

28 Dec 2017, 05:34

Thank you very much. So much work just because someone thought to fix what ain't broken. :(
lexikos
Posts: 5686
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: AutoGUI 2.0

28 Dec 2017, 06:13

Alguimist wrote:In the current version of AHK (1.1.27.00), the standard Help Viewer sidebar was replaced by a custom sidebar. The HTML pages are not listed in Project.hhp, a documentation config file, and jumping to a particular URL inside AutoHotkey.chm has stopped working.

A user reported F1 help was not working, and linked to this thread, so I am looking into it.

I was surprised to read that the file list being absent from Project.hhp would matter. The only effect I've ever seen the file list have is to ensure a file is included even when hhc does not detect that any other files reference it.

"Jumping to a particular URL" is working just fine with the v1.1.27.00 documentation on my system. I have taken your code and adapted it slightly to test outside the context of your script:

Code: [Select all] [Download] GeSHi © Codebox Plus

g_HelpFile := A_AhkPath "\..\AutoHotkey.chm"
HTMLPage := "/docs/commands/MsgBox.htm"
Run hh mk:@MSITStore:%g_HelpFile%::%HTMLPage%
The MsgBox page opens.

In my fresh copy of AutoGUI v2.1.5a running on v1.1.27.00 Unicode 64-bit, I am unable to get F1 help to work. As far as I can tell, the new help file is in no way to blame for my issue. If I type MsgBox into an untitled document and then press F1, whether I select "MsgBox" first or not, AutoGUI attempts to open /docs/commands/8.htm. I inserted MsgBox %Keyword% at the top of OpenHelpFile(), and it showed 8. Perhaps this is related to kczx3's issue.
kczx3 wrote:Often times, I will select a word and it interprets the selected text as "5".
If I run AutoGUI with Unicode 32-bit, select the word "MsgBox" and press F1, the documentation opens to the MsgBox page.

I notice that you are basically guessing the appropriate URL from the keyword based on a long list of checks. You can use the HTML help API to open a topic based on the keyword index contained within the CHM file.

With some minor changes, https://autohotkey.com/docs/search.htm?q=MsgBox&m=1 could be made to work with the CHM (but with # instead of ?).
User avatar
Alguimist
Posts: 205
Joined: 05 Oct 2015, 16:41

Re: AutoGUI 2.0

28 Dec 2017, 18:17

lexikos wrote:"Jumping to a particular URL" is working just fine with the v1.1.27.00 documentation on my system. I have taken your code and adapted it slightly to test outside the context of your script:

Code: [Select all] [Download] GeSHi © Codebox Plus

g_HelpFile := A_AhkPath "\..\AutoHotkey.chm"
HTMLPage := "/docs/commands/MsgBox.htm"
Run hh mk:@MSITStore:%g_HelpFile%::%HTMLPage%
The MsgBox page opens.

It opens on Windows 10, but not on Windows 7. Right-click a page in the HTML Help Viewer, select Properties, copy the address of the page and paste it in the Jump to URL dialog. It goes to "/docs/AutoHotkey.htm". Internet Explorer has not been updated, so it seems that an HTML5-compliant IE is required.

lexikos wrote:I inserted MsgBox %Keyword% at the top of OpenHelpFile(), and it showed 8.

I would like to fix this bug, but I'm unable to reproduce it. I'll do some further investigations. Could you please check if the following works (replace GetSelectedText() in Editor.ahk):

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


lexikos wrote:You can use the HTML help API to open a topic based on the keyword index contained within the CHM file.

I made tests with this API some time ago, and I found some limitations on it compared to the code I'm using. For example, try searching "GuiDropFiles", "ListView", "RemoveAt" or a function name without parentheses. It doesn't work because the keyword must match the index entry in its entirety. Using the new help file, it is ineffective on Windows 7 as well.
lexikos
Posts: 5686
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: AutoGUI 2.0

28 Dec 2017, 20:36

Alguimist wrote:Could you please check if the following works
Yes, it works.
the Jump to URL dialog
Thanks, I'd forgotten that existed.
It opens on Windows 10, but not on Windows 7.
It opens on my Windows 7 - both from command line and via the dialog.
Internet Explorer has not been updated
That is helpful. I do not have a Windows 7 system without updates, but I have XP with IE8. Jumping to a URL fails due to a variation of this issue with JSON.stringify in IE8, and will be fixed with a simple workaround - for IE8, at least. Edit: It seems I spoke too soon. There is still an unresolved script error (though the page will load if it is dismissed).
I made tests with this API some time ago, and I found some limitations on it compared to the code I'm using.
I see.

search.htm appears to get the right results.
Last edited by lexikos on 28 Dec 2017, 22:45, edited 1 time in total.
Reason: Spoke too soon.
User avatar
Alguimist
Posts: 205
Joined: 05 Oct 2015, 16:41

Re: AutoGUI 2.0

30 Dec 2017, 05:38

Version 2.1.6:
- Fixed a bug reported by kczx3 and Lexicos involving text range (SCI_GETTEXTRANGE) and selected text.
- Fixed another bug reported by Asmodeus possibly related to auto-save, which could be crashing AutoGUI.

:arrow: Download

Return to “AutoGUI”

Who is online

Users browsing this forum: No registered users and 1 guest