AutoGUI - Script Editor, GUI Designer, Debugger and Tools

Old Topics related to the original "AutoGUI" ahk script editor.
Franktic
Posts: 14
Joined: 08 Oct 2018, 22:35

Re: AutoGUI - Script Editor, GUI Designer, Debugger and Tools

Post by Franktic » 12 Jan 2020, 21:48

Comment out the lines below in autogui.ahk by putting them inside /* */

If (A_ScreenDPI != 96) {
Gui Auto: +OwnDialogs
MsgBox 0x30, Warning, %g_AppName% has not been adapted to High-DPI display scaling.`n`nThe program will exit.
ExitApp
}
freespacing
Posts: 150
Joined: 28 Sep 2016, 11:14
Contact:

Re: AutoGUI - Script Editor, GUI Designer, Debugger and Tools

Post by freespacing » 12 Jan 2020, 23:01

@Franktic Thank you!
anotherbyte
Posts: 3
Joined: 14 Jan 2020, 03:54

Re: AutoGUI - Script Editor, GUI Designer, Debugger and Tools

Post by anotherbyte » 14 Jan 2020, 04:21

Hello.

I found a possible bug with saving files to network drives.
I just downloaded the latest version from SF (2.6.2, using AutoHotkey 1.1.30.03)

Steps to reproduce

* create a file
* save it to a network drive, say G:\
* modify the file
* try saving again
It will fail with error "The request is not supported." (error 0x50: ERROR_NOT_SUPPORTED).
screenshot 2020.01.14-06.04.11.png
screenshot 2020.01.14-06.04.11.png (5.61 KiB) Viewed 15216 times
The issue happens in this function

Code: Select all

WriteFile(Filename, String, Encoding := "UTF-8") {
    f := FileOpen(Filename, "w", Encoding)
    If (!IsObject(f)) {
        ErrorMsgBox("Error saving """ . Filename . """.`n`n" . GetErrorMessage(A_LastError), "Auto")
        Return -1
    }
    Bytes := f.Write(String)
    f.Close()
    Return Bytes
}
Edit: Fixed by restoring the behavior from 2.5.8.
Instead of this

Code: Select all

    If (WriteFile(FullPath, SciText, Encoding) < 0) {
        SetWindowTitle("Error saving file: " . FullPath)
        Return 0
    }
I used this

Code: Select all

    FileDelete %FullPath%
    FileAppend %SciText%, %FullPath%, %Encoding%
    If (ErrorLevel) {
        ErrorMsgBox("Error saving """ . FullPath . """.`n`n" . GetErrorMessage(A_LastError), "Auto", g_AppName)
        SetWindowTitle("Error saving file: " . FullPath)
        Return 0
    }
User avatar
boiler
Posts: 17706
Joined: 21 Dec 2014, 02:44

Re: AutoGUI - Script Editor, GUI Designer, Debugger and Tools

Post by boiler » 04 Feb 2020, 15:34

haichen wrote:
16 Aug 2019, 04:34
I like AutoGui very much. At the moment i'm only missing the possibility of relative positioning of the controls in the code. I like to see positioning with wp, hp, xp, yp xm, ym etc and maybe xs, ys. May be this could be built in the Alignmenttools. Perhaps as an option.

Thank you very much for your very helpful program.
haichen
Hi haichen. I created a tool called Relativity to do add relative positioning of controls after the GUI has been laid out. Perhaps you will find it useful.
kevindevm
Posts: 4
Joined: 15 Apr 2019, 23:03

Re: AutoGUI - Script Editor, GUI Designer, Debugger and Tools

Post by kevindevm » 10 Mar 2020, 15:07

hi amazing app becouse i copy alot i added this, maybe you could add it to the program? ctrl + alt + click to get a copy on your mouse of the control u clicked here is a video https i.imgur.com /8Dz16UB.mp4 Broken Link for safety
User avatar
Alguimist
Posts: 428
Joined: 05 Oct 2015, 16:41
Contact:

Re: AutoGUI - Script Editor, GUI Designer, Debugger and Tools

Post by Alguimist » 07 Apr 2020, 08:46

@anotherbyte: sorry for the late reply.

Recently I was checking the documentation of OPENFILENAME, where there is a mention to "create-nonmodify network share", which is probably your case. I could check the drive type when an error occurs when saving, with the commmand DriveGet (Type, Network), and maybe check for permissions, since the error message is vague, and then provide an alternative save function.
User avatar
megnatar
Posts: 92
Joined: 27 Oct 2014, 20:49
Location: The Netherlands
Contact:

Re: AutoGUI - Script Editor, GUI Designer, Debugger and Tools

Post by megnatar » 15 Apr 2020, 05:15

I added a topic to main thread. Should I have reported a fix request here?
zakk
Posts: 5
Joined: 01 Jun 2015, 12:31

Re: AutoGUI - Script Editor, GUI Designer, Debugger and Tools

Post by zakk » 17 Apr 2020, 06:42

Greetings

I've discovered AutoGUI a few days ago, and it's awesome! So useful and with the most polished interface!
Thanks a lot for your great work!


I'd like to make a feature suggestion regarding: File|'Script Directives':
to be able to manage the directives of the current content (an existing script, or some still unsaved script code) via 'Script Directives',
i.e. AutoGUI to parse the current content for directives, and populate the 'Script Directives' fields.

And, as asked in here, it would be great to also be able to save the current directives as templates, for future use.

Thank you
User avatar
Alguimist
Posts: 428
Joined: 05 Oct 2015, 16:41
Contact:

Re: AutoGUI - Script Editor, GUI Designer, Debugger and Tools

Post by Alguimist » 27 Apr 2020, 10:00

@zakk
Thank you for the feedback and suggestions.
A simple template mechanism has been added to the version I'm working on, where the current file can be saved as a template.
madsounds
Posts: 59
Joined: 31 May 2019, 08:14

Re: AutoGUI - Script Editor, GUI Designer, Debugger and Tools

Post by madsounds » 02 Jun 2020, 15:26

Whenever I'm designing a window in AutoGUI, i get en error:
Image

Bug often appears when I copy and paste GUI controls.

This error appears several minutes after the start of work. Please fix this bug!
Last edited by madsounds on 02 Jun 2020, 15:30, edited 2 times in total.
madsounds
Posts: 59
Joined: 31 May 2019, 08:14

Re: AutoGUI - Script Editor, GUI Designer, Debugger and Tools

Post by madsounds » 02 Jun 2020, 15:29

Also pls add snap-to-grid resize
madsounds
Posts: 59
Joined: 31 May 2019, 08:14

Re: AutoGUI - Script Editor, GUI Designer, Debugger and Tools

Post by madsounds » 02 Jun 2020, 16:10

I think maybe the bug is caused by encoding. At this moment, almost all of AutoGUI *.ahk files are encoded as UTF-8, not as UTF-16 w-BOM (which is better for support other languages).

I've just tried to save all of AutoGUI *.ahk files as UTF-16 w-BOM. And after I did that, even mouse hovering on AutoGUI system toolbar started to cause same error: "The following variable name contains an illegal character". So I'm pretty sure encoding is the reason of bug.
User avatar
Alguimist
Posts: 428
Joined: 05 Oct 2015, 16:41
Contact:

Re: AutoGUI - Script Editor, GUI Designer, Debugger and Tools

Post by Alguimist » 03 Jun 2020, 07:02

@madsounds
I could reproduce the error you described by hardcoding a negative value as the Scintilla handle passed to the function __SCI. This function dynamically converts a Scintilla handle to a static variable associated with the Scintilla object. Variable names cannot contain a minus sign, hence the error message. In order to determine what is wrong, I need information about the AHK and AutoGUI versions you are running. You can get it in Help > About.

Snap-to-grid resize: AutoGUI offers multiple ways to resize controls, but only one of them is compatible with the automatic grid alignment option: Shift-drag.
madsounds
Posts: 59
Joined: 31 May 2019, 08:14

Re: AutoGUI - Script Editor, GUI Designer, Debugger and Tools

Post by madsounds » 03 Jun 2020, 14:20

@Alguimist
My versions of AutoGUI and AHK:
Image

Btw I made some modifications in Scintilla.ahk and now the bug is gone! Here's what I changed.

Before:

Code: Select all

__SCI(var, val="") {
    static
	lvar := %var%, val ? %var% := val : 0
    return lvar
}
After:

Code: Select all

__SCI(var,val="") {
	static
	lvar = %var%
	if( val )
	{
		%var% = val
	}
	return lvar
}
But I don't quite understand what this function does. Is there an attempt to create variables whose names consist of numbers only? If so, it's very confusing for me. And just in order to avoid variable names consisting of numbers, I replaced operators := with = (again, if I understand the logic of this function correctly).
User avatar
Alguimist
Posts: 428
Joined: 05 Oct 2015, 16:41
Contact:

Re: AutoGUI - Script Editor, GUI Designer, Debugger and Tools

Post by Alguimist » 04 Jun 2020, 12:18

@madsounds
The code you posted doesn't work and, as a result, some features of the editor that rely on notifications become unavailable.

One possible solution: search for __SCI(NumGet(lParam + 0)) and replace it by __SCI(NumGet(lParam + 0, 0, "Ptr")).
madsounds
Posts: 59
Joined: 31 May 2019, 08:14

Re: AutoGUI - Script Editor, GUI Designer, Debugger and Tools

Post by madsounds » 04 Jun 2020, 20:37

@Alguimist
Okay I'll try that, thank you!

Here's another serious issue - session save is impossible. When I try to save session file, the result is an empty file. Its size is just 3 bytes - probably UTF header. Is this the way that shall work? :)
Last edited by madsounds on 06 Jun 2020, 01:29, edited 3 times in total.
madsounds
Posts: 59
Joined: 31 May 2019, 08:14

Re: AutoGUI - Script Editor, GUI Designer, Debugger and Tools

Post by madsounds » 05 Jun 2020, 12:16

Alguimist wrote:
04 Jun 2020, 12:18
@madsounds
One possible solution: search for __SCI(NumGet(lParam + 0)) and replace it by __SCI(NumGet(lParam + 0, 0, "Ptr")).
No this solution results same error :roll:
User avatar
Alguimist
Posts: 428
Joined: 05 Oct 2015, 16:41
Contact:

Re: AutoGUI - Script Editor, GUI Designer, Debugger and Tools

Post by Alguimist » 11 Jun 2020, 15:31

@madsounds

Since I couldn't find a way to properly reproduce the bug you described, I rely on your feedback and attention to perform the following:
- Make sure you are running an unmodified version of AutoGUI. You may need to extract the files again to a new location. Also make sure that the settings file (AutoGUI.ini) is being saved in the program folder, otherwise it is on %APPDATA%.
- Replace the function __SendEditor in Scintilla.ahk with this:

Code: Select all

__SendEditor(hWnd, msg := 0, wParam := 0, lParam := 0) {
    Static

    If (!%hWnd%_df) {
        SendMessage, SCI_GETDIRECTFUNCTION, 0, 0,, ahk_id %hWnd%
        %hWnd%_df := ErrorLevel ; Direct function
        SendMessage, SCI_GETDIRECTPOINTER, 0, 0,, ahk_id %hWnd%
        %hWnd%_dp := ErrorLevel ; Direct pointer

        If (!msg && !wParam && !lParam) { ; Called from __Add.
            Return
        }
    }

    If !(msg + 0) {
        msg := "SCI_" . msg
        msg := %msg%
    }

    OutputDebug %msg%

    ; Scintilla_DirectFunction: int (*fn)(void*,int,int,int)
    Return DllCall(%hWnd%_df, "Ptr", %hWnd%_dp, "Int", msg, "Int", wParam, "Int", lParam)
}
- And the function __SCI with this:

Code: Select all

__SCI(hWnd, o := 0) {
    Static
    __o := %hWnd%
    o ? %hWnd% := o : 0
    Return __o
}
It should be noted that this function receives either the return value of CreateWindowEx, which is null in case of failure, or the lParam of WM_NOTIFY, which is, at offset 0 of a NMHDR structure, the hWnd of the Scintilla control.

Notice the presence of the OutputDebug command in __SendEditor. If you keep an utility called DebugView running while attempting to reproduce the bug in AutoGUI, that utility will display the list of message codes executed by the DLL.

In regard to session saving: this feature doesn't ask the user to save files, it is simply a list of open files. Session saving was highly improved in the version I'm working on, where all sort of metadata within the editor is preserved: cursor position, line markers, text markers (indicators), selections and folds.
User avatar
kczx3
Posts: 1677
Joined: 06 Oct 2015, 21:39

Re: AutoGUI - Script Editor, GUI Designer, Debugger and Tools

Post by kczx3 » 11 Jun 2020, 15:59

@Alguimist on a side note, this next version must be a huge leap based on the things I’ve read that you’re working on!
madsounds
Posts: 59
Joined: 31 May 2019, 08:14

Re: AutoGUI - Script Editor, GUI Designer, Debugger and Tools

Post by madsounds » 18 Jun 2020, 15:58

@Alguimist
In regard to session saving: this feature doesn't ask the user to save files, it is simply a list of open files. Session saving was highly improved in the version I'm working on, where all sort of metadata within the editor is preserved: cursor position, line markers, text markers (indicators), selections and folds.
Sorry, I don't get it :) What's the purpose of File -> Save Session menu? Why it saves 3-byte file that I can't open later? Is it broken in current version? And I need to save designed form (buttons, checkboxes etc), not the text editor features (like cursor position, line markers, text markers, selections, folds). Is there a method to save current design form into the file, so one can reopen that file in AutoGUI later to continue designing this form?
Last edited by madsounds on 19 Jun 2020, 02:35, edited 7 times in total.
Post Reply

Return to “Old Topics”