Page 6 of 8

Re: [Library] Neutron.ahk - AutoHotkey Web GUIs on Steroids

Posted: 13 Jul 2021, 02:19
by erohtar
@Tre4shunter
Ah! Actually I vaguely remembered seeing some code in Chrome.ahk that looked for a free port number - that must've been the commented out example you just mentioned! Thank you for pointing it out!

Based on latest testing, I see that two separate NeutronC windows work as expected as long as:
1) They run on separate ports (this should've been obvious to me, but I wrongly presumed it was already happening)
2) They run from separate profile folders (otherwise I get glitches and errors)

Re: [Library] Neutron.ahk - AutoHotkey Web GUIs on Steroids

Posted: 17 Jul 2021, 00:52
by Thoughtfu1Tux
Newbie question, but how do i go about appending a checkbox item to the bottom of a checklist with the DOM generation method?
I've been playing around with it for about an hour now, have not been able to figure it out.


I'm using the SIMPLE example.With no changes. When i click the "Submit" button under DOM generation, i want the Item that i input to get appended to the bottom of the "favorite foods" checklist section instead of the DOM generation section.


Very Newbie code:
HTML change to simple.html: (Added an id for the table)

Code: Select all

     <form onsubmit="ahk.Submit2(event)" id="favoritefoodstable">

Code: Select all

AHK Code change:
Ex4_Submit2(neutron, event)
{
	event.preventDefault()
	formData := neutron.GetFormData(event.target)
	
	; Create the row element to add cells to
	checkbox := neutron.doc.createElement("Checkbox")
	
	; Create the first column cell and add it to the row
	; td := neutron.doc.createElement("td")
	checkbox.innerText := formData.ex4_item2
	; tr.appendChild(td)
	
	; Create the second column cell and add it to the row
	; td := neutron.doc.createElement("td")
	; td.innerText := formData.ex4_cost2
	; tr.appendChild(td)
	
	; Add the row to the table
	neutron.qs("favoritefoodstable").append(checkbox)
}
I would happily accept/appreciate if anyone pointed me at any documentation that might help me figure this out if you don't have to time to write out the code yourself.
Thanks for the help!

Re: [Library] Neutron.ahk - AutoHotkey Web GUIs on Steroids

Posted: 21 Jul 2021, 20:42
by DRocks
Nice Work!! I actually have written an application with Electron for Javascript and this Neutron library feels like a similar tool but using AHK instead of NodeJs as a "Back-End". HTML / CSS / JS is great for user interfaces and AHK is good for Windows automation so it's a really nice combo.

Re: [Library] Neutron.ahk - AutoHotkey Web GUIs on Steroids

Posted: 28 Aug 2021, 09:54
by geek
Thank you to Discord @ELMA for bringing this to my attention:


Along with traditional methods of debugging AutoHotkey scripts, you can access
the IE developer tools by invoking the Microsoft utility IEChooser.exe. This
tool, located at %SystemRoot%\System32\F12\IEChooser.exe allows you to choose
an IE frame embedded into any application and attach the regular web debugger to
it.

This tool is part of the Windows 10 suite of debugging utilities introduced with
Legacy Edge, and designed for debugging applications such as IE-based Office
Add-ins. It also works pretty well for AHK scripts with embedded browser
controls.

Re: [Library] Neutron.ahk - AutoHotkey Web GUIs on Steroids

Posted: 14 Sep 2021, 05:57
by jsong55
Anyone has suggestions on good WYSIWYG editors for css and html 5 that we can use to build our neutron GUI

I find that just copy pasting bootstrap into a code editor doesn't cut it.

Re: [Library] Neutron.ahk - AutoHotkey Web GUIs on Steroids

Posted: 14 Sep 2021, 21:35
by jsong55
Hopefully @GeekDude will be able to create neutron that integrates with Chrome instead of IE.

Else my question on stackexchange will get booted :( - https://stackoverflow.com/questions/69186078/rewrite-arrow-function-with-arrays-for-use-in-ie?noredirect=1#comment122282809_69186078

Re: [Library] Neutron.ahk - AutoHotkey Web GUIs on Steroids

Posted: 15 Sep 2021, 07:20
by Tre4shunter
While IE may no longer be supported by MS, im pretty certain that the underlying engine which Neutron utilizes will not go away. Your question is still valid - and there are plenty of reasons not to want to use arrow functions. I'm sure someone can help you out - or you can convert it yourself im sure! :)

Or...just use Chrome, and then use the Chrome.ahk library.

-Tre4

Re: [Library] Neutron.ahk - AutoHotkey Web GUIs on Steroids

Posted: 16 Sep 2021, 15:22
by geek
For what it's worth, I am "working" on Positron, like Neutron but built against Chromium Edge.

I put working in quotes because my time is very limited from my full time job and hour commute both ways. I don't plan to have it to release by the removal of IE11, but I also don't anticipate IE11's removal to break Neutron. Maybe I'll eat my words, but that's a die I'm forced to roll even if just for schedule reasons.

As part of Positrons development I've gone back to build better dependencies for JSON and Websockets as those are fundamental to the model of how Chromium communicates, and current libraries aren't cutting it. You can follow the development of cJson, the new Websocket library, Chrome.ahk, and Positron, from my Discord server.

https://geekdude.io/discord

Re: [Library] Neutron.ahk - AutoHotkey Web GUIs on Steroids

Posted: 16 Sep 2021, 16:07
by tank
it is unlikely that the trident engine will be removed anytime in the near future as so much else within the windows dev cycle depends 8n it and no suitible replacement yet exists

Re: [Library] Neutron.ahk - AutoHotkey Web GUIs on Steroids

Posted: 16 Sep 2021, 17:31
by gregster
What??? "GeekDude" is now renamed to "Geek" ?!?
I am shocked :shock: :lolno: , but I'll allow it :D , and also hope to see many great contributions like in the past!
Chrome.ahk, CodeQuickTester, Neutron.ahk, cJosn.ahk ... - it's like christmas (or whatever you fancy) when GeekDude posts a new project :bravo:

Re: [Library] Neutron.ahk - AutoHotkey Web GUIs on Steroids

Posted: 17 Sep 2021, 09:06
by joedf
:o :shock: :salute:

Re: [Library] Neutron.ahk - AutoHotkey Web GUIs on Steroids

Posted: 18 Oct 2021, 08:37
by tuzi
I created this BeautifulMessageBox.

Image

Image

Does anyone know how to make webview control have rounded corner? Because the webview control is a rectangle and the content inside is a rounded rectangle, so it doesn't look perfect. :cry:

@GeekDude

Re: [Library] Neutron.ahk - AutoHotkey Web GUIs on Steroids

Posted: 18 Oct 2021, 09:14
by joedf
Very neat!
To do round corners, I believe you can use Winset, Region or something like that.
Edit: see this https://www.autohotkey.com/docs/commands/WinSet.htm#ExRegion
But I am sure if it will work out-of-the-box, you might have do some other window tweaks

Re: [Library] Neutron.ahk - AutoHotkey Web GUIs on Steroids

Posted: 18 Oct 2021, 19:45
by tuzi
joedf wrote:
18 Oct 2021, 09:14
Very neat!
To do round corners, I believe you can use Winset, Region or something like that.
Edit: see this https://www.autohotkey.com/docs/commands/WinSet.htm#ExRegion
But I am sure if it will work out-of-the-box, you might have do some other window tweaks
Thank you! i tried this, not work.

Another problem is that Winset, Region causes jagged edges. :cry:

Re: [Library] Neutron.ahk - AutoHotkey Web GUIs on Steroids

Posted: 18 Oct 2021, 23:15
by joedf
Yeah... Maybe try something with GDI+... I don't know, I have touched that for quite some time... :+1:

Re: [Library] Neutron.ahk - AutoHotkey Web GUIs on Steroids

Posted: 10 Mar 2022, 12:47
by SirSocks
Is it possible to open a local file with Neutron? For security reasons, Web Browsers won't open local files. But there must be a way to allow Neutron to run/open a local file.
For example: The following code will not open the document on a standard web browser. <a href="file:///C:\Users\Admin\Temp\My_Document.docx"> Document Link </a>
What method can be used to run/open a local file using Neutron?

Re: [Library] Neutron.ahk - AutoHotkey Web GUIs on Steroids

Posted: 10 Mar 2022, 13:26
by joedf
Why not tie it with a onclick event and open it with ahk? :think:

Just modifying an example shown here: https://github.com/G33kDude/Neutron.ahk

Code: Select all

neutron := new NeutronWindow("<button onclick='ahk.Clicked(event)'>Hi</button>")
neutron.Show()
return

Clicked(neutron, event)
{
    MsgBox, % "You clicked: " event.target.innerText
    Run, C:\Users\Admin\Temp\My_Document.docx ; or get the filepath from an attribute on the element?
}

Re: [Library] Neutron.ahk - AutoHotkey Web GUIs on Steroids

Posted: 10 Mar 2022, 14:46
by SirSocks
@joedf Thank you for pointing the OneClick method. That's very helpful! :thumbup:

Re: [Library] Neutron.ahk - AutoHotkey Web GUIs on Steroids

Posted: 10 Mar 2022, 16:05
by joedf
SirSocks wrote:
10 Mar 2022, 14:46
@joedf Thank you for pointing the OneClick method. That's very helpful! :thumbup:
Glad I could help! :thumbup:
and @geek for fantastic work.

Re: [Library] Neutron.ahk - AutoHotkey Web GUIs on Steroids

Posted: 12 Aug 2022, 05:56
by murataygun
Can we use real URL's instead of local html files? How?