AutoHotkey Community

It is currently May 26th, 2012, 11:25 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 240 posts ]  Go to page Previous  1 ... 5, 6, 7, 8, 9, 10, 11 ... 16  Next

Do you want HiEdit internaly
Yes
No, I like Edit control
Other (please explain)
You may select 1 option

View results
Author Message
 Post subject:
PostPosted: October 22nd, 2008, 9:49 pm 
Offline

Joined: July 29th, 2005, 5:32 pm
Posts: 179
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 :wink:

_________________
.o0[ corey ]0o.


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

Joined: September 8th, 2008, 12:26 am
Posts: 1048
Location: Ploieşti, RO
Hmmm... usually I don't like playing with someone else's toys, coz I tend to break them. 8)
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. :wink:

_________________
AHK tools by Drugwash (AHK 1.0.48.05 and Win98SE)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 31st, 2008, 7:29 pm 
Offline

Joined: October 1st, 2005, 9:55 pm
Posts: 774
Location: Texas, USA
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 31st, 2008, 8:58 pm 
It looks like interprocess limitation. You should re-implement function using RemoteBuffer module and I expect it to work.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 31st, 2008, 9:02 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
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.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 1st, 2008, 1:21 pm 
Offline

Joined: October 1st, 2005, 9:55 pm
Posts: 774
Location: Texas, USA
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 3rd, 2008, 3:29 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
You are welcome.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 10th, 2008, 1:25 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
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.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 10th, 2008, 11:59 pm 
Offline

Joined: December 16th, 2007, 12:55 pm
Posts: 48
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 11th, 2008, 3:43 am 
Offline

Joined: October 1st, 2005, 9:55 pm
Posts: 774
Location: Texas, USA
Thanks for the update. 8)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 11th, 2008, 5:02 am 
Offline

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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 11th, 2008, 12:06 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
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)
}

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 11th, 2008, 2:42 pm 
Offline

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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 11th, 2008, 7:36 pm 
Offline

Joined: December 16th, 2007, 12:55 pm
Posts: 48
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 13th, 2008, 11:50 pm 
Offline

Joined: October 27th, 2006, 10:12 am
Posts: 649
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?


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 240 posts ]  Go to page Previous  1 ... 5, 6, 7, 8, 9, 10, 11 ... 16  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot] and 10 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