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

View File

@ -41,7 +41,7 @@ UTF8 = 2
USERCMD_MAX_SIZE = 400 USERCMD_MAX_SIZE = 400
WIN_MIN_X = 600 WIN_MIN_X = 600
WIN_MIN_Y = 200 WIN_MIN_Y = 180
TEXT_X = 5 TEXT_X = 5
TEXT_Y = 45 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 [ebx + window.users], 0 ;;; FIXME: Only if we have just set the receiving names bit
mov eax, [ebx + window.data_ptr] mov eax, [ebx + window.data_ptr]
lea edi, [eax + window_data.names] lea edi, [eax + window_data.names]
lea edx, [edi + MAX_NICK_LEN] mov edx, edi
; now find the semicolon separating channelname and usernames ; now find the semicolon separating channelname and usernames
.loop2: .loop2:
lodsb lodsb
cmp al, ':' cmp al, ':'
je .namesloop je .newname
test al, al test al, al
jnz .loop2 jnz .loop2
ret 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: .namesloop:
; now the names list begins, separated with spaces ; now the names list begins, separated with spaces
lodsb lodsb
@ -829,14 +837,6 @@ cmd_353: ; channel usernames reply
stosb stosb
jmp .namesloop 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: .done:
call users_calculate call users_calculate
call print_channel_list call print_channel_list
@ -846,17 +846,16 @@ cmd_353: ; channel usernames reply
users_calculate: 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 ebx, [window_print]
mov eax, [ebx + window.users] mov eax, [ebx + window.users]
mov [scroll1.max_area], eax mov [scroll1.max_area], eax
; TODO: check if cur pos isnt greater then max ; 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 ret