55 lines
1.3 KiB
NASM
55 lines
1.3 KiB
NASM
; draw_edit — поле ввода текста (рамка, фон, курсор)
|
|
draw_edit:
|
|
push eax ebx ecx edx esi edi
|
|
|
|
mov eax, 13
|
|
mov ebx, (EX shl 16) or EW
|
|
mov ecx, (EY shl 16) or (EH+2)
|
|
mov edx, CE_BG
|
|
int 0x40
|
|
|
|
mov eax, 38
|
|
mov edx, CE_BOR
|
|
mov ebx, (EX shl 16) or (EX+EW)
|
|
mov ecx, (EY shl 16) or EY
|
|
int 0x40
|
|
mov ecx, ((EY+EH+2) shl 16) or (EY+EH+2)
|
|
int 0x40
|
|
mov ebx, (EX shl 16) or EX
|
|
mov ecx, (EY shl 16) or (EY+EH+2)
|
|
int 0x40
|
|
mov ebx, ((EX+EW) shl 16) or (EX+EW)
|
|
int 0x40
|
|
|
|
cmp dword [inLen], 0
|
|
je .ph
|
|
|
|
mov eax, 4
|
|
mov ebx, ((EX+4) shl 16) or (EY+5)
|
|
mov ecx, CT_BLACK
|
|
mov edx, inBuf
|
|
call txt_draw
|
|
|
|
mov eax, [inLen]
|
|
imul eax, 6
|
|
add eax, EX + 4
|
|
mov ebx, eax
|
|
shl ebx, 16
|
|
or ebx, eax
|
|
mov eax, 38
|
|
mov ecx, ((EY+3) shl 16) or (EY+EH-1)
|
|
mov edx, CT_CURSOR
|
|
int 0x40
|
|
jmp .done
|
|
|
|
.ph:
|
|
mov eax, 4
|
|
mov ebx, ((EX+4) shl 16) or (EY+5)
|
|
mov ecx, CT_GRAY
|
|
mov edx, szPlaceholder
|
|
call txt_draw
|
|
|
|
.done:
|
|
pop edi esi edx ecx ebx eax
|
|
ret
|