In most popular editor for assembler in the margine display line numbering.
How create it.?
I create line numbering as I think? but my code is very slow.
How create it.?
I create line numbering as I think? but my code is very slow.
Subclass the ListView control, and owner-draw the content.
Subclass the ListView control, and owner-draw the content.
Where I can download the source - code?
Here is an example.
KetilO
KetilO
Here is an example.
KetilO
Thank you KetilO
But in the margine the numbers is "blink" when i enter some text in richedit
I know that did not blink it is necessary to use API SelectClipRgn.
How use it with richedit?
What you do to avoid flicker is to create a memory dc, draw to it and den bitblt to the screen dc.
KetilO
DrawLineNumbers proc lpRect:DWORD
LOCAL lineno:DWORD
LOCAL buffer[32]:BYTE
LOCAL hDC:HDC
LOCAL mDC:HDC
LOCAL rect:RECT
LOCAL hRgn:DWORD
invoke GetClientRect,hREd,addr rect
mov rect.right,28
invoke GetDC,hREd
mov hDC,eax
invoke CreateCompatibleDC,hDC
mov mDC,eax
mov ecx,rect.right
sub ecx,rect.left
mov edx,rect.bottom
sub edx,rect.top
invoke CreateCompatibleBitmap,hDC,ecx,edx
invoke SelectObject,mDC,eax
push eax
invoke SelectObject,mDC,hLnFont
push eax
invoke SendMessage,hREd,EM_GETFIRSTVISIBLELINE,0,0
inc eax
mov lineno,eax
invoke GetStockObject,GRAY_BRUSH
invoke FillRect,mDC,addr rect,eax
.while TRUE
invoke wsprintfA,addr buffer,offset fmtStr,lineno
invoke SetBkMode,mDC,TRANSPARENT
invoke SetTextColor,mDC,0FFFFh
invoke DrawText,mDC,addr buffer,-1,addr rect,DT_RIGHT
mov eax,fnthgt
add rect.top,eax
mov eax,rect.top
.if eax>rect.bottom
.break
.endif
inc lineno
.endw
invoke MoveToEx,mDC,28,0,NULL
invoke LineTo,mDC,28,rect.bottom
invoke BitBlt,hDC,0,0,rect.right,rect.bottom,mDC,0,0,SRCCOPY
; Restore old font
pop eax
invoke SelectObject,mDC,eax
; Restore old bitmap
pop eax
invoke SelectObject,mDC,eax
invoke DeleteObject,eax
invoke DeleteDC,mDC
invoke ReleaseDC,hREd,hDC
ret
DrawLineNumbers endp
KetilO
The blinking has disappeared
:)
:)