Class RichEdit - update on 2015-04-14 (v0.1.05.00)

Post your working scripts, libraries and tools
Kliemann
Posts: 6
Joined: 20 Jan 2016, 09:07

Re: Class RichEdit - update on 2015-04-14 (v0.1.05.00)

27 Jan 2016, 08:00

Well, up to now I couldn't figure out how to disable redrawing. Any clue???
Kliemann
Posts: 6
Joined: 20 Jan 2016, 09:07

Re: Class RichEdit - update on 2015-04-14 (v0.1.05.00)

28 Jan 2016, 07:19

The wordwrap switching approach has some drawbacks, but after a while I came up with an 'acceptable' solution thanks to the possibility of obtaining the absolute caret position and to a particularity of the stringreplace function, which I could then use to quickly count the occurrences of carriage-returns in the plain text. However, this solution may not perform well on long texts (not tested yet). My code is below:

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

cp := 0
SendMessage, 0xB0, &cp, 0, , % "ahk_id " . RE2.HWND
cp := NumGet(cp, 0, "UInt") + 1 ; Absolute caret position
s := RE2.GetText()
if (cp>1)
stringleft, s, s, % (cp-1)
else
s := ""
stringreplace, s, s, `r, `r, UseErrorLevel
paragraph := ErrorLevel+1



Now, for the next step, I am interested in a way to set the absolute caret position...
a_ber
Posts: 14
Joined: 15 Mar 2016, 14:52

Re: Class RichEdit - update on 2015-04-14 (v0.1.05.00)

15 Mar 2016, 15:01

hy just me,

first, you app is really great! i use it to show dedicated information on a very simple rtf gui. my problem is to follow links (email adr. or www) shown in the gui. is there a possibility to make it happen? i use win 10 x64 and the latest ahk compiler.


best regards
andreas
Attachments
ahk.jpg
just me
Posts: 5082
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Class RichEdit - update on 2015-04-14 (v0.1.05.00)

16 Mar 2016, 03:08

Hi Andreas,

do you speak German? If so, you'll find some hints in this german thread: Fragen zum RichEdit Control.
User avatar
AlphaBravo
Posts: 318
Joined: 29 Sep 2013, 22:59

Re: Class RichEdit - update on 2015-04-14 (v0.1.05.00)

17 Mar 2016, 11:40

First off, great Class, thanks for sharing just me.
I just recently started messing with it and was wondering if it is possible to change text format without having to select it.
i.e. use RE.SetFont({BkColor: VarHasColor}) on a text by defining its start/end without changing current selection.
a_ber
Posts: 14
Joined: 15 Mar 2016, 14:52

Re: Class RichEdit - update on 2015-04-14 (v0.1.05.00)

17 Mar 2016, 12:20

hy,

yes i'm fluent in german ;-) and thanks again for your tip - after a nightshift yesterday it works ...

br from vienna
andreas
a_ber
Posts: 14
Joined: 15 Mar 2016, 14:52

Re: Class RichEdit - update on 2015-04-14 (v0.1.05.00)

17 Mar 2016, 15:05

zu früh gefreut, bei win10 tritt folgender fehler nach dem klicken auf eine mailadress auf (siehe screenshot). der aufruf ist simple:

cpMax := NumGet(A_EventInfo + 0, (A_PtrSize * 5) + 8, "Int")
URLtoOpen := GetTextRange(RE2.HWND, cpMin, cpMax)
Run, %URLtoOpen%

bei win7 ist alles gut (jeweils 64bit)
Attachments
2016-03-17_210237.jpg
just me
Posts: 5082
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Class RichEdit - update on 2015-04-14 (v0.1.05.00)

18 Mar 2016, 01:52

@AlphaBravo: You can change the text attributes either for the current selection or for text subsequently entered after the current caret position.

@a-ber: I'm running Win 10 and will check it.
just me
Posts: 5082
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Class RichEdit - update on 2015-04-14 (v0.1.05.00)

18 Mar 2016, 10:08

@a-ber:

I cannot reproduce the problem here (Win 10 x64). Would you please provide the complete code used in the message handler?
BTW: GetTextRange() is a built-in method now and I used it instead of your function call.
a_ber
Posts: 14
Joined: 15 Mar 2016, 14:52

Re: Class RichEdit - update on 2015-04-14 (v0.1.05.00)

18 Mar 2016, 10:53

here we are ...

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

	Options := "w500 h480 gRE2MessageHandler"
If !IsObject(RE2 := New RichEdit(1, Options)) ; define window
{
MsgBox, 16, Error, %ErrorLevel%
ExitApp
}
RE2.SetEventMask(["LINK"])
RE2.SetOptions(["READONLY"], "SET")
; RE2.AutoURL(1)
RE2.WordWrap(1)



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

just me
Posts: 5082
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Class RichEdit - update on 2015-04-14 (v0.1.05.00)

19 Mar 2016, 02:43

Hi a_ber,

I still cannot reproduce any problems here. Can you provide an example of your predefined RTF files?
a_ber
Posts: 14
Joined: 15 Mar 2016, 14:52

Re: Class RichEdit - update on 2015-04-14 (v0.1.05.00)

19 Mar 2016, 08:39

hy, i changed the beginning of my script and now all the links (www and mail) work both in win10 & win7. but i have no clue why ;-)

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

	Clipboard :=
;Send, ^{Left}+^{Right}^c ; get word under mouse/cursor
Send, {LButton 2}^c
ClipWait, 3


btw, i also commented out "SendMode, Input", which caused problems in getting text under cursor.

you mentioned that "GetTextRange()" is now system built in, how look like the code instead?

thx & best regards
andreas
just me
Posts: 5082
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Class RichEdit - update on 2015-04-14 (v0.1.05.00)

19 Mar 2016, 10:42

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

ahklearner
Posts: 265
Joined: 23 Jan 2015, 01:49

Re: Class RichEdit - update on 2015-04-14 (v0.1.05.00)

04 Nov 2016, 05:35

Hi BGM :salute:
Could you please help me with this.
RichEdit.ahk highlight help bold and red color https://autohotkey.com/boards/viewtopic.php?f=5&t=24339
Thank You

BGM wrote:Okay!

Here is a working SIMPLE example of using the RichText Class for folks who just want the basics.

It demonstrates:
  • How to add the control
  • How to use ToggleFontStyle (which I did find in the class file)
  • How to colourize using richtext tags
  • How to insert and clear text content
  • How to fetch the content using the v-variable in the control's options

screenshot_AutoHotkey (AutoHotkey Unicode 32-bit)_005.png

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

DigiDon
Posts: 114
Joined: 19 May 2014, 04:55

Re: Class RichEdit - update on 2015-04-14 (v0.1.05.00)

25 Jan 2018, 15:42

Hi just me, hello all, ;)

I have been implementing this great class into a project for some time now.
I did a few improvements but mostly minors until now because I am not very at ease with msdn documentation.

However there are some more complicated features that I think would be really great to implement.

If someone is up for the challenges and could at least give a first try/look that would be wonderful ! 8-)

Here what I think could be added/improved. What do you think about it?
@just me: do you think some of these are possible?

Support for OLE object = embedded objects of Powerpoint, Excel spreadsheet and other files!
Considering what I saw here :
https://www.codeproject.com/Articles/95 ... s-and-Othe
that might be possible !
By the way, it seems autoit has implemented it no?
https://github.com/forcedotcom/dataload ... chEdit.au3

Support for images in Win 7:
I know this has been asked and answered that image support wworks on win>8 but for what I've read there might be the solution to load images as bitmap using Gdip so that win 7 would display images.
https://www.autoitscript.com/forum/topi ... e-problem/
However I have not been able to even see a icon of the image using the class.
If I use RE2.SetEventMask(["DROPFILES"]) and/or set RichEditGuiDropFiles label, that doesn't seem to produce something.

Friendly Hyperlink
I have been like others be able to implement AutoURL detection but then you have to put the link as such.
It would be great to have a text independant from the link.
The best would be to be able to right clic it and even be able to enter a new label for the link after it has been added.
But first things first.
Here are some documentation
https://blogs.msdn.microsoft.com/murray ... yperlinks/
https://stackoverflow.com/questions/425 ... -trichedit

I have given a try:
Spoiler


Well I will probably try a bit harder soon but I kindda su** at it so any help would be great :D
Thanks !
Knowledge is knowing a tomato is a fruit; wisdom is not putting it in a fruit salad. (Miles Kington)
DigiDon
Posts: 114
Joined: 19 May 2014, 04:55

Re: Class RichEdit - update on 2015-04-14 (v0.1.05.00)

25 Jan 2018, 15:52

By the way here is a small contribution of my own ;)

Insert clickable links of files by drag-and-drop

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



and add this in UpdateRNGui

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

if !(FileDropped)
RE2.Sel := RE2.GetSel()


I have come to find this solution to get the Sel so that you can insert filelinks where you were and not just append them.
Knowledge is knowing a tomato is a fruit; wisdom is not putting it in a fruit salad. (Miles Kington)
just me
Posts: 5082
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Class RichEdit - update on 2015-04-14 (v0.1.05.00)

25 Jan 2018, 17:28

Hi DigiDon,

I lost interest in maintaining this class furthermore. Do you want to continue? If so, open a new thread, please. I'll add a link to the new thread and ask the mods to close this one.
DigiDon
Posts: 114
Joined: 19 May 2014, 04:55

Re: Class RichEdit - update on 2015-04-14 (v0.1.05.00)

26 Jan 2018, 07:34

Hi everyone,

We've PMed with just me and I asked for some time before deciding to pick up the topic.
I would need some help because this goes beyound my capabilities right now. So the question is:
Who could be interested in trying to improve this class with me on these topics?
So please don't hesitate to contact me and/or post here if you think you could help with these subjects
Cheers ! :)

Support for OLE object = embedded objects of Powerpoint, Excel spreadsheet and other files!
https://www.codeproject.com/Articles/95 ... s-and-Othe

Support for images in Win 7:
https://www.autoitscript.com/forum/topi ... e-problem/

Friendly Hyperlink
https://blogs.msdn.microsoft.com/murray ... yperlinks/
https://stackoverflow.com/questions/425 ... -trichedit

AutoIt class (for reference)
https://github.com/forcedotcom/dataloader/blob/master/windows-dependencies/autoit/Include/GuiRichEdit.au3
Knowledge is knowing a tomato is a fruit; wisdom is not putting it in a fruit salad. (Miles Kington)
DigiDon
Posts: 114
Joined: 19 May 2014, 04:55

Re: Class RichEdit - update on 2015-04-14 (v0.1.05.00)

27 Jan 2018, 10:12

Knowledge is knowing a tomato is a fruit; wisdom is not putting it in a fruit salad. (Miles Kington)

Return to “Scripts and Functions”

Who is online

Users browsing this forum: jcash and 21 guests