IRCc 0.24: Make better use of available space on screen.

git-svn-id: svn://kolibrios.org@6023 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
hidnplayr 2016-01-01 21:01:59 +00:00
parent 45a7eeea24
commit e48064d090
7 changed files with 765 additions and 773 deletions

View File

@ -1,6 +0,0 @@
@erase lang.inc
@echo lang fix en >lang.inc
@fasm -m 16384 ircc.asm ircc
@kpack ircc
@erase lang.inc
@pause

View File

@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2014. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2016. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;; Written by hidnplayr@kolibrios.org ;; ;; Written by hidnplayr@kolibrios.org ;;
@ -11,7 +11,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
draw_window: ; Completely redraw the window, recalculate all coordinates and sizes draw_window: ; Completely redraw the window, recalculate all coordinates and sizes
pusha pusha
@ -55,23 +54,12 @@ draw_window: ; Completely redraw the window, recalculate all coordinates and
mcall mcall
mcall 12, 2 mcall 12, 2
test [thread_info.wnd_state], 100b ; skip if window rolled up test [thread_info.wnd_state], 100b ; skip if window is rolled up
jne .exit jne .exit
mov ebx, [xsize]
mov ecx, [ysize]
sub cx, BOTTOM_Y ;;;;
push cx
shl ecx, 16
pop cx
mov edx, [colors.work_graph]
mcall 38 ; draw bottom line
mov ecx, TOP_Y SHL 16 + TOP_Y
mcall ; draw top line
; calculate available space for textbox and coordinates for scrollbars ; calculate available space for textbox and coordinates for scrollbars
mov eax, [ysize] mov eax, [ysize]
sub eax, TOP_Y + BOTTOM_Y - 1 ;;;; sub eax, TOP_Y + INPUTBOX_HEIGHT - 1 ;;;;
mov [scroll2.y_size], ax mov [scroll2.y_size], ax
mov [scroll1.y_size], ax mov [scroll1.y_size], ax
sub eax, 4 ;;;; sub eax, 4 ;;;;
@ -137,14 +125,14 @@ draw_window: ; Completely redraw the window, recalculate all coordinates and
shl ebx, 16 shl ebx, 16
pop bx pop bx
mov ecx, [ysize] mov ecx, [ysize]
add ecx, TOP_Y shl 16 - (BOTTOM_Y) add ecx, TOP_Y shl 16 - (INPUTBOX_HEIGHT)
mov edx, [colors.work_graph] mov edx, [colors.work_graph]
mcall 38 mcall 38
.not_channel: .not_channel:
; draw editbox ; draw editbox
mov eax, [ysize] mov eax, [ysize]
sub eax, 13 ;;;;;; sub eax, INPUTBOX_HEIGHT
mov [edit1.top], eax mov [edit1.top], eax
mov eax, [xsize] mov eax, [xsize]
@ -267,11 +255,18 @@ draw_channel_list:
draw_windowtabs: draw_windowtabs:
; Draw horizontal line
mov ebx, [xsize]
mov edx, [colors.work_graph]
mov ecx, TOP_Y SHL 16 + TOP_Y
mcall 38
; Create the buttons ; Create the buttons
mov eax, 8 mov eax, 8
mov ebx, 5 shl 16 + 120 mov ebx, TAB_WIDTH
mov ecx, 12 shl 16 + 12 mov ecx, TOP_SPACE shl 16 + TAB_HEIGHT
mov edx, WINDOW_BTN_START mov edx, WINDOW_BTN_START
mov edi, windows mov edi, windows
.more_btn: .more_btn:
@ -283,23 +278,22 @@ draw_windowtabs:
@@: @@:
mcall mcall
inc edx inc edx
add ebx, 125 shl 16 add ebx, (TAB_WIDTH + TAB_SPACE) shl 16
add edi, sizeof.window add edi, sizeof.window
cmp [edi + window.data_ptr], 0 cmp [edi + window.data_ptr], 0
jne .more_btn jne .more_btn
; Draw the close window button ; Draw the close window button
mov edi, [window_active] mov edi, [window_active]
cmp [edi + window.type], WINDOWTYPE_SERVER ; dont let the user close server window cmp [edi + window.type], WINDOWTYPE_SERVER ; dont let the user close server window
je @f je @f
; mov eax, 8 ; mov eax, 8
mov ebx, [xsize] mov ebx, [xsize]
sub ebx, 12 sub ebx, SCROLLBAR_WIDTH
shl ebx, 16 shl ebx, 16
mov bx, 12 mov bx, SCROLLBAR_WIDTH
mov ecx, 6 shl 16 + 12 mov ecx, TOP_SPACE shl 16 + TAB_HEIGHT - 1
mov edx, WINDOW_BTN_CLOSE mov edx, WINDOW_BTN_CLOSE
mov esi, 0x00aa0000 ; red ! mov esi, 0x00aa0000 ; red !
mcall mcall
@ -308,7 +302,7 @@ draw_windowtabs:
; Draw the windownames onto the buttons ; Draw the windownames onto the buttons
mov eax, 4 mov eax, 4
mov ebx, 10 shl 16 + 15 mov ebx, 5 shl 16 + TOP_SPACE + 4 ;;;;
mov esi, MAX_WINDOWS mov esi, MAX_WINDOWS
mov edi, windows mov edi, windows
.more: .more:
@ -323,7 +317,7 @@ draw_windowtabs:
add edi, sizeof.window ; get ptr to next window add edi, sizeof.window ; get ptr to next window
cmp [edi + window.data_ptr], 0 cmp [edi + window.data_ptr], 0
je .enough je .enough
add ebx, 125 shl 16 add ebx, (TAB_WIDTH + TAB_SPACE) shl 16
dec esi dec esi
jnz .more jnz .more
.enough: .enough:
@ -334,7 +328,7 @@ draw_windowtabs:
highlight_updated_tabs: highlight_updated_tabs:
mov eax, 4 mov eax, 4
mov ebx, 10 shl 16 + 15 mov ebx, 5 shl 16 + TOP_SPACE + 4 ;;;;
mov ecx, 0x80aa0000 mov ecx, 0x80aa0000
mov esi, MAX_WINDOWS mov esi, MAX_WINDOWS
mov edi, windows mov edi, windows
@ -347,7 +341,7 @@ highlight_updated_tabs:
add edi, sizeof.window ; get ptr to next window add edi, sizeof.window ; get ptr to next window
cmp [edi + window.data_ptr], 0 cmp [edi + window.data_ptr], 0
je .enough_ je .enough_
add ebx, 125 shl 16 add ebx, (TAB_WIDTH + TAB_SPACE) shl 16
dec esi dec esi
jnz .more_ jnz .more_
.enough_: .enough_:

View File

@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2014. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2016. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;; IRC client for KolibriOS ;; ;; IRC client for KolibriOS ;;
@ -13,7 +13,7 @@
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
version equ '0.23' version equ '0.24'
; connection status ; connection status
STATUS_DISCONNECTED = 0 STATUS_DISCONNECTED = 0
@ -48,8 +48,12 @@ WIN_MIN_Y = 170
TEXT_X = 5 TEXT_X = 5
TEXT_Y = TOP_Y + 2 TEXT_Y = TOP_Y + 2
TOP_Y = 24 TOP_SPACE = 2
BOTTOM_Y = 15 TAB_HEIGHT = 14
TAB_WIDTH = 120
TAB_SPACE = 5
TOP_Y = TOP_SPACE+ TAB_HEIGHT
INPUTBOX_HEIGHT = 13
MAX_WINDOWS = 20 MAX_WINDOWS = 20
MAX_USERS = 4096 MAX_USERS = 4096
@ -503,12 +507,12 @@ str_welcome db 3, '3 ___', 3, '7__________', 3, '6_________ ', 3, '4 _
db 3, '3|___|', 3, '7|____|_ /', 3, '6\______ /', 3, '4 \___ >____/__|\___ >___| /__|', 10 db 3, '3|___|', 3, '7|____|_ /', 3, '6\______ /', 3, '4 \___ >____/__|\___ >___| /__|', 10
db 3, '3 ', 3, '7 \/ ', 3, '6 \/ ', 3, '4 \/ \/ \/', 10 db 3, '3 ', 3, '7 \/ ', 3, '6 \/ ', 3, '4 \/ \/ \/', 10
db 10 db 10
db 'Welcome to the KolibriOS IRC client v', version, 10 db 'Welcome to KolibriOS IRC client ', version, 10
db 10 db 10
db 'Type /help for help', 10, 10, 0 db 'Type /help for help', 10, 10, 0
str_version db 'VERSION ' str_version db 'VERSION KolibriOS '
str_programname db 'KolibriOS IRC client v', version, 0 str_programname db 'IRC client ', version, 0
str_user db 'user', 0 str_user db 'user', 0
str_nick db 'nick', 0 str_nick db 'nick', 0

View File

@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2014. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2016. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;; Written by hidnplayr@kolibrios.org ;; ;; Written by hidnplayr@kolibrios.org ;;

View File

@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2014. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2016. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;; Written by hidnplayr@kolibrios.org ;; ;; Written by hidnplayr@kolibrios.org ;;

View File

@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2014. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2016. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;; Written by hidnplayr@kolibrios.org ;; ;; Written by hidnplayr@kolibrios.org ;;

View File

@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; Copyright (C) KolibriOS team 2004-2014. All rights reserved. ;; ;; Copyright (C) KolibriOS team 2004-2016. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;; Written by hidnplayr@kolibrios.org ;; ;; Written by hidnplayr@kolibrios.org ;;