Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 3219 → Rev 3220

/kernel/branches/net/applications/ircc/gui.inc
33,6 → 33,7
add edx, 0x33000000
mov edi, str_programname
mcall
mcall 12, 2 ;; when do we actually need this??
 
mov ebx, [xsize]
mov ecx, [ysize]
50,6 → 51,7
cmp [edi + window.type], WINDOWTYPE_CHANNEL
jne .not_channel
 
; draw a vertical separator line
mov ebx, [xsize]
sub ebx, USERLIST_X + SCROLLBAR_WIDTH + 3
push bx
59,30 → 61,8
add ecx, TOP_Y SHL 16 -(15) ;;;;
mcall
 
call print_channel_list
call redraw_channel_list
 
; 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
104,15 → 84,59
 
call draw_windownames
 
mcall 12, 2
popa
ret
 
 
 
redraw_channel_list:
 
; First, calculate scrollbar
 
mov ebx, [window_open]
mov eax, [ebx + window.users] ; number of users in the open window
mov [scroll1.max_area], eax
 
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
 
; Do we need a scrollbar?
cmp eax, [scroll1.max_area]
jae .noscroll
 
; Is the current position greater then the max position?
cmp eax, [scroll1.position]
ja @f
mov [scroll1.position], eax
@@:
 
; OK, draw the scrollbar
mov [scroll1.all_redraw], 1
 
push dword scroll1
call [scrollbar_v_draw]
 
jmp print_channel_list
 
.noscroll:
mov [scroll1.position], 0
 
print_channel_list:
 
pusha
; Now, draw the usernames themselves
 
mov eax, 13 ; draw rectangle (clear list)
 
/kernel/branches/net/applications/ircc/ircc.asm
284,11 → 284,12
push dword edit1
call [edit_box_mouse]
 
; TODO: check if scrollbar is active
push dword scroll1
call [scrollbar_v_mouse]
 
; TODO: check if scrollbar moved
call print_channel_list ;;;
call print_channel_list
 
jmp still
 
415,7 → 416,7
; width, left, top
edit1 edit_box 0, 0, 0, 0xffffff, 0x6f9480, 0, 0, 0, USERCMD_MAX_SIZE, usercommand, mouse_dd, ed_focus, 25, 25
; xsize, xpos, ysize, ypos, max, cur, pos, bgcol, frcol, linecol
scroll1 scrollbar SCROLLBAR_WIDTH, 300, 150, TOP_Y, 10, 100, 0, 0, 0, 0, 0, 5
scroll1 scrollbar SCROLLBAR_WIDTH, 300, 150, TOP_Y, 10, 100, 0, 0, 0, 0, 0, 1
 
 
main_PID dd ? ; identifier of main thread
/kernel/branches/net/applications/ircc/serverparser.inc
823,7 → 823,6
add edx, MAX_NICK_LEN
mov edi, edx
;;; cmp edi, .. ; TODO: Check for buffer overflow
jmp .namesloop ;;;;
 
.newname:
inc [ebx + window.users]
838,24 → 837,9
jmp .namesloop
 
.done:
call users_calculate
call print_channel_list
 
ret
call redraw_channel_list
 
 
users_calculate:
 
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