Hi japheth

Yes I found out and included that in the uploaded HexEd.

KetilO
Posted on 2003-07-23 05:27:42 by KetilO
Hi KetilO,

some other suggestions:

1. theres a small bug in streamout proc, GlobalLock is called twice, I think the latter should be GlobalUnlock

2. the control shows its selection area always in the same color, regardless if it has focus or not.
I would suggest to draw background with stock grey color if control hasnt focus.
Have changed code accordingly, but possibly it may be done in a better way:



.elseif eax==WM_SETFOCUS

mov [ebx].EDIT.fHasFocus, TRUE
invoke InvalidateRect,[ebx].EDIT.edta.hwnd,NULL,FALSE
invoke InvalidateRect,[ebx].EDIT.edtb.hwnd,NULL,FALSE

mov eax,hWin
mov [ebx].EDIT.focus,eax
invoke SetFocus,hWin

push word ptr EN_SETFOCUS
push word ptr [ebx].EDIT.ID
pop ecx
invoke SendMessage, [ebx].EDIT.hpar, WM_COMMAND, ecx, [ebx].EDIT.hwnd

call SetScroll
invoke SetCaret,hWin
invoke SelChange,ebx,SEL_TEXT

.elseif eax==WM_KILLFOCUS

mov [ebx].EDIT.fHasFocus, FALSE
invoke InvalidateRect,[ebx].EDIT.edta.hwnd,NULL,FALSE
invoke InvalidateRect,[ebx].EDIT.edtb.hwnd,NULL,FALSE

.if ![ebx].EDIT.fCaretHide
mov [ebx].EDIT.fCaretHide,TRUE
invoke HideCaret, hWin
.endif

push word ptr EN_KILLFOCUS
push word ptr [ebx].EDIT.ID
pop ecx
invoke SendMessage, [ebx].EDIT.hpar, WM_COMMAND, ecx, [ebx].EDIT.hwnd

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

And in paint routine:

.if ([ebx].EDIT.fHasFocus)
mov eax, [ebx].EDIT.br.hBrSelBck
.else
invoke GetStockObject, GRAY_BRUSH
.endif
invoke FillRect, ps.hdc, addr rect, eax




I added these EN_SETFOCUS/EN_KILLFOCUS notifications as well, since parent possibly has no clue about
the two child hwnds.

Japheth
Posted on 2003-07-24 13:35:14 by japheth
Hi japheth

Thanks,
New upload at the top.

KetilO
Posted on 2003-07-24 16:26:33 by KetilO
Hi Ketil!

What about adding a feature which let you edit the contents in the ascii-column too??

Regards,
Tommy
Posted on 2003-07-27 09:29:30 by Tommy