 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
TodWulff
Joined: 29 Dec 2007 Posts: 139
|
Posted: Mon Apr 21, 2008 11:59 pm Post subject: On The Fly RTF |
|
|
Ok, I have successfully integrated the control into my project - woo hoo!
With the code you offered up a couple of posts ago, along with some minor tweaks, I was able to get the autoscrolling functioning as desired - i.e. retaining the positioning and selection when autoscroll is deselected, and automagically autoscrolling when same is selected.
Right now I am using a checkbox control with which to implement this. I am struggling a bit with the math to determine if the vertical scroll button is located at the bottom of the scroll bar, in order to programmatically turn auto-scrolling on and off. That is a battle for another day, however, as the checkbox control is fine, and I may just leave it in there, instead of trying to get cute.
The next step is to take advantage of the feature set that the tool offers.
I have implemented the RE control as a console display, displaying received text from a serially connected device. The device can generate user output from the user application, but also provides firmware messages (i.e. when programming is complete, etc.).
I'd like to differentiate the user app generated dialogue from the firmware generated dialogue via the use of different colors inside of the console (the RE control). i.e.:
| Quote: | Resetting...
Going Interactive...
Welcome back to ARMbasic Kernel[7.09] Copyright 2007, Coridium Corp.
Ready...
Flashing ARMmite v2 on COM 3 ... 0.38K code 0.02K data programmed
Resetting...
Going Interactive...
Welcome back to ARMbasic Kernel[7.09] Copyright 2007, Coridium Corp.
Ready...
Executing...
Testing... 5
Testing... 4
Testing... 3
Testing... 2
Testing... 1
BOOM!!!!!!!!
Going Interactive...
Going Interactive...
... Finished in 5036 ms
Resetting...
Going Interactive...
Welcome back to ARMbasic Kernel[7.09] Copyright 2007, Coridium Corp.
Ready...
|
Historically, I have given the user the ability to clear the control's contents by simply clicking a clear button, in which case, it totally erases the control's contents by setting it to null.
What I am struggling with is the implementation of the colorization of the text.
In reading the RTF specs from various sources, it seems that the control will need to have some embedded (markup) header information, as well as some inline markup for tagging the text in order to be different colors.
Maybe I am over-thinking it.?.
Is this indeed the case, or can I simply blank out the control, and then add arbitrary text, with inline mark-up, in order to get the desired results - on the fly? Or would I be better served to have a template file with which to use to hold the active console content. And inside of this template file is where I would store the (required ?) rtf header/color tables/etc. and periodically update the control's contents by placing my received strings inside of the template file and then pushing the content to the RE control?
I prolly over complicated what I am struggling with, but hopefully someone will be able to ascertain what I am trying to accomplish and offer constructive feedback on how best to accomplish this.
Please review and advise. Thank you!
-t _________________ When replying, please feel free to address me as Tod. My AHK.net site... |
|
| Back to top |
|
 |
Ice_Tea
Joined: 12 Jan 2008 Posts: 131
|
Posted: Sat Apr 26, 2008 6:31 pm Post subject: |
|
|
| Hey, it was a long time ago i read this thread, but i don't remember anyone mentioning this... Are you going to add support for pictures? In wordpad you are unable to see pictures in rtf documents but on microsoft word I'm able to see pictures i add to the rtf document... |
|
| Back to top |
|
 |
Rhys
Joined: 17 Apr 2007 Posts: 761 Location: Florida
|
Posted: Mon Jul 14, 2008 1:28 pm Post subject: |
|
|
Can the RichEdit control be made read only? _________________ [Join IRC!]
 |
|
| Back to top |
|
 |
Q
Joined: 24 Oct 2007 Posts: 24
|
Posted: Thu Sep 11, 2008 7:57 pm Post subject: Get text chops off the last character |
|
|
I'm using cRichEdit.ahk Version 0.09 beta.
When I do the following to get the text back from the control, it looses the last character, please help.....
editnote1:=cRichEdit(REdit1, "GETTEXT") |
|
| Back to top |
|
 |
corrupt
Joined: 29 Dec 2004 Posts: 2485
|
Posted: Thu Sep 11, 2008 9:07 pm Post subject: |
|
|
TodWulff, 300W, Rhys, sorry for the lack of response. I should check Email for notifications once in a while... .
TodWulff, If you're still looking for methods of changing text colours on the fly then pls let me know. |
|
| Back to top |
|
 |
corrupt
Joined: 29 Dec 2004 Posts: 2485
|
Posted: Thu Sep 11, 2008 9:22 pm Post subject: |
|
|
| 300W wrote: | | Hey, it was a long time ago i read this thread, but i don't remember anyone mentioning this... Are you going to add support for pictures? In wordpad you are unable to see pictures in rtf documents but on microsoft word I'm able to see pictures i add to the rtf document... | At the moment I'm not planning on adding support for pictures but I would be happy to include and/or add support for code for additional features if anyone else would like to contribute code that provides additional functionality . |
|
| Back to top |
|
 |
corrupt
Joined: 29 Dec 2004 Posts: 2485
|
Posted: Thu Sep 11, 2008 9:24 pm Post subject: |
|
|
| Rhys wrote: | | Can the RichEdit control be made read only? | Yes. One method is to modify the style parameter when creating the control. | Code: | cGUI("Add", REdit1, 10, 40, 480, 450, "RichEdit20A", "", 0x54B371C4|0x800) ; 0x800 = ES_READONLY
|
|
|
| Back to top |
|
 |
corrupt
Joined: 29 Dec 2004 Posts: 2485
|
Posted: Thu Sep 11, 2008 10:07 pm Post subject: Re: Get text chops off the last character |
|
|
| Q wrote: | I'm using cRichEdit.ahk Version 0.09 beta.
When I do the following to get the text back from the control, it looses the last character, please help.....
editnote1:=cRichEdit(REdit1, "GETTEXT") | Thanks for reporting the bug . This will be fixed in the next release (hopefully later today). If you need something sooner then please update this section in the cRichEdit.ahk file: | Code: | /*
*****************************************************************************************
GetText - get the text in the control
_action = GetText
opt1 = (1 - unicode, 0 - ANSI) Default ANSI
*****************************************************************************************
*/
Else If _action = GetText
{
VarSetCapacity(_tmp3, 20, 0)
If (opt1)
_tmp2 = 1200
Else
_tmp2 = 1252
VarSetCapacity(_tmp1, 8, 0)
NumPut(0, _tmp1, 0)
NumPut(_tmp2, _tmp1, 4)
_tmpSize := DllCall("user32.dll\SendMessage", "UInt", _ctrlID, "UInt", 0x45F, "UInt", &_tmp1, "UInt", "0") + 1
If (_tmpSize) {
NumPut(_tmpSize, _tmp3, 0, "Int")
NumPut(_tmp2, _tmp3, 8, "Int")
VarSetCapacity(_tmp4, _tmpSize, 0)
DllCall("user32.dll\SendMessage", "UInt", _ctrlID, "UInt", 0x45E, "UInt", &_tmp3, "UInt", &_tmp4)
VarSetCapacity(_tmp4, -1)
}
Return _tmp4
} |
|
|
| Back to top |
|
 |
Q
Joined: 24 Oct 2007 Posts: 24
|
Posted: Fri Sep 12, 2008 6:42 am Post subject: |
|
|
| Thanks, and by the way I think it's a great control. |
|
| Back to top |
|
 |
Q
Joined: 24 Oct 2007 Posts: 24
|
Posted: Wed Oct 08, 2008 5:55 pm Post subject: |
|
|
once I have added this REDIT to my window I seem to be having difficulty resizing it.
How can you resize or move it once added to the window without destroying and recreating the window? |
|
| Back to top |
|
 |
flashkid
Joined: 25 Aug 2007 Posts: 110
|
Posted: Wed Oct 22, 2008 11:43 am Post subject: |
|
|
Is it possible to Highlight special words?
Example:
| Code: | Var = 20 Minutes
cRichEdit(REdit1, "Highlight", Var, Red)
MsgBox, Highlighted!
Sleep 10000
cRichEdit(REdit1, "HighlightRemove", Var)
MsgBox, Removed!
Sleep 5000
cRichEdit(REdit1, "Highlight", Var, Red)
Var2 = Another Highlight
cRichEdit(REdit1, "Highlight", Var2, Green) |
So that its shown as:
| Code: | It's 20 Minutes past 18 o'clock.
This Line is Another Highlight in the text. |
|
|
| Back to top |
|
 |
derRaphael
Joined: 23 Nov 2007 Posts: 841 Location: ~/.
|
Posted: Tue Oct 28, 2008 12:03 pm Post subject: |
|
|
how would i display images which are embedded from other RTF creating apps?
everytime i open the rtf, my text is shown, but the image is not available.
is this control specific behaviour or is this behaviour due to lack of rendering such as with GDI?
derRaphael _________________
All scripts, unless otherwise noted, are hereby released under CC-BY |
|
| Back to top |
|
 |
Rhys
Joined: 17 Apr 2007 Posts: 761 Location: Florida
|
Posted: Tue Oct 28, 2008 1:29 pm Post subject: |
|
|
Just chiming in that inline image support would be a huge benefit to this control, though I have no idea how difficult it would be to implement... _________________ [Join IRC!]
 |
|
| Back to top |
|
 |
derRaphael
Joined: 23 Nov 2007 Posts: 841 Location: ~/.
|
Posted: Tue Oct 28, 2008 2:30 pm Post subject: |
|
|
the idea was using this "image" feature with a script backend so that text can be collapsed by selecting according menu and the collapsed text is represented by a lil graphic, which reveals collapsed text upon click
but not having the possibility to show graphics at all, somehow makes the idea worthless...
(i want to use the richEd as a render engine for an advanced AHK based ahk editor with syntax highlighting - hiEdit is not an alternative, since it lacks support for several features such as proper highlighting for multiline comments, or counterpart control for all kind of brackets or quotationmarks etc) _________________
All scripts, unless otherwise noted, are hereby released under CC-BY |
|
| Back to top |
|
 |
Guest
|
Posted: Wed Oct 29, 2008 2:11 am Post subject: |
|
|
| is there a new version? |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|