/kernel/branches/net/applications/ircc/gui.inc |
---|
140,8 → 140,7 |
pusha |
; Now, draw the usernames themselves |
mov eax, 13 ; draw rectangle (clear list) |
; first, draw an invisible button |
mov ebx, [xsize] |
sub ebx, USERLIST_X + SCROLLBAR_WIDTH |
shl ebx, 16 |
149,9 → 148,16 |
mov bx, USERLIST_X |
mov ecx, [ysize] |
add ecx, TEXT_Y shl 16 - (TEXT_Y + 15) ;;;;; + 10??? |
push ecx ebx |
mov edx, 50 + 1 shl 29 + 1 shl 30 |
mcall 8 |
; now draw rectangle to clear the names |
pop ebx ecx |
mov edx, [colors.work] |
mcall |
mcall 13 |
; now draw the names according with scrollbar position and window size |
mov eax, [scroll1.position] |
xor edx, edx |
mov ecx, MAX_NICK_LEN |
158,9 → 164,8 |
mul ecx |
mov edx, eax |
mov eax, [window_open] |
mov eax, [eax + window.data_ptr] |
add edx, eax |
mov ebp, [eax + window_data.selected] |
mov ebp, [eax + window.selected] |
add edx, [eax + window.data_ptr] |
sub ebp, [scroll1.position] |
add edx, window_data.names |
173,8 → 178,11 |
mov edi, [ysize] ; Calculate how many names will fit on screen |
sub edi, TEXT_Y + 15 ;+ 10 ;;;;; |
.loop: |
cmp byte[edx], 0 ; end of list? |
je .done |
dec ebp ; is this name selected? |
jnz @f |
jnz .nothighlight |
; yes, highlight it |
pusha |
mov cx, bx |
184,17 → 192,24 |
mov edx, 0x00000055 ; blue! |
mcall 13 |
popa |
@@: |
cmp byte[edx], 0 ; end of list? |
je .done |
mov ecx, 0x8000ffff ; cyan! |
mcall |
mov ecx, [colors.work_text] |
or ecx, 0x80000000 ; ASCIIZ string |
jmp .next |
.nothighlight: |
mcall |
.next: |
add edx, MAX_NICK_LEN ; next name |
add ebx, 10 ; height distance between lines |
sub edi, 10 |
ja .loop |
.done: |
popa |
ret |
/kernel/branches/net/applications/ircc/ircc.asm |
---|
101,6 → 101,7 |
name rb MAX_WINDOWNAME_LEN |
users dd ? |
users_scroll dd ? |
selected dd ? ; selected user, 0 if none selected |
ends |
struct window_data |
107,7 → 108,6 |
text rb 120*60 |
title rb 256 |
names rb MAX_NICK_LEN * MAX_USERS |
selected dd ? ; selected user, 0 if none selected |
usertext rb 256 |
usertextlen dd ? |
ends |
231,6 → 231,24 |
cmp ax, 1 ; close program |
je exit |
cmp ax, 50 |
jne @f |
mcall 37, 1 ; Get mouse position |
sub ax, TEXT_Y |
mov bl, 10 |
div bl |
and eax, 0x000000ff |
inc eax |
add eax, [scroll1.position] |
mov ebx, [window_open] |
mov [ebx + window.selected], eax |
call print_channel_list |
jmp still |
@@: |
sub ax, WINDOW_BTN_START |
jb exit |
/kernel/branches/net/applications/ircc/serverparser.inc |
---|
137,59 → 137,98 |
align 4 |
find_window: ; esi is ptr to windowname |
; TODO: if the window in question does not exist, create it ??? |
push esi |
mov edi, esi |
call compare_to_nick |
jne .nochat |
mov esi, servercommand+1 |
.nochat: |
; now search for window in list |
mov ebx, windows |
mov [window_print], ebx ; set first window (server window) as default output window |
.scanloop: |
cmp [ebx + window.data_ptr], 0 |
je .just_skip |
je .create_it |
push esi |
lea edi, [ebx + window.name] |
mov ecx, MAX_WINDOWNAME_LEN |
repe cmpsb |
pop esi |
cmp byte[edi-1], 0 |
je .got_it |
pop esi |
add ebx, sizeof.window |
; TODO: check buffer limits ? |
jmp .scanloop |
; window not found, just skip this name |
; create channel window - search for empty slot |
.create_it: |
mov ebx, windows |
mov ecx, MAX_WINDOWS |
.scanloop2: |
cmp [ebx + window.data_ptr], 0 |
je .free_found |
add ebx, sizeof.window |
dec ecx |
jnz .scanloop2 |
; Error: no more available windows! |
jmp .just_skip |
.free_found: |
push ebx |
call window_create |
pop ebx |
test eax, eax |
jz .just_skip |
mov [ebx + window.data_ptr], eax |
mov [ebx + window.type], WINDOWTYPE_CHAT |
mov [ebx + window.flags], 0 |
call window_set_name |
mov [window_open], ebx |
mov [window_print], ebx |
call window_refresh |
call draw_windownames |
jmp .just_skip |
; found it! |
.got_it: |
mov [window_print], ebx |
call window_refresh |
.just_skip: |
pop esi |
.skip1: |
; skip text |
lodsb |
test al, al |
jz .quit |
cmp al, ' ' |
jne .just_skip |
jne .skip1 |
dec esi |
jmp .done |
; found it! |
.got_it: |
add esp, 4 |
mov [window_print], ebx |
dec esi |
; now skip trailing spaces and semicolons |
.done: |
.skip2: |
lodsb |
test al, al |
jz .quit |
cmp al, ' ' |
je .done |
je .skip2 |
cmp al, ':' |
je .done |
je .skip2 |
dec esi |
.quit: |
call window_refresh |
ret |
cmd_328: |
cmd_421: |
cmd_372: |
/kernel/branches/net/applications/ircc/window.inc |
---|
46,7 → 46,7 |
mov ecx, MAX_WINDOWNAME_LEN |
.loop: |
lodsb |
cmp al, 0x20 |
cmp al, 0x21 |
jbe .addzero |
stosb |
dec ecx |