AutoHotkey Community

It is currently May 26th, 2012, 9:50 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 106 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7, 8  Next
Author Message
 Post subject: On The Fly RTF
PostPosted: April 22nd, 2008, 12:59 am 
Offline

Joined: December 29th, 2007, 9:40 pm
Posts: 142
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...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 26th, 2008, 7:31 pm 
Offline

Joined: January 12th, 2008, 7:45 pm
Posts: 131
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...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 14th, 2008, 2:28 pm 
Offline

Joined: April 17th, 2007, 1:37 pm
Posts: 761
Location: Florida
Can the RichEdit control be made read only?

_________________
[Join IRC!]
Image


Report this post
Top
 Profile  
Reply with quote  
PostPosted: September 11th, 2008, 8:57 pm 
Offline

Joined: October 24th, 2007, 10:27 pm
Posts: 24
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")


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 11th, 2008, 10:07 pm 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2542
TodWulff, 300W, Rhys, sorry for the lack of response. I should check Email for notifications once in a while... :oops: .

TodWulff, If you're still looking for methods of changing text colours on the fly then pls let me know.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 11th, 2008, 10:22 pm 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2542
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 ;) .


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 11th, 2008, 10:24 pm 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2542
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


Report this post
Top
 Profile  
Reply with quote  
PostPosted: September 11th, 2008, 11:07 pm 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2542
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
  }


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 12th, 2008, 7:42 am 
Offline

Joined: October 24th, 2007, 10:27 pm
Posts: 24
Thanks, and by the way I think it's a great control.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 8th, 2008, 6:55 pm 
Offline

Joined: October 24th, 2007, 10:27 pm
Posts: 24
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?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 22nd, 2008, 12:43 pm 
Offline

Joined: August 25th, 2007, 9:25 pm
Posts: 110
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 28th, 2008, 1:03 pm 
Offline

Joined: November 23rd, 2007, 10:23 am
Posts: 841
Location: ~/.
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

_________________
Image
    All scripts, unless otherwise noted, are hereby released under CC-BY


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 28th, 2008, 2:29 pm 
Offline

Joined: April 17th, 2007, 1:37 pm
Posts: 761
Location: Florida
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!]
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 28th, 2008, 3:30 pm 
Offline

Joined: November 23rd, 2007, 10:23 am
Posts: 841
Location: ~/.
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)

_________________
Image
    All scripts, unless otherwise noted, are hereby released under CC-BY


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 29th, 2008, 3:11 am 
is there a new version?


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 106 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7, 8  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: fincs, Stigg, Yahoo [Bot] and 14 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group