mirror of
https://github.com/KolibriOS/kolibrios.git
synced 2024-11-24 17:59:38 +03:00
Box_Lib - Scrollbar type 2
git-svn-id: svn://kolibrios.org@2354 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
a2109c90b2
commit
a86930f3da
@ -1,6 +1,6 @@
|
||||
;**************************************************************
|
||||
; ScrollBar Macro for Kolibri OS
|
||||
; Copyright (c) 2009, Marat Zakiyanov aka Mario79, aka Mario
|
||||
; Copyright (c) 2009-2012, Marat Zakiyanov aka Mario79, aka Mario
|
||||
; All rights reserved.
|
||||
;
|
||||
; Redistribution and use in source and binary forms, with or without
|
||||
@ -25,6 +25,8 @@
|
||||
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
;*****************************************************************************
|
||||
; 15.11.2011 add scroll type 1 by IgorA
|
||||
;*****************************************************************************
|
||||
macro scroll_bar_exit
|
||||
{
|
||||
popa
|
||||
@ -68,6 +70,42 @@ macro draw_up_arrow_vertical
|
||||
pop ebx
|
||||
}
|
||||
;*****************************************************************************
|
||||
macro draw_up_arrow_vertical_type2
|
||||
{
|
||||
push ebx
|
||||
|
||||
mov bx,sb_size_x
|
||||
shr bx,1
|
||||
add bx,sb_start_x
|
||||
|
||||
mov cx,sb_btn_high
|
||||
shr cx,1
|
||||
add cx,sb_start_y
|
||||
|
||||
mov ax,bx
|
||||
shl eax,16
|
||||
mov ax,cx
|
||||
|
||||
sub cx,2
|
||||
|
||||
shl ebx,16
|
||||
shl ecx,16
|
||||
|
||||
mov cx,ax
|
||||
shr eax,16
|
||||
mov bx,ax
|
||||
|
||||
add cx,1
|
||||
sub bx,3
|
||||
|
||||
mcall 38,,,sb_line_col
|
||||
|
||||
add bx,6
|
||||
|
||||
mcall
|
||||
pop ebx
|
||||
}
|
||||
;*****************************************************************************
|
||||
macro draw_down_arrow_vertical
|
||||
{
|
||||
push ebx
|
||||
@ -106,6 +144,44 @@ macro draw_down_arrow_vertical
|
||||
pop ebx
|
||||
}
|
||||
;*****************************************************************************
|
||||
macro draw_down_arrow_vertical_type2
|
||||
{
|
||||
push ebx
|
||||
|
||||
mov bx,sb_size_x
|
||||
shr bx,1
|
||||
add bx,sb_start_x
|
||||
|
||||
mov ax,sb_btn_high
|
||||
shr ax,1
|
||||
mov cx,sb_start_y
|
||||
add cx,sb_size_y
|
||||
sub cx,ax
|
||||
|
||||
mov ax,bx
|
||||
shl eax,16
|
||||
mov ax,cx
|
||||
|
||||
add cx,1
|
||||
|
||||
shl ebx,16
|
||||
shl ecx,16
|
||||
|
||||
mov cx,ax
|
||||
shr eax,16
|
||||
mov bx,ax
|
||||
|
||||
sub cx,2
|
||||
sub bx,3
|
||||
|
||||
mcall 38,,,sb_line_col
|
||||
|
||||
add bx,6
|
||||
|
||||
mcall
|
||||
pop ebx
|
||||
}
|
||||
;*****************************************************************************
|
||||
macro draw_runner_center_vertical
|
||||
{
|
||||
push ebx
|
||||
@ -179,6 +255,42 @@ macro draw_up_arrow_horizontal
|
||||
pop ecx
|
||||
}
|
||||
;*****************************************************************************
|
||||
macro draw_up_arrow_horizontal_type2
|
||||
{
|
||||
push ebx ecx
|
||||
|
||||
mov bx,sb_btn_high
|
||||
shr bx,1
|
||||
add bx,sb_start_x
|
||||
|
||||
mov cx,sb_size_y
|
||||
shr cx,1
|
||||
add cx,sb_start_y
|
||||
|
||||
mov ax,bx
|
||||
shl eax,16
|
||||
mov ax,cx
|
||||
|
||||
sub bx,2
|
||||
|
||||
shl ebx,16
|
||||
shl ecx,16
|
||||
|
||||
mov cx,ax
|
||||
shr eax,16
|
||||
mov bx,ax
|
||||
|
||||
add bx,1
|
||||
sub cx,3
|
||||
|
||||
mcall 38,,,sb_line_col
|
||||
|
||||
add cx,6
|
||||
|
||||
mcall
|
||||
pop ecx ebx
|
||||
}
|
||||
;*****************************************************************************
|
||||
macro draw_down_arrow_horizontal
|
||||
{
|
||||
push ecx
|
||||
@ -217,6 +329,44 @@ macro draw_down_arrow_horizontal
|
||||
pop ecx
|
||||
}
|
||||
;*****************************************************************************
|
||||
macro draw_down_arrow_horizontal_type2
|
||||
{
|
||||
push ebx ecx
|
||||
|
||||
mov ax,sb_btn_high
|
||||
shr ax,1
|
||||
mov bx,sb_start_x
|
||||
add bx,sb_size_x
|
||||
sub bx,ax
|
||||
|
||||
mov cx,sb_size_y
|
||||
shr cx,1
|
||||
add cx,sb_start_y
|
||||
|
||||
mov ax,bx
|
||||
shl eax,16
|
||||
mov ax,cx
|
||||
|
||||
add cx,1
|
||||
|
||||
shl ebx,16
|
||||
shl ecx,16
|
||||
|
||||
mov cx,ax
|
||||
shr eax,16
|
||||
mov bx,ax
|
||||
|
||||
sub cx,2
|
||||
sub bx,3
|
||||
|
||||
mcall 38,,,sb_line_col
|
||||
|
||||
add cx,6
|
||||
|
||||
mcall
|
||||
pop ecx ebx
|
||||
}
|
||||
;*****************************************************************************
|
||||
macro draw_runner_center_horizontal
|
||||
{
|
||||
push ebx
|
||||
@ -312,7 +462,6 @@ scroll_bar_exit
|
||||
mov ebx,sb_max_area
|
||||
cmp ebx,sb_cur_area
|
||||
ja @f
|
||||
|
||||
jmp .no_size
|
||||
|
||||
@@:
|
||||
@ -388,12 +537,21 @@ scroll_bar_exit
|
||||
sub ecx,2
|
||||
mov edx,sb_frnt_col
|
||||
cmp dword sb_all_redraw,0
|
||||
je @f
|
||||
je .no_draw_top_button
|
||||
int 0x40 ; top button filling
|
||||
;-----------------------------------------------------------------------------
|
||||
; scrollbar type 2
|
||||
cmp word sb_type,2
|
||||
jne .no_type2
|
||||
;*********************************
|
||||
draw_up_arrow_vertical_type2
|
||||
;*********************************
|
||||
jmp .no_draw_top_button
|
||||
.no_type2:
|
||||
;*********************************
|
||||
draw_up_arrow_vertical
|
||||
;*********************************
|
||||
@@:
|
||||
.no_draw_top_button:
|
||||
pop ecx
|
||||
|
||||
ror ecx,16
|
||||
@ -402,7 +560,7 @@ draw_up_arrow_vertical
|
||||
mov edx,sb_line_col
|
||||
cmp dword sb_all_redraw,0
|
||||
je @f
|
||||
int 0x40 ; top button - bottom line
|
||||
mcall 13 ; top button - bottom line
|
||||
@@:
|
||||
pop ecx
|
||||
;*********************************
|
||||
@ -439,9 +597,16 @@ draw_up_arrow_vertical
|
||||
sub ecx,2
|
||||
mov edx,sb_frnt_col
|
||||
int 0x40 ; runner filling
|
||||
;-----------------------------------------------------------------------------
|
||||
; scrollbar type 2
|
||||
cmp word sb_type,2
|
||||
je @f
|
||||
;*********************************
|
||||
draw_runner_center_vertical
|
||||
;*********************************
|
||||
@@:
|
||||
;-----------------------------------------------------------------------------
|
||||
; scrollbar type 1 - stylish frame
|
||||
cmp word sb_type,1
|
||||
jne @f
|
||||
push eax ebx ecx edx
|
||||
@ -452,10 +617,11 @@ draw_runner_center_vertical
|
||||
movzx ecx,word sb_size_x
|
||||
mov edx,sb_run_size
|
||||
dec edx
|
||||
;à¨á®¢ ¨¥ á⨫쮩 à ¬ª¨ ¯®«§ãª¥
|
||||
; drawing a stylish frame on the slider
|
||||
stdcall draw_edge,eax,ebx,ecx,edx,sb_bckg_col,sb_frnt_col,sb_line_col
|
||||
pop edx ecx ebx eax
|
||||
@@:
|
||||
;-----------------------------------------------------------------------------
|
||||
shr ecx,16
|
||||
add ecx,sb_run_size
|
||||
sub ecx,2
|
||||
@ -498,12 +664,21 @@ draw_runner_center_vertical
|
||||
sub ecx,2
|
||||
mov edx,sb_frnt_col
|
||||
cmp dword sb_all_redraw,0
|
||||
je @f
|
||||
je .no_draw_bottom_button
|
||||
int 0x40 ; bottom button filling
|
||||
;-----------------------------------------------------------------------------
|
||||
; scrollbar type 2
|
||||
cmp word sb_type,2
|
||||
jne .no_type2_1
|
||||
;*********************************
|
||||
draw_down_arrow_vertical_type2
|
||||
;*********************************
|
||||
jmp .no_draw_bottom_button
|
||||
.no_type2_1:
|
||||
;*********************************
|
||||
draw_down_arrow_vertical
|
||||
;*********************************
|
||||
@@:
|
||||
.no_draw_bottom_button:
|
||||
pop ecx
|
||||
|
||||
ror ecx,16
|
||||
@ -514,23 +689,25 @@ draw_down_arrow_vertical
|
||||
mov cx,1
|
||||
cmp dword sb_all_redraw,0
|
||||
je @f
|
||||
int 0x40 ; bottom button - extreme line
|
||||
mcall 13 ; bottom button - extreme line
|
||||
;-----------------------------------------------------------------------------
|
||||
; scrollbar type 1 - stylish frame
|
||||
cmp word sb_type,1
|
||||
jne @f
|
||||
movzx eax,word sb_start_x
|
||||
movzx ebx,word sb_start_y
|
||||
movzx ecx,word sb_size_x
|
||||
;à¨á®¢ ¨¥ á⨫쮩 à ¬ª¨ ¢¥à奩 ª®¯ª¥
|
||||
; drawing a stylish frame on the top button
|
||||
stdcall draw_edge,eax,ebx,ecx,sb_btn_high,\
|
||||
sb_bckg_col,sb_frnt_col,sb_line_col
|
||||
|
||||
add bx,sb_size_y
|
||||
sub ebx,sb_btn_high
|
||||
dec ebx
|
||||
;à¨á®¢ ¨¥ á⨫쮩 à ¬ª¨ ¨¦¥© ª®¯ª¥
|
||||
; drawing a stylish frame on the bottom button
|
||||
stdcall draw_edge,eax,ebx,ecx,sb_btn_high,\
|
||||
sb_bckg_col,sb_frnt_col,sb_line_col
|
||||
@@:
|
||||
;-----------------------------------------------------------------------------
|
||||
popa
|
||||
ret
|
||||
;*****************************************************************************
|
||||
@ -555,13 +732,10 @@ draw_down_arrow_vertical
|
||||
je @f
|
||||
|
||||
mov sb_m_keys,eax
|
||||
|
||||
mov sb_delta,dword 0
|
||||
|
||||
mov eax,sb_m_pos
|
||||
mov sb_m_pos_2,eax
|
||||
jmp .continue_2
|
||||
|
||||
@@:
|
||||
cmp dword sb_m_keys,0
|
||||
jne @f
|
||||
@ -941,12 +1115,21 @@ scroll_bar_exit
|
||||
sub ebx,2
|
||||
mov edx,sb_frnt_col
|
||||
cmp dword sb_all_redraw,0
|
||||
je @f
|
||||
je .no_draw_top_button
|
||||
int 0x40 ; left button filling
|
||||
;-----------------------------------------------------------------------------
|
||||
; scrollbar type 2
|
||||
cmp word sb_type,2
|
||||
jne .no_type2
|
||||
;*********************************
|
||||
draw_up_arrow_horizontal_type2
|
||||
;*********************************
|
||||
jmp .no_draw_top_button
|
||||
.no_type2:
|
||||
;*********************************
|
||||
draw_up_arrow_horizontal
|
||||
;*********************************
|
||||
@@:
|
||||
.no_draw_top_button:
|
||||
pop ebx
|
||||
|
||||
ror ebx,16
|
||||
@ -955,7 +1138,7 @@ draw_up_arrow_horizontal
|
||||
mov edx,sb_line_col
|
||||
cmp dword sb_all_redraw,0
|
||||
je @f
|
||||
int 0x40 ; left button - right line
|
||||
mcall 13 ; left button - right line
|
||||
@@:
|
||||
pop ebx
|
||||
;*********************************
|
||||
@ -992,9 +1175,16 @@ draw_up_arrow_horizontal
|
||||
sub ebx,2
|
||||
mov edx,sb_frnt_col
|
||||
int 0x40 ; runner filling
|
||||
;-----------------------------------------------------------------------------
|
||||
; scrollbar type 2
|
||||
cmp word sb_type,2
|
||||
je @f
|
||||
;*********************************
|
||||
draw_runner_center_horizontal
|
||||
;*********************************
|
||||
@@:
|
||||
;-----------------------------------------------------------------------------
|
||||
; scrollbar type 1 - stylish frame
|
||||
cmp word sb_type,1
|
||||
jne @f
|
||||
push eax ebx ecx edx
|
||||
@ -1005,12 +1195,12 @@ draw_runner_center_horizontal
|
||||
mov ecx,sb_run_size
|
||||
dec ecx
|
||||
movzx edx,word sb_size_y
|
||||
;à¨á®¢ ¨¥ á⨫쮩 à ¬ª¨ ¯®«§ãª¥
|
||||
; drawing a stylish frame on the slider
|
||||
stdcall draw_edge,eax,ebx,ecx,edx,\
|
||||
sb_bckg_col,sb_frnt_col,sb_line_col
|
||||
pop edx ecx ebx eax
|
||||
@@:
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
shr ebx,16
|
||||
add ebx,sb_run_size
|
||||
sub ebx,2
|
||||
@ -1053,12 +1243,21 @@ draw_runner_center_horizontal
|
||||
sub ebx,2
|
||||
mov edx,sb_frnt_col
|
||||
cmp dword sb_all_redraw,0
|
||||
je @f
|
||||
je .no_draw_bottom_button
|
||||
int 0x40 ; bottom button filling
|
||||
;-----------------------------------------------------------------------------
|
||||
; scrollbar type 2
|
||||
cmp word sb_type,2
|
||||
jne .no_type2_1
|
||||
;*********************************
|
||||
draw_down_arrow_horizontal_type2
|
||||
;*********************************
|
||||
jmp .no_draw_bottom_button
|
||||
.no_type2_1:
|
||||
;*********************************
|
||||
draw_down_arrow_horizontal
|
||||
;*********************************
|
||||
@@:
|
||||
.no_draw_bottom_button:
|
||||
pop ebx
|
||||
|
||||
ror ebx,16
|
||||
@ -1069,10 +1268,12 @@ draw_down_arrow_horizontal
|
||||
mov bx,1
|
||||
cmp dword sb_all_redraw,0
|
||||
je @f
|
||||
int 0x40 ; bottom button - extreme line
|
||||
mcall 13 ; bottom button - extreme line
|
||||
;-----------------------------------------------------------------------------
|
||||
; scrollbar type 1 - stylish frame
|
||||
cmp word sb_type,1
|
||||
jne @f
|
||||
;à¨á®¢ ¨¥ á⨫쮩 à ¬ª¨ «¥¢®© ª®¯ª¥
|
||||
; drawing a stylish frame on the left button
|
||||
movzx eax,word sb_start_x
|
||||
movzx ebx,word sb_start_y
|
||||
movzx edx,word sb_size_y
|
||||
@ -1083,10 +1284,11 @@ draw_down_arrow_horizontal
|
||||
add ax,sb_size_x
|
||||
sub eax,sb_btn_high
|
||||
dec eax
|
||||
;à¨á®¢ ¨¥ á⨫쮩 à ¬ª¨ ¯à ¢®© ª®¯ª¥
|
||||
; drawing a stylish frame on the right button
|
||||
stdcall draw_edge,eax,ebx,sb_btn_high,edx,\
|
||||
sb_bckg_col,sb_frnt_col,sb_line_col
|
||||
@@:
|
||||
;-----------------------------------------------------------------------------
|
||||
popa
|
||||
ret
|
||||
;*****************************************************************************
|
||||
@ -1390,6 +1592,7 @@ draw_down_arrow_horizontal
|
||||
sub eax,sb_run_size
|
||||
mov sb_position2,eax
|
||||
jmp .all_sb
|
||||
;*****************************************************************************
|
||||
.exit_sb:
|
||||
scroll_bar_exit
|
||||
}
|
||||
|
@ -2803,7 +2803,7 @@ scroll_bar_data_vertical:
|
||||
.size_y dw 300 ;+4
|
||||
.start_y dw 45 ;+6
|
||||
.btn_high dd 15 ;+8
|
||||
.type dd 1 ;+12
|
||||
.type dd 0 ;+12
|
||||
.max_area dd 10 ;+16
|
||||
.cur_area dd 2 ;+20
|
||||
.position dd 0 ;+24
|
||||
|
@ -974,7 +974,7 @@ scroll_bar_data_vertical:
|
||||
.size_y dw 300 ;+4
|
||||
.start_y dw 30 ;+6
|
||||
.btn_high dd 15 ;+8
|
||||
.type dd 1 ;+12
|
||||
.type dd 2 ;+12
|
||||
.max_area dd 10 ;+16
|
||||
.cur_area dd 2 ;+20
|
||||
.position dd 0 ;+24
|
||||
@ -1008,7 +1008,7 @@ scroll_bar_data_horizontal:
|
||||
.size_y dw 15 ;0 ;+4
|
||||
.start_y dw 300 ;0 ;+6
|
||||
.btn_high dd 15 ;+8
|
||||
.type dd 1 ;+12
|
||||
.type dd 2 ;+12
|
||||
.max_area dd 10 ;+16
|
||||
.cur_area dd 2 ;+20
|
||||
.position dd 0 ;+24
|
||||
|
Loading…
Reference in New Issue
Block a user