 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Do you want HiEdit internaly |
| Yes |
|
52% |
[ 37 ] |
| No, I like Edit control |
|
28% |
[ 20 ] |
| Other (please explain) |
|
19% |
[ 14 ] |
|
| Total Votes : 71 |
|
| Author |
Message |
freakkk
Joined: 29 Jul 2005 Posts: 179
|
Posted: Wed Oct 22, 2008 8:49 pm Post subject: |
|
|
| Drugwash wrote: | | Could this be taken care of, someday, please? Thank you. | Go for it dude; its open source. Just make sure to share your results. Thank you  _________________ .o0[ corey ]0o. |
|
| Back to top |
|
 |
Drugwash
Joined: 07 Sep 2008 Posts: 608 Location: Ploiesti, RO
|
Posted: Wed Oct 22, 2008 9:22 pm Post subject: |
|
|
Hmmm... usually I don't like playing with someone else's toys, coz I tend to break them.
Now, I'm just a noob at AHK as compared to what I've witnessed around and also got quite a bucketful of projects to bring to life, but if I get a pool of spare time I might take a look at the script, provided it's not the dll's fault (which comes with no sources, at least in the package that's listed on this board). And I might also make it 9x only, since many guys around make their scripts 2000+ only - I'm on 98SE, guys and will die with it!
Scratch that, was just kidding - I'm not that selfish.  |
|
| Back to top |
|
 |
jballi
Joined: 01 Oct 2005 Posts: 537 Location: Texas, USA
|
Posted: Fri Oct 31, 2008 6:29 pm Post subject: |
|
|
This one has me banging my head...
Synopsis: Possible bug with the HE_GetSelText function. The function does not return the selected text (returns blank) if called from a process that did not create the HiEdit object.
The full story...
I have two scripts. The first script creates a window with a HiEdit object. The second scripts manipulates the HiEdit object using HE_* functions. All of the HE_* functions that I call work fine except for HE_GetSelText function which is supposed to copy selected text to a variable. This function, when called from the 2nd script, always returns a blank value. If I get rid of the 2nd script (put all of the code from the 2nd script into the 1st script), the HE_GetSelText function works as expected.
The "problem" appears to occur at the EM_GETSEL Message although the return code for the message indicates that the correct number of characters has been copied.
Anyone have any ideas on how to fix this bug?
Thanks for your assistance.
P.S. This phenomenon also occurs with cRichEdit library, action=GetSelText when used on a Rich Edit control. Since the functions are programmatically identical, it makes sense that this function doesn't work either. |
|
| Back to top |
|
 |
majkinetor ! Guest
|
Posted: Fri Oct 31, 2008 7:58 pm Post subject: |
|
|
| It looks like interprocess limitation. You should re-implement function using RemoteBuffer module and I expect it to work. |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 4114 Location: Belgrade
|
Posted: Fri Oct 31, 2008 8:02 pm Post subject: |
|
|
And if that for some reason doesn't work (which I doubt) you can easily use IPC module to request data from the script from another script. _________________
 |
|
| Back to top |
|
 |
jballi
Joined: 01 Oct 2005 Posts: 537 Location: Texas, USA
|
Posted: Sat Nov 01, 2008 12:21 pm Post subject: |
|
|
| majkinetor wrote: | | It looks like interprocess limitation. You should re-implement function using RemoteBuffer module and I expect it to work. |
An "interprocess limitation" appears to be the case. For this message, the control does not want to access memory outside it's own process. I was able to get the message to work using the "Remote Buffer" library. In a nutshell, the code to collect the selected text using the EM_GETSELTEXT message looks something like the following :
| Code: | SelectedTextSize:=EndSelectPosition-StartSelectPosition+1
;-- Size needs to be length of selected text plus 1. Extra byte is
; used to store terminating null character.
bufID:=RemoteBuf_Open(hWnd_Of_Remote_Window,SelectedTextSize)
SendMessage
,EM_GETSELTEXT ;-- EM_GETSELTEXT=0x43E
,0
,RemoteBuf_Get(bufID,"adr") ;-- Address of remote buffer
,%Control%
,%WinTitle%
VarSetCapacity(SelectedText,SelectedTextSize)
RemoteBuf_Read(bufID,SelectedText,SelectedTextSize)
RemoteBuf_Close(bufID)
|
Thanks for providing the "Remote Buffer" library. It was definitely what was needed to solve this problem. I found a few small bugs/issues with the library but I'll post 'em in the "Remote Buffer" post so as not to clutter up this post any more.
Thanks for pointing me in the right direction. |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 4114 Location: Belgrade
|
Posted: Mon Nov 03, 2008 2:29 pm Post subject: |
|
|
You are welcome. _________________
 |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 4114 Location: Belgrade
|
Posted: Mon Nov 10, 2008 12:25 pm Post subject: |
|
|
Version 3.0.0.4-1
- Control updated to latest version 3.0.0.4
- Added jballi's API function: Scroll, Get/SetModfy, EmptyUndoBuffer, LineScroll
- Bug fixes: If line contained only 1 character GetLine was returning empty string. GetTextLength typo fixed. Other reported bugs not confirmed.
- Hes file AHK syntax updated. I used ahk section from QuickAHK project.
- Documentation updated. There is aslo a new section about syntax highlighting.
_________________
 |
|
| Back to top |
|
 |
pokercurious
Joined: 16 Dec 2007 Posts: 48
|
Posted: Mon Nov 10, 2008 10:59 pm Post subject: |
|
|
I really like the HiEdit control and find myself using it quite a bit.
One thing is that I like to have a black background and light text: the problem with this is that I can't seem to get the backticks (`) to display in any color other than black.
For example, run the _Test.ahk script in majkinetor's release (it uses a black background) - you can see backticks when they're selected in text, but not otherwise.
The delimiters section of keywords.hes is currently:
| Code: | ;>>>>> Delimiters <<<<<
0x01FFFFFF = ( ) < > { } , % " = : + - * / ^ ! # ~ `; |
I've tried adding a space in between the ` and the ;. Doesn't work.
I've also tried, pulling the ` out into its own section:
| Code: | ;>>>>> Delimiters <<<<<
0x01FFFFFF = ( ) < > { } , % " = : + - * / ^ ! # ~
0x01FFFF00 = ` |
Does anybody have any ideas here? This control is so almost perfect for me now, I'd like it to go the final mile. |
|
| Back to top |
|
 |
jballi
Joined: 01 Oct 2005 Posts: 537 Location: Texas, USA
|
Posted: Tue Nov 11, 2008 2:43 am Post subject: |
|
|
Thanks for the update.  |
|
| Back to top |
|
 |
BIG_RED_TEXT
Joined: 12 Jan 2008 Posts: 130
|
Posted: Tue Nov 11, 2008 4:02 am Post subject: |
|
|
hey! nice work... I only took a quick look in the documentation, and couldn't find a function that could retrieve the word that is currently marked (or under the typing cursor)...
This is usefull when you want to search for marked words. As in SCiTE you push F1 and it goes to AHK's help manual and takes you to the page explaining the marked word... |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 4114 Location: Belgrade
|
Posted: Tue Nov 11, 2008 11:06 am Post subject: |
|
|
2pokercurious
I noticed this long time ago, but I don't know why is it happening. I think I reported it back then as a bug to akyprian, but the problem is that behavior doesn't happen with HiEditor or HiEditDemo....
If that troubles you so much, perhaps you should try to reproduce the problem in above tools. I didn't find a problem so far, but it might also be a bug in wrapper, although its hard to imagine how 1 character can misbehave like that...
2Ice_Tea
Currently there is no such API. You can get selection only. Its easy to make a function tho. This one has hardcoded delimiters, but you can eventually read them from appropriate section in hes file:
| Code: | HE_GetCurrentWord(hEdit){
cpos := HE_GetSel(hEdit) ;get cursor position in the entire text
cline := HE_GetLine(hEdit) ;get line
clineIdx := HE_LineIndex(hEdit) ;get position of line in the entire text
pos := cpos - clineIdx ;calculate position of cursor in line
len := StrLen(cline)
;Find the start and end of the word starting from cursor position
;End of the word is ocurance of any delimiter or start/end of the line
loop, 2
{
j := A_Index - 1, i := j ? len : 1 ;j=0 (search 4 start of the word) j=1 (search 4 end of the word)
loop
{
p := j ? pos + A_Index : pos - A_Index
if (j && (p > len)) || (!j && p<=0)
break
c := SubStr(cline, p , 1)
if c in %A_Space%,%A_Tab%,(,),+
{
i := p + (j ? -1 : 1)
break
}
}
if !j
iSta := i ;start of the word
else iEnd := i ;end of the word
}
return SubStr(cline, iSta, iEnd - iSta + 1)
}
|
_________________
 |
|
| Back to top |
|
 |
BIG_RED_TEXT
Joined: 12 Jan 2008 Posts: 130
|
Posted: Tue Nov 11, 2008 1:42 pm Post subject: |
|
|
| majkinetor wrote: | 2Ice_Tea
Currently there is no such API. You can get selection only. Its easy to make a function tho. This one has hardcoded delimiters, but you can eventually read them from appropriate section in hes file:
| Code: | HE_GetCurrentWord(hEdit){
cpos := HE_GetSel(hEdit) ;get cursor position in the entire text
cline := HE_GetLine(hEdit) ;get line
clineIdx := HE_LineIndex(hEdit) ;get position of line in the entire text
pos := cpos - clineIdx ;calculate position of cursor in line
len := StrLen(cline)
;Find the start and end of the word starting from cursor position
;End of the word is ocurance of any delimiter or start/end of the line
loop, 2
{
j := A_Index - 1, i := j ? len : 1 ;j=0 (search 4 start of the word) j=1 (search 4 end of the word)
loop
{
p := j ? pos + A_Index : pos - A_Index
if (j && (p > len)) || (!j && p<=0)
break
c := SubStr(cline, p , 1)
if c in %A_Space%,%A_Tab%,(,),+
{
i := p + (j ? -1 : 1)
break
}
}
if !j
iSta := i ;start of the word
else iEnd := i ;end of the word
}
return SubStr(cline, iSta, iEnd - iSta + 1)
}
|
|
Thank you, good sir. I think I'll use this to replace ACC (by Titan)... |
|
| Back to top |
|
 |
pokercurious
Joined: 16 Dec 2007 Posts: 48
|
Posted: Tue Nov 11, 2008 6:36 pm Post subject: |
|
|
| majkinetor wrote: | 2pokercurious
I noticed this long time ago, but I don't know why is it happening. I think I reported it back then as a bug to akyprian, but the problem is that behavior doesn't happen with HiEditor or HiEditDemo....
If that troubles you so much, perhaps you should try to reproduce the problem in above tools. I didn't find a problem so far, but it might also be a bug in wrapper, although its hard to imagine how 1 character can misbehave like that... |
I just tried both HiEditor and HiEditDemo, and you're right - both seem to work just fine. This makes it all the weirder.
I'll mess around with it some more - if I stumble across anything interesting, I'll let you know. But generally you're right - it's not that big of a deal for most people. I just got really excited because this got so close to being exactly what I needed. |
|
| Back to top |
|
 |
automaticman
Joined: 27 Oct 2006 Posts: 483
|
Posted: Thu Nov 13, 2008 10:50 pm Post subject: |
|
|
Can HiEdit also do syntax highlighting while writing in real-time using regex definitions what to highlight?
For example one could define in a file a list of regexes and after the regex the formatting settings which should be applied then to any real-time pc-keyboard input. Each line could contain such a regex definition with its syntax highlighting parameters.
Example for one such line could be:
| Code: | \+\s\s(\w|\s|\d|-|\!|,|\.)* --> Courier,14,Bold,TextColor,BackgroundColor
|
Important is that we should be able to define quite a lot (e.g. 30) of our own regex definitions together with the highlighting settings. If HiEdit can not do this, do you know any other editor which can do this? |
|
| 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
|