That looks nice, MSon.
I use these functions to replace setSelStart and setSelLen (back from when I was working on IonRay IDE)
function getSelStartA(editHandle as integer)
returnval as dword
returnval = getSelStart(editHandle)+getRichEditLineNum(editHandle)-1
endfunction returnval
function getSelLenA(editHandle as integer)
returnval as dword
returnval = getSelLen(editHandle)+getRichEditEndSelLineNum(editHandle)-getRichEditLineNum(editHandle)
endfunction returnval
function setSelStartA(editHandle as integer,selectStart as dword)
setSelStart editHandle,selectStart-getRichEditLineFromPos(editHandle,selectStart)+1
endfunction
function setSelLenA(editHandle as integer,selectLen as dword)
setSelLen editHandle,selectLen-getRichEditLineFromPos(editHandle,getSelStart(editHandle)+selectLen)+getRichEditLineNum(editHandle)
endfunction
function getRichEditLineNum(richEditHandle as integer)
linenum as dword
linenum = call dll(user32num,"SendMessageA",windowHandle(richEditHandle),0x436,0,getSelStart(richEditHandle))
linenum = linenum+1
endfunction linenum
function getRichEditEndSelLineNum(richEditHandle as integer)
linenum as dword
linenum = call dll(user32num,"SendMessageA",windowHandle(richEditHandle),0x436,0,getSelStart(richEditHandle)+getSelLen(richEditHandle))
linenum = linenum+1
endfunction linenum
function getRichEditLineFromPos(richEditHandle as integer,pos as dword)
linenum as dword
linenum = call dll(user32num,"SendMessageA",windowHandle(richEditHandle),0x436,0,pos)
linenum = linenum+1
endfunction linenum
function setRichEditBuffer(richEditHandle as integer,buffer as dword)
lresult as dword
lresult = call dll(user32num,"SendMessageA",windowHandle(richEditHandle),0x435,0,buffer)
endfunction
function setRichEditUndos(richEditHandle as integer,undos as dword)
lresult as dword
lresult = call dll(user32num,"SendMessageA",windowHandle(richEditHandle),0x452,undos,0)
endfunction
function getTextModified(richEditHandle as integer)
lresult as dword
lresult = call dll(user32num,"SendMessageA",windowHandle(richEditHandle),0xB8,0,0)
endfunction lresult
function setTextModified(richEditHandle as integer,modified as boolean)
lresult as dword
lresult = call dll(user32num,"SendMessageA",windowHandle(richEditHandle),0xB9,modified,0)
endfunction
function setRichEditMode(richEditHandle as integer,multipleUndos as boolean,allowUnicodeSet as boolean)
rem There must be no text in the edit box for this to work!!!
lresult as dword
lresult = call dll(user32num,"SendMessageA",windowHandle(richEditHandle),0xB9,20+4*multipleUndos+16*allowUnicodeSet,0)
endfunction
function getEditTopLineNum(editHandle as integer)
linenum as dword
linenum = call dll(user32num,"SendMessageA",windowHandle(editHandle),0xCE,0,0)
linenum = linenum+1
endfunction linenum
function getEditNumLines(editHandle as integer)
numlines as dword
numlines = call dll(user32num,"SendMessageA",windowHandle(editHandle),0xBA,0,0)
endfunction numlines
There are some other RichEdit functions in there. If you want to use them, or anything else from IonRay (The source is at http://forum.thegamecreators.com/?m=forum_view&b=8&t=57888&p=0 [although I had made some changes since that last official release]) feel free to take it.
Also, is there a WIP for your editor yet, or if not will there be one?
-Xol