AutoHotkey Community

It is currently May 26th, 2012, 5:50 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 106 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8  Next
Author Message
 Post subject:
PostPosted: February 1st, 2009, 7:41 pm 
Offline

Joined: March 27th, 2008, 7:46 pm
Posts: 129
Location: France
:) Hello World,
:arrow: cRichEdit - is very great, it's wonderfull Great Great Thank's

Q wrote:
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?




:!: me too !, i have tested with :
Code:
GuiControl , Move, ahk_id %REdit1%, X50 Y50 W400 H200   
; OR
GuiControl , Move, RichEdit20A,      X50 Y50 W400 H200   
; OR
GuiControl , Move, REdit1,          X50 Y50 W400 H200   
; OR
ControlMove , ahk_id %REdit1% , 50, 50, 400, 200,  ,

; OR>   DESTROY AND REMAKE BUT NO NO!
If (REdit1)
   {
  cRichEdit(ahk_id %REdit1%, "Destroy")
 
If A_OSVersion = WIN_95
  cGUI("1:Add:" . REparent1, REdit1, 50, 50, 400, 200, "RICHEDIT")
Else
  cGUI("1:Add:" . REparent1, REdit1, 50, 50, 400, 200, "RichEdit20A")
}

; don't Run!

But don't run!
:?: ¿ AnyBody have a solution ?

_________________
with ahk, all is different!...<img>


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 25th, 2009, 5:50 pm 
Hello, soggos! It's your mistake:
Code:
ControlMove , ahk_id %REdit1% , 50, 50, 400, 200,  ,
That's right:
Code:
ControlMove,, 50, 50, 400, 200, ahk_id %REdit1%


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 1st, 2009, 1:46 am 
Offline

Joined: March 27th, 2008, 7:46 pm
Posts: 129
Location: France
:oops: Arf...
:D it's run now correctly !great thank's mister _dmitry

_________________
with ahk, all is different!...<img>


Report this post
Top
 Profile  
Reply with quote  
 Post subject: corrupt!
PostPosted: April 26th, 2009, 12:55 pm 
thanks for the great script.

I've just seen this article.
http://www.delphidabbler.com/tips/57
It's about setrtf code to the richedit control.
I looked at your code-it was great- I was able to find getrtf funcion, but not setrtf function, and I'm pretty sure it's out of my league to make one.

So corrupt, please consider add the function.

Thanks


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 27th, 2009, 5:59 pm 
Offline
User avatar

Joined: September 8th, 2008, 12:26 am
Posts: 1048
Location: Ploieşti, RO
Would've been better if it was C/C++ code, IMHO, but this one should do fine for whoever is into Delphi. Let's hope there will be an update - I personally am quite interested in manipulating rich text, especially the Unicode part.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: GETTEXT or GetRTF
PostPosted: November 19th, 2009, 8:15 am 
Offline

Joined: November 18th, 2009, 5:18 pm
Posts: 20
I have a Richtextfield in a AHK script, i open a rtf file into it... Works great.

But when i press GO in the GUI i want it to copy that RichText field into the clipboard with the fromatting.

And when i go to my external software with a richtext field i pres ctrl +v to paste it in.

If i use GetRTF it copies the rtf source code, and if i use GETTEXT it copies plain text.

And if i open the rtf file in wordpad and copy and paste into my external software it works OK.

How do i copy richtext into clipboard like windows.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 19th, 2009, 10:21 pm 
Offline

Joined: December 4th, 2006, 10:35 am
Posts: 561
Location: Galil, Israel
search and find the setclipboard function [in these forums] and save the RTF to the clipboard as rtf...

_________________
Joyce Jamce


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Sorry to be a noob...
PostPosted: November 25th, 2009, 1:20 am 
Offline

Joined: September 29th, 2009, 1:02 pm
Posts: 75
This script/function is going way over my head :oops: Can someone give me an example code.

I'm working on a script that script that creates an email. The script copies data from Remedy and pastes it along with ready made text into the email. Presently I have to use send commands to turn the bold format on and off in Outlook as I paste the various parts of the email into it. I think this script might be able to allow me to simply paste the complete text in with one paste command and the propper places in the email already be bold... (like copying text from a webpage or from another word doc, into an email) Would it be possible to get some example code on how one would use this code with regular text and variables and only bold the variables, and then combine the bold variables and plain text into the clipboard...

Thanks in advance,
Sam


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Thanks
PostPosted: November 28th, 2009, 7:25 pm 
Offline

Joined: October 20th, 2009, 1:32 am
Posts: 9
really helpful release man - thanks


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 26th, 2010, 3:31 pm 
flashkid wrote:
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.


I have been wondering the same - anyone? :O


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 26th, 2010, 4:35 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
I think this module can't, but you could check RichEdit modules in Forms framework.


With FindText API you position cursor (or selection) on word you wont.

Then use SetCharFormat and its BackColor argument. When you find the word, you can select it and use WORD mode or SELECTION mode to color that word.

Then iterate to do so for each word you wont.
Also, if the scenario isn't dynamic, you can issue RTF data directly into the control. You can do that with corupts module also.

I might create sample that highlights search phrase for entire document when I find time.

You can also do that while control is scrolling so that words you supply are highlighted all the time (better to use HiEdit for that). Its not trivial programming tho.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 26th, 2010, 4:52 pm 
majkinetor wrote:
I think this module can't, but you could check RichEdit modules in Forms framework.


With FindText API you position cursor (or selection) on word you wont.

Then use SetCharFormat and its BackColor argument. When you find the word, you can select it and use WORD mode or SELECTION mode to color that word.

Then iterate to do so for each word you wont.
Also, if the scenario isn't dynamic, you can issue RTF data directly into the control. You can do that with corupts module also.

I might create sample that highlights search phrase for entire document when I find time.

You can also do that while control is scrolling so that words you supply are highlighted all the time (better to use HiEdit for that). Its not trivial programming tho.


Can't that highlighting be automatic for known words - just like in editors =)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 26th, 2010, 7:14 pm 
Offline

Joined: June 12th, 2008, 1:48 am
Posts: 27
#include wrote:
Can't that highlighting be automatic for known words - just like in editors =)

Well since I ventured down that road a while ago, maybe this is what you are looking for:
Problem with COM: Adapting a VB example to AHK
This works with any RichEdit, and works without needing to select a word to highlight it. I needed this for an error-log-console, and then I tried to implement syntax highlighting, like in editors: But even if the file is small, it takes way too long, since the keywords are numerous, and you have to check every word inside the richedit if it matches.
The next problem is, what to do if you change something (type a letter, which might complete a word to be matched, or move carret with mouse).
Better leave this to compiled dlls, like HiEdit or scite.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 27th, 2010, 8:48 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
dadepp is right.

Your request is not easy to accomplish with acceptable speed even in compiled languages.

I recall some editor authors had to abandon RichEdit because it was very hard to achieve generally usable performance.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
PostPosted: November 23rd, 2010, 9:50 am 
I think that you forgot something here.
I was messing with this and it was missing a character, so I changed 1 small thing, only one of the variables _tmpSize was _tmpSize + 1, so I put the other as + 1 and it retrieved all of the text.

Code:
  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")
    If (_tmpSize) {
      NumPut(_tmpSize, _tmp3, 0, "Int")   
      NumPut(_tmp2, _tmp3, 8, "Int")   
      VarSetCapacity(_tmp4, _tmpSize + 1, 0)
      DllCall("user32.dll\SendMessage", "UInt", _ctrlID, "UInt", 0x45E, "UInt", &_tmp3, "UInt", &_tmp4)
      VarSetCapacity(_tmp4, -1)
    }
  Return _tmp4
  }


Code:
      NumPut(_tmpSize + 1, _tmp3, 0, "Int")   
      NumPut(_tmp2, _tmp3, 8, "Int")   
      VarSetCapacity(_tmp4, _tmpSize + 1, 0)

cRichEdit.ahk
Version 0.09 beta
April 19, 2008


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 ... 4, 5, 6, 7, 8  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 13 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