Some GUI updates for IRCC.

git-svn-id: svn://kolibrios.org@3216 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
hidnplayr 2013-02-02 21:47:33 +00:00
parent 31434d0fa5
commit bd75afb87d
3 changed files with 45 additions and 38 deletions

View File

@ -36,7 +36,7 @@ draw_window:
mov ebx, [xsize]
mov ecx, [ysize]
sub cx, 35
sub cx, 15 ;;;;
push cx
shl ecx, 16
pop cx
@ -56,13 +56,34 @@ draw_window:
shl ebx, 16
pop bx
mov ecx, [ysize]
add ecx, TOP_Y SHL 16 -(15+20)
add ecx, TOP_Y SHL 16 -(15) ;;;;
mcall
call print_channel_list
.not_channel:
; scrollbar
mov eax, [ysize]
sub eax, TOP_Y + 15 ;;;;
push eax
mov [scroll1.y_size], ax
mov eax, [xsize]
sub eax, SCROLLBAR_WIDTH
mov [scroll1.x_pos], ax
pop eax ; scrollbar height
xor edx, edx
mov ecx, 10
div ecx
mov [scroll1.cur_area], eax
mov [scroll1.all_redraw], 1
push dword scroll1
call [scrollbar_v_draw]
.not_channel:
mov edx, [edi + window.data_ptr]
add edx, window_data.text
call draw_channel_text
@ -70,7 +91,7 @@ draw_window:
; editbox
mov eax, [ysize]
sub eax, 30 ;;;;;;
sub eax, 12 ;;;;;;
mov [edit1.top], eax
mov eax, [xsize]
@ -79,20 +100,7 @@ draw_window:
push dword edit1
call [edit_box_draw]
; scrollbar
mov eax, [ysize]
sub eax, TOP_Y + 35 ;;;;
mov [scroll1.y_size], ax
mov eax, [xsize]
sub eax, SCROLLBAR_WIDTH
mov [scroll1.x_pos], ax
mov [scroll1.all_redraw], 1
push dword scroll1
call [scrollbar_v_draw]
; tabs
call draw_windownames
@ -114,7 +122,7 @@ print_channel_list:
push ebx
mov bx, USERLIST_X
mov ecx, [ysize]
add ecx, TEXT_Y shl 16 - (TEXT_Y + 35 + 10 ) ;;;;;
add ecx, TEXT_Y shl 16 - (TEXT_Y + 15) ;;;;; + 10???
mov edx, [colors.work]
mcall
@ -134,7 +142,7 @@ print_channel_list:
mov eax, 4 ; draw text
mov edi, [ysize] ; Calculate how many names will fit on screen
sub edi, TEXT_Y + 35 + 10 ;;;;;
sub edi, TEXT_Y + 15 ;+ 10 ;;;;;
.loop:
; TODO: check if name is selected and highlight background color if so
cmp byte[edx], ' ' ; end of list?

View File

@ -41,7 +41,7 @@ UTF8 = 2
USERCMD_MAX_SIZE = 400
WIN_MIN_X = 600
WIN_MIN_Y = 200
WIN_MIN_Y = 180
TEXT_X = 5
TEXT_Y = 45

View File

@ -807,18 +807,26 @@ cmd_353: ; channel usernames reply
mov [ebx + window.users], 0 ;;; FIXME: Only if we have just set the receiving names bit
mov eax, [ebx + window.data_ptr]
lea edi, [eax + window_data.names]
lea edx, [edi + MAX_NICK_LEN]
mov edx, edi
; now find the semicolon separating channelname and usernames
.loop2:
lodsb
cmp al, ':'
je .namesloop
je .newname
test al, al
jnz .loop2
ret
.next:
add edx, MAX_NICK_LEN
mov edi, edx
;;; cmp edi, .. ; TODO: Check for buffer overflow
jmp .namesloop ;;;;
.newname:
inc [ebx + window.users]
.namesloop:
; now the names list begins, separated with spaces
lodsb
@ -829,14 +837,6 @@ cmd_353: ; channel usernames reply
stosb
jmp .namesloop
.next:
inc [ebx + window.users]
mov edi, edx
add edx, MAX_NICK_LEN
;;; cmp edi, .. ; TODO: Check for buffer overflow
jmp .namesloop
.done:
call users_calculate
call print_channel_list
@ -846,17 +846,16 @@ cmd_353: ; channel usernames reply
users_calculate:
mov eax, [ysize]
sub eax, TEXT_Y + 35 + 10 ;;;;
xor edx, edx
mov ecx, 10
div ecx
mov [scroll1.max_area], eax
mov ebx, [window_print]
mov eax, [ebx + window.users]
mov [scroll1.max_area], eax
; TODO: check if cur pos isnt greater then max
; OK, now redraw the scrollbar
mov [scroll1.all_redraw], 1
push dword scroll1
call [scrollbar_v_draw]
ret