Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 3220 → Rev 3216

/kernel/branches/net/applications/ircc/gui.inc
33,7 → 33,6
add edx, 0x33000000
mov edi, str_programname
mcall
mcall 12, 2 ;; when do we actually need this??
 
mov ebx, [xsize]
mov ecx, [ysize]
51,7 → 50,6
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
61,8 → 59,30
add ecx, TOP_Y SHL 16 -(15) ;;;;
mcall
 
call redraw_channel_list
call print_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
84,59 → 104,15
 
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,12 → 284,11
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
 
416,7 → 415,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, 1
scroll1 scrollbar SCROLLBAR_WIDTH, 300, 150, TOP_Y, 10, 100, 0, 0, 0, 0, 0, 5
 
 
main_PID dd ? ; identifier of main thread
/kernel/branches/net/applications/ircc/serverparser.inc
823,6 → 823,7
add edx, MAX_NICK_LEN
mov edi, edx
;;; cmp edi, .. ; TODO: Check for buffer overflow
jmp .namesloop ;;;;
 
.newname:
inc [ebx + window.users]
837,9 → 838,24
jmp .namesloop
 
.done:
call users_calculate
call print_channel_list
 
call redraw_channel_list
ret
 
 
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