Class RichEdit - update on 2015-04-14 (v0.1.05.00)
Re: Class RichEdit - rich edit control for AHK (Unicode)
@just me: not to hijack this thread for a license discussion but you may recall learning one does this for a living (if I remember correctly) http://www.autohotkey.com/board/topic/9 ... /?p=585319 by default no license can indeed mean most people won't touch it (however silly it may sound) so why not slap a mit, wtfpl or "something" on your scripts so people will feel comfortable using it? See also https://help.github.com/articles/open-s ... -a-license
Re: Class RichEdit - rich edit control for AHK (Unicode)
Then I would suggest either `Public Domain CC0` or `WTFPL` (http://www.wtfpl.net/), wtfpl2 http://wtfpl2.com/
Edit: whoops didn't see the post from Guest
Edit: whoops didn't see the post from Guest
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
Re: Class RichEdit - rich edit control for AHK (Unicode)
Well, I added a license file on GitHub.
Re: Class RichEdit - rich edit control for AHK (Unicode)
Ahh unlicense ! Perfect choice, just me!
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
Re: Class RichEdit - rich edit control for AHK (Unicode)
Each update, I have to add their own code. You can keep it anyway?
addition
How to set margins? Left and right sides Distance.
Thanks.
Beautiful code.
Code: Select all
Class_RichEdit(h,d,b:=True){
Return New RichEdit(h,d,b)
}
#Include %A_LineFile%\..\Class_RichEditDlgs.ahk
How to set margins? Left and right sides Distance.
Thanks.
Beautiful code.
Re: Class RichEdit - rich edit control for AHK (Unicode)
Another question: Strange WordWrap(1).
This is a line, WordWrap it become like this.
SetParaIndent()
SetBorder()
Can you help me write a function of these two parameters? I have been unable to correctly fill out.
This is a line, WordWrap it become like this.
SetParaIndent()
SetBorder()
Can you help me write a function of these two parameters? I have been unable to correctly fill out.
Re: Class RichEdit - rich edit control for AHK (Unicode)
https://github.com/G33kDude/MyRC/commit ... e2df9c5d3e
I implemented your RichEdit into my code. I'm particularly fond of my ToRTF and AppendChat functions.
I implemented your RichEdit into my code. I'm particularly fond of my ToRTF and AppendChat functions.
Re: Class RichEdit - rich edit control for AHK (Unicode)
Hi articir,
You have to pass two arrays to the function, the first with up to 4 line width values in the order left, top, right bottom and the second with up to 4 styles in the same order.
This has never been part of my scripts.Each update, I have to add their own code. You can keep it anyway?
I don't see much words which the control could use for wrapping. Strange input -> strange output.This is a line, WordWrap it become like this.
The method is buggy. It will be fixed soon.SetParaIndent()
SetBorder()
Code: Select all
SetBorder(Widths, Styles) { ; Set paragraph's borders
; Borders are not displayed in RichEdit, so the call of this function has no visible result.
; Even WordPad distributed with Win7 does not show them, but e.g. Word 2007 does.
...
Re: Class RichEdit - rich edit control for AHK (Unicode)
Thank you.
but I want to know, paragraph indents, two characters. Because I can not find methods.
AND, How to achieve this effect,edit Margins, This picture is AHK edit. I want to replace it Class RichEdit.
but I want to know, paragraph indents, two characters. Because I can not find methods.
AND, How to achieve this effect,edit Margins, This picture is AHK edit. I want to replace it Class RichEdit.
Re: Class RichEdit - rich edit control for AHK (Unicode)
If you used EM_SETMARGINS it will work for RichEdit controls, too.arcticir wrote:AND, How to achieve this effect,edit Margins, This picture is AHK edit. I want to replace it Class RichEdit.
The fix for indentation will be released soon.Th update will contain a changed example to demonstrate how to call the method.
Re: Class RichEdit - rich edit control for AHK (Unicode)
Well, indentation should work now. I fixed the SetParaIndent() method and changed the indentation sample. All indents are specified in centimeters/inches depending of the system/user settings. To see the all effects you have to switch to the Wrap as printed (WYSIWYG) view.
Re: Class RichEdit - rich edit control for AHK (Unicode)
Thanks.
===================
I have been tested , found 1 and -1 will set a normal indentation.
but I did not find that setting margins.
my English is very poor, not judge you words, can be set or not set.
===================
I have been tested , found 1 and -1 will set a normal indentation.
but I did not find that setting margins.
my English is very poor, not judge you words, can be set or not set.
Re: Class RichEdit - rich edit control for AHK (Unicode)
Hi arcticir,
I overlooked your last post, sorry!
Alternatively you can change the control's formatting rectangle with EM_SETRECT. With it you can set top and bottom margins, too:
In either case you have to switch to the Word-wrap view to see the effect. And, if you use EM_SETRECT, you should restore the original formatting rectangle before you switch to the Wrap as printed view.
I overlooked your last post, sorry!
EM_SETMARGINS is actually working:just me wrote:If you used EM_SETMARGINS it will work for RichEdit controls, too.arcticir wrote:AND, How to achieve this effect,edit Margins, This picture is AHK edit. I want to replace it Class RichEdit.
Code: Select all
...
EM_SETMARGINS(RE2.HWND, 60, 60) ; will set the left and right margin to 60 pixel
WinSet, Redraw, , % "ahk_id " . RE2.HWND
...
; ----------------------------------------------------------------------------------------------------------------------
EM_SETMARGINS(Hwnd, Left := "", Right := "") {
; EM_SETMARGINS = 0x00D3 -> http://msdn.microsoft.com/en-us/library/bb761649(v=vs.85).aspx
Set := 0 + (Left <> "") + ((Right <> "") * 2)
Margins := (Left <> "" ? Left & 0xFFFF : 0) + (Right <> "" ? (Right & 0xFFFF) << 16 : 0)
Return DllCall("User32.dll\SendMessage", "Ptr", HWND, "UInt", 0x00D3, "Ptr", Set, "Ptr", Margins, "Ptr")
}
Code: Select all
...
EM_GETRECT(RE2.HWND, L, T, R, B)
EM_SETRECT(RE2.HWND, 60, 60, R - 60, B - 60) ; will set all margings to 60 pixel.
WinSet, Redraw, , % "ahk_id " . RE2.HWND
...
; ----------------------------------------------------------------------------------------------------------------------
EM_GETRECT(HWND, ByRef Left, ByRef Top, ByRef Right, ByRef Bottom) {
; EM_GETRECT = 0x00B2 -> http://msdn.microsoft.com/en-us/library/bb761596(v=vs.85).aspx
VarSetCapacity(RC, 16, 0)
DllCall("User32.dll\SendMessage", "Ptr", HWND, "UInt", 0x00B2, "Ptr", 0, "Ptr", &RC, "Ptr")
Left := NumGet(RC, 0, "Int"), Top := NumGet(RC, 4, "Int")
Right := NumGet(RC, 8, "Int"), Bottom := NumGet(RC, 12, "Int")
Return True
}
EM_SETRECT(HWND, Left, Top, Right, Bottom) {
; EM_SETRECT = 0x00B3 -> http://msdn.microsoft.com/en-us/library/bb761657(v=vs.85).aspx
VarSetCapacity(RC, 16, 0)
NumPut(Left, RC, 0, "Int"), NumPut(Top, RC, 4, "Int")
NumPut(Right, RC, 8, "Int"), NumPut(Bottom, RC, 12, "Int")
DllCall("User32.dll\SendMessage", "Ptr", HWND, "UInt", 0x00B3, "Ptr", 0, "Ptr", &RC, "Ptr")
Return True
}
Re: Class RichEdit - rich edit control for AHK (Unicode)
Thank you.
This is what I need.
This is what I need.
Re: Class RichEdit - rich edit control for AHK (Unicode)
Any chance of this? Images that is. Thankstmplinshi wrote:+1Chef wrote:Hello just me,
Can you make it load pictures too?
Re: Class RichEdit - rich edit control for AHK (Unicode)
No progress.I wrote:Honestly, I've already tried without success, because it is one of the things I'm missing, too. But it seems that pictures included by Word or WordPad are not just 'not displayed' but, even worse, stripped from the RTF on loading. I don't know whether this is a script issue or a control feature. Sorry, I don't have a clue!
Re: Class RichEdit - rich edit control for AHK (Unicode)
Don't know if there is a better place/way to post this but I'll offer a $30 paypal bounty if someone wants to get images working correctly.
Thanks for the class just me.
Thanks for the class just me.
Re: Class RichEdit - rich edit control for AHK (Unicode)
I want to "get images working correctly".
So you might pay just me.
So you might pay just me.
Re: Class RichEdit - rich edit control for AHK (Unicode)
touché...
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
Re: Class RichEdit - rich edit control for AHK (Unicode)
Hi just me,
Is it possible to use your class on existing rich edit controls generated from other apps? If so, could you give me some advice as to how to go about it?
Thank you,
iPhilip
Is it possible to use your class on existing rich edit controls generated from other apps? If so, could you give me some advice as to how to go about it?
Thank you,
iPhilip
Windows 10 Pro (64 bit) - AutoHotkey v2.0+ (Unicode 64-bit)