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.
Posted on 2008-03-31 14:30:28 by GodFather
Subclass the ListView control, and owner-draw the content.
Posted on 2008-04-01 09:01:50 by Homer

Subclass the ListView control, and owner-draw the content.

Where I can download the source - code?
Posted on 2008-04-03 13:54:39 by GodFather
Here is an example.

KetilO
Attachments:
Posted on 2008-04-07 06:24:57 by 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?
Posted on 2008-04-08 09:31:10 by GodFather
What you do to avoid flicker is to create a memory dc, draw to it and den bitblt to the screen dc.


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
Posted on 2008-04-09 01:44:47 by KetilO
The blinking has disappeared
  :)
Posted on 2008-04-09 11:43:07 by GodFather