AHK HTML Editor test (W.I.P.)

Post your working scripts, libraries and tools for AHK v1.1 and older
burque505
Posts: 1732
Joined: 22 Jan 2017, 19:37

AHK HTML Editor test (W.I.P.)

15 Dec 2018, 18:01

I got off on this tangent after a post elsewhere regarding RTF <-> HTML. I believe this is the start of an HTML Editor, impoverished though it may be at this time. I think the rest is just digging into MSDN for the proper editing commands.
EDIT: From now on I'll put the latest version in this post. I'm leaving the rest of the versions where they are for now.
EDIT: (20181223). IE-based variant with design-mode toggle in my last post below.
(Edited 20181222 - 1755 MST, some updates, in ZIP, NOT in spoiler. Needed image files now included.)
(Edited 20220413 - pseudo-fix Ctrl-C, Ctrl-X, Ctrl-V in GUi)
(Edited 20220415 - fix Ctrl-C, Ctrl-X, Ctrl-V, add 'Paste" button again)
Latest version is 0.0.4 (attached)
  • Bullets
  • Numbering
  • Indent
  • Outdent
  • Undo
  • TextArea
  • iFrame
  • Marquee
  • InsertImage
  • Improved InsertLink
  • Insert <BR>
  • Insert Button
  • Improved Insert txt/HTML/js (at current position)
Many bugs and missing features still. Still very much W.I.P. For example:
  • No .ini yet, no settings dialog.
  • Still need to be able to set properties from GUI, not source, and not by just inserting HTML
EDIT: Removing 20181219 code.

Regards,
burque505
EDIT: Forgot the HTML! Don't think it's needed anymore. It isn't.
(GIF is a little corrupted at the end. The file itself displays correctly.) New GIF 20181222
122218.gif
122218.gif (223.04 KiB) Viewed 4713 times
Attachments
HTML Editor 0.0.4.zip
(14.54 KiB) Downloaded 98 times
121918.gif
121918.gif (625.25 KiB) Viewed 4827 times
Last edited by burque505 on 15 Apr 2022, 16:20, edited 10 times in total.
User avatar
adegard
Posts: 90
Joined: 24 Nov 2017, 05:58
Contact:

Re: AHK HTML Editor test (W.I.P.)

16 Dec 2018, 04:33

Great @burque505!
good idea... It's a good start, I subscribe!
Note: I personally use bootstrap templates... is'it a way to make an editor for it? There'is a lot of commercial solution, but few are adapt ot boostrap in open source...
r2997790
Posts: 71
Joined: 02 Feb 2017, 02:46

Re: AHK HTML Editor test (W.I.P.)

16 Dec 2018, 05:10

Nice job. I can see this having a lot of potential. Particularly if you want say 'intelligent' HTML formatting of content you could dump it something like this and parse the text and call the HTML tag functions.
burque505
Posts: 1732
Joined: 22 Jan 2017, 19:37

Re: AHK HTML Editor test (W.I.P.)

16 Dec 2018, 13:13

@adegard, @r2997790, thanks for the encouragement. Here's another iteration, same HTML file. There are still bugs and missing features galore. It needs a menu bar, toolbar, so it looks like it was designed by a human. Baby steps ...
Spoiler
HTML Edit 3.gif
HTML Edit 3.gif (206.64 KiB) Viewed 5094 times
burque505
Posts: 1732
Joined: 22 Jan 2017, 19:37

Re: AHK HTML Editor test (W.I.P.)

16 Dec 2018, 17:02

A few steps forward ... much to do still. No HTML for this one, it navigates to "about:blank". You can save it, though. More on that later.
Spoiler
HTML Edit 4.gif
HTML Edit 4.gif (156.15 KiB) Viewed 5059 times
burque505
Posts: 1732
Joined: 22 Jan 2017, 19:37

Re: AHK HTML Editor test (W.I.P.)

16 Dec 2018, 17:13

Hmmm ... editing MS Word content in the browser. Sort of ...
HTML Edit 5.gif
HTML Edit 5.gif (190.3 KiB) Viewed 5055 times
User avatar
kczx3
Posts: 1640
Joined: 06 Oct 2015, 21:39

Re: AHK HTML Editor test (W.I.P.)

16 Dec 2018, 20:56

Check this out if you haven’t already - https://msdn.microsoft.com/en-us/window ... 0(v=vs.71)
burque505
Posts: 1732
Joined: 22 Jan 2017, 19:37

Re: AHK HTML Editor test (W.I.P.)

16 Dec 2018, 21:07

Thanks for the tip. I had seen this one but yours looks more on point for sure.
Regards,
burque505
User avatar
Delta Pythagorean
Posts: 627
Joined: 13 Feb 2017, 13:44
Location: Somewhere in the US
Contact:

Re: AHK HTML Editor test (W.I.P.)

16 Dec 2018, 21:17

So far, I love the idea and the work you put into it, but I think you could definitely work on getting this to be a lot easier to not only use, but read in your code. As of right now, I'm currently working on that.
I'd love to see anyone else chipping in and getting this to fully be functional and working.

[AHK]......: v2.0.12 | 64-bit
[OS].......: Windows 11 | 23H2 (OS Build: 22621.3296)
[GITHUB]...: github.com/DelPyth
[PAYPAL]...: paypal.me/DelPyth
[DISCORD]..: tophatcat

tmplinshi
Posts: 1604
Joined: 01 Oct 2013, 14:57

Re: AHK HTML Editor test (W.I.P.)

17 Dec 2018, 00:22

Nice!

BTW, this also works:

Code: Select all

Gui, Add, Button, Default w80, Bold
Gui, Add, ActiveX, w980 h640 vWB, about:Bold Me
Gui, Show

doc := WB.Document
doc.DesignMode := "On"
return

ButtonBold:
	doc.execCommand("Bold")
return

GuiClose:
ExitApp
DRocks
Posts: 565
Joined: 08 May 2018, 10:20

Re: AHK HTML Editor test (W.I.P.)

17 Dec 2018, 08:10

Very cool
Last edited by DRocks on 17 Dec 2018, 08:13, edited 1 time in total.
burque505
Posts: 1732
Joined: 22 Jan 2017, 19:37

Re: AHK HTML Editor test (W.I.P.)

17 Dec 2018, 08:11

@tmplinshi, @Delta Pythagorean, thank you for your help and comments. As always, I am grateful for any help. I know the code is uncommented as of yet, sorry.
Latest version is in OP from now on. Bugs to be squashed and features glaringly missing:
  • Links "self-activate" on "Refresh", which for now is the only way to save.
  • Opening and saving are cumbersome and not intuitive.
  • Need to be able to change background color easily.
  • Need to add font color, customizeable font size
  • Need color picker.
  • Need table support.
  • Javascript support desperately needed.
At the end of the animated GIF, the last link activates after refresh. Epic fail ... next candidate for squashing. I think I need to disable navigation.
HTML Edit 6.gif
burque505
Posts: 1732
Joined: 22 Jan 2017, 19:37

Re: AHK HTML Editor test (W.I.P.)

18 Dec 2018, 15:32

Teaser. Progress with JS and active content. More soon.
EDIT: See OP for 20181219 version. Thanks. GIF removed from this post.
burque505
Posts: 1732
Joined: 22 Jan 2017, 19:37

Re: AHK HTML Editor test (W.I.P.)

21 Dec 2018, 08:40

(December 21, 2018) Latest version in ZIP in OP.
DRocks
Posts: 565
Joined: 08 May 2018, 10:20

Re: AHK HTML Editor test (W.I.P.)

22 Dec 2018, 16:33

this is getting good pretty quickly! good job
burque505
Posts: 1732
Joined: 22 Jan 2017, 19:37

Re: AHK HTML Editor test (W.I.P.)

22 Dec 2018, 16:38

Thanks, DRocks, I appreciate the encouragement. I hope to have buttons, textareas, marquees, and iFrames by the end of the day, although they will all still need a lot of work, especially in setting properties.
Regards,
burque505
burque505
Posts: 1732
Joined: 22 Jan 2017, 19:37

Re: AHK HTML Editor test (W.I.P.)

23 Dec 2018, 18:01

IE version, design mode, proof of concept only. First try.
122318-3.gif
122318-3.gif (806.01 KiB) Viewed 4680 times
Browser HTML Editor.zip
(13.9 KiB) Downloaded 116 times
User avatar
Delta Pythagorean
Posts: 627
Joined: 13 Feb 2017, 13:44
Location: Somewhere in the US
Contact:

Re: AHK HTML Editor test (W.I.P.)

23 Dec 2018, 21:08

I think it'd be better to attach the AHK gui to the IE window and then have the IE window be its own thing.

Also, I highly suggest putting most of these actions into menus instead of having everything be button-based.

[AHK]......: v2.0.12 | 64-bit
[OS].......: Windows 11 | 23H2 (OS Build: 22621.3296)
[GITHUB]...: github.com/DelPyth
[PAYPAL]...: paypal.me/DelPyth
[DISCORD]..: tophatcat

burque505
Posts: 1732
Joined: 22 Jan 2017, 19:37

Re: AHK HTML Editor test (W.I.P.)

24 Dec 2018, 10:17

DP, thanks for your suggestions.
At some point, hopefully, there will be menus, a floating toolbar, .ini file, settings dialog, template chooser, form builder, a selector inspector, and a help file.
And bells. And whistles :)
Regards, and happy holidays,
burque505 :xmas:
User avatar
kczx3
Posts: 1640
Joined: 06 Oct 2015, 21:39

Re: AHK HTML Editor test (W.I.P.)

24 Dec 2018, 11:01

And a one horse, open sleigh?

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: No registered users and 59 guests