1) Component FileBrowser 
2) Small changes MenuBar component

git-svn-id: svn://kolibrios.org@1199 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Marat Zakiyanov (Mario79) 2009-10-07 18:41:24 +00:00
parent 6507cc5019
commit debc953680
5 changed files with 1871 additions and 452 deletions

View File

@ -1,7 +1,13 @@
;Libray from Editbox
; SEE YOU File FAQ.txt and HISTORY. Good Like!
;Last Change 13/02/2009
;;;;;;;;;;;;;;;;;;
;*****************************************************************************
; Box_Lib - library of graphical components
;
; Authors:
; Alexey Teplov aka <Lrz>
; Marat Zakiyanov aka Mario79, aka Mario
; Evtikhov Maxim aka Maxxxx32
; Eugene Grechnikov aka Diamond
; hidnplayr
;*****************************************************************************
format MS COFF
@ -9,40 +15,41 @@ public EXPORTS
section '.flat' code readable align 16
include '../../../../macros.inc'
include 'editbox.mac' ;¬ ªà®á ª®â®àë© ¤®«¦¥­ ®¡«¥£ç¨âì ¦¨§­ì :) ᯥ樠«ì­® ¤«ï editbox
include 'checkbox.mac' ;¬ ªà®á ᮤ¥à¦¨â ॠ«¨§ æ¨î checkbox
include 'optionbox.mac' ;¬ ªà®á ᮤ¥à¦¨â ॠ«¨§ æ¨î optionbox
include 'scrollbar.mac' ;¬ ªà®á ᮤ¥à¦¨â ॠ«¨§ æ¨î scrollbar
include 'd_button.mac' ;¬ ªà®á ᮤ¥à¦¨â ॠ«¨§ æ¨î dinamic button
include 'menubar.mac' ;¬ ªà®á ᮤ¥à¦¨â ॠ«¨§ æ¨î menubar
include 'editbox.mac' ;macro which should make life easier :) specially for editbox
include 'checkbox.mac' ;macro implements checkbox
include 'optionbox.mac' ;macro implements optionbox
include 'scrollbar.mac' ;macro implements scrollbar
include 'd_button.mac' ;macro implements dinamic_button
include 'menubar.mac' ;macro implements menubar
include 'filebrowser.mac' ;macro implements filebrowser
;----------------------------------------------------
;EditBox
;----------------------------------------------------
align 4
use_editbox_draw ;¬ ªà®á à ááªà뢠¥â äã­ªæ¨î ®â®¡à ¦¥­¨ï ¡®ªá .
use_editbox_draw ;macro reveals the function of the display.
align 4
use_editbox_key ;¬ ªà®á à ááªà뢠¥â äã­ªæ¨î ®¡à ¡®âª¨ ª« ¢¨èì.
use_editbox_key ;macro reveals processing function of the keypad.
align 4
use_editbox_mouse ;¬ ªà®á à ááªà뢠¥â äã­ªæ¨î ®¡à ¡®âª¨ ¬ëè¨.
use_editbox_mouse ;macro reveals processing function of the mouse.
;----------------------------------------------------
;CheckBox
;----------------------------------------------------
align 4
use_checkbox_draw ;¬ ªà®á à ááªà뢠¥â äã­ªæ¨î ®â®¡à ¦¥­¨ï ¡®ªá .
use_checkbox_draw ;macro reveals the function of the display.
align 4
use_checkbox_mouse ;¬ ªà®á à ááªà뢠¥â äã­ªæ¨î ®¡à ¡®âª¨ ¬ëè¨.
use_checkbox_mouse ;macro reveals processing function of the mouse.
;--------------------------------------------------
;radiobutton Group
;--------------------------------------------------
align 4
use_optionbox_driver ;¬ ªà®áë ª®â®àë¥ ã¯à ¢«ïîâ à ¡®â®© ¡®ªá  )
use_optionbox_driver ;macro that control the operating modes
align 4
use_optionbox_draw ;¬ ªà®á à ááªà뢠¥â äã­ªæ¨î ®â®¡à ¦¥­¨ï ¡®ªá .
use_optionbox_draw ;macro reveals the function of the display.
align 4
use_optionbox_mouse ;¬ ªà®á à ááªà뢠¥â äã­ªæ¨î ®¡à ¡®âª¨ ¬ëè¨.
use_optionbox_mouse ;macro reveals processing function of the mouse.
;--------------------------------------------------
;scrollbar Group
@ -66,7 +73,11 @@ use_dinamic_button
align 4
use_menu_bar
;--------------------------------------------------
;filebrowser Group
;--------------------------------------------------
align 4
use_file_browser
;--------------------------------------------------
init:
ret
@ -110,7 +121,13 @@ EXPORTS:
dd sz_Menu_bar_draw, menu_bar.draw
dd sz_Menu_bar_mouse, menu_bar.mouse
dd szVersion_menu_bar, 0x00010001
dd sz_Menu_bar_activate, menu_bar.activate
dd szVersion_menu_bar, 0x00010002
dd sz_FileBrowser_draw, fb_draw_panel
dd sz_FileBrowser_mouse, fb_mouse
dd sz_FileBrowser_key, fb_key
dd szVersion_FileBrowser, 0x00010001
dd 0,0
@ -142,5 +159,10 @@ szVersion_dbutton db 'version_dbutton',0
sz_Menu_bar_draw db 'menu_bar_draw',0
sz_Menu_bar_mouse db 'menu_bar_mouse',0
sz_Menu_bar_activate db 'menu_bar_activate',0
szVersion_menu_bar db 'version_menu_bar',0
sz_FileBrowser_draw db 'FileBrowser_draw',0
sz_FileBrowser_mouse db 'FileBrowser_mouse',0
sz_FileBrowser_key db 'FileBrowser_key',0
szVersion_FileBrowser db 'version_FileBrowser',0

View File

@ -1,6 +1,6 @@
;**************************************************************
; Dinamic Button Macro for Kolibri OS
; Copyright (c) 2009, Mario79
; Copyright (c) 2009, Marat Zakiyanov aka Mario79, aka Mario
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
@ -14,7 +14,7 @@
; names of its contributors may be used to endorse or promote products
; derived from this software without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY Mario79 ''AS IS'' AND ANY
; THIS SOFTWARE IS PROVIDED BY Marat Zakiyanov ''AS IS'' AND ANY
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
; DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
@ -67,10 +67,10 @@ dinamic_button_exit
cmp db_select,dword 2
je .click_2
mov ebx,db_passive_raw
jmp .draw_2 ;@f
jmp .draw_2
.active_1:
mov ebx,db_active_raw
jmp .draw_2 ;@f
jmp .draw_2
.click_2:
mov ebx,db_click_raw
@@:

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
;**************************************************************
; MenuBar Macro for Kolibri OS
; Copyright (c) 2009, Mario79
; Copyright (c) 2009, Marat Zakiyanov aka Mario79, aka Mario
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
@ -14,7 +14,7 @@
; names of its contributors may be used to endorse or promote products
; derived from this software without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY Mario79 ''AS IS'' AND ANY
; THIS SOFTWARE IS PROVIDED BY Marat Zakiyanov ''AS IS'' AND ANY
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
; DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
@ -42,7 +42,7 @@ m_start_y equ [edi+10]
m_text_pointer equ [edi+12]
m_pos_pointer equ [edi+16]
m_text_end equ [edi+20]
m_mouse_pos equ [edi+24]
m_ret_key equ [edi+24]
m_mouse_keys equ [edi+28]
m_size_x1 equ [edi+32]
m_start_x1 equ [edi+34]
@ -200,15 +200,16 @@ menu_bar_exit
; mouse event
;*****************************************************************************
;*****************************************************************************
.activate:
pusha
mov edi,dword [esp+36]
jmp .start_loop
.mouse:
pusha
mov edi,dword [esp+36]
;.mouse_1:
; mov eax,m_mouse_pos
; cmp m_get_mouse_flag,dword 0
; je @f
call .processing_real_mouse
;@@:
test eax,0x80000000
jnz .exit_menu
test eax,0x8000
@ -253,6 +254,7 @@ menu_bar_exit
cmp eax,m_mouse_keys_old
je .exit_menu_1
@@:
.start_loop:
mov m_select,dword 1
call .draw_1
call .allocate_menu_area
@ -264,7 +266,7 @@ menu_bar_exit
.still:
mcall 10
cmp eax,1
je .exit_menu_3 ;red
je .exit_menu_3
cmp eax,2
je .key_menu
cmp eax,3
@ -275,6 +277,7 @@ menu_bar_exit
.key_menu:
mcall 2
cmp m_extended_key,dword 1
je .extended_key
test al,al
@ -293,6 +296,11 @@ menu_bar_exit
je .menu_key_28_1
cmp ah,1 ; Esc
je .menu_key_1_1
cmp ah,75 ; L-Arrow down
je .menu_key_75_1
cmp ah,77 ; R-Arrow down
je .menu_key_77_1
.key_menu_end_1:
cmp ah,208 ; Arrow Down
je .key_menu_end
@ -302,12 +310,6 @@ menu_bar_exit
je .key_menu_end
cmp ah,129 ; Esc
je .key_menu_end
; cmp ah,184 ;Alt to Up
; je .end_5
; cmp ah,187 ; F1 to Up
; je .end_1
; cmp ah,188 ; F2 to Up
; je .end_1
cmp ah,199 ;Home
je .key_menu_end
cmp ah,207 ;End
@ -324,17 +326,20 @@ menu_bar_exit
je .key_menu_end
cmp ah,211 ; Delete
je .key_menu_end
; cmp ah,56 ;Alt to Up
; je .end_4
; cmp ah,59 ; F1 to Down
; je .end_2
; cmp ah,60 ; F2 to Down
; je .end_3
cmp ah,157 ; Ctrl up
je .key_menu_end
cmp ah,184 ; Alt up
je .key_menu_end
cmp ah,170 ; L-Shift up
je .key_menu_end
cmp ah,182 ; R-Shift up
je .key_menu_end
cmp ah,203 ; L-Arrow up
je .key_menu_end
cmp ah,205 ; R-Arrow up
je .key_menu_end
;.for_all_key:
; mov [close_menu],1
; ret
jmp .exit_menu_3 ;.still
jmp .exit_menu_3
;---------------------------------------------------------------------
.extended_key:
@ -401,13 +406,27 @@ menu_bar_exit
;---------------------------------------------------------------------
.menu_key_28:
cmp ah,28 ; Enter
jne .menu_key_end
jne .menu_key_75
.menu_key_28_1:
; mov [press_enter_menu],1
; ret
xor eax,eax
mov m_mouse_keys_old,eax
inc eax
mov m_mouse_keys,eax
jmp .exit_menu_2
.menu_key_end:
jmp .key_menu_end_1
;---------------------------------------------------------------------
.menu_key_75:
cmp ah,75 ; L-Arrow down
jne .menu_key_77
.menu_key_75_1:
mov m_ret_key,dword 1
jmp .exit_menu_3
;---------------------------------------------------------------------
.menu_key_77:
cmp ah,77 ; R-Arrow down
jne .key_menu_end_1
.menu_key_77_1:
mov m_ret_key,dword 2
jmp .exit_menu_3
;---------------------------------------------------------------------
.processing_real_mouse:
mcall 37,2
@ -416,7 +435,6 @@ menu_bar_exit
mov m_mouse_keys,eax
mcall 37,1
mov m_mouse_pos,eax
ret
;---------------------------------------------------------------------
.allocate_menu_area:
@ -526,7 +544,7 @@ menu_bar_exit
mov m_select,dword 0
call .draw_1
; jmp .exit_menu_1
test m_mouse_keys,dword 1b
jz .exit_menu_1

View File

@ -1,6 +1,6 @@
;**************************************************************
; ScrollBar Macro for Kolibri OS
; Copyright (c) 2009, Mario79
; Copyright (c) 2009, Marat Zakiyanov aka Mario79, aka Mario
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
@ -14,7 +14,7 @@
; names of its contributors may be used to endorse or promote products
; derived from this software without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY Mario79 ''AS IS'' AND ANY
; THIS SOFTWARE IS PROVIDED BY Marat Zakiyanov ''AS IS'' AND ANY
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
; DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
@ -294,7 +294,6 @@ scroll_bar_vertical:
.draw:
pusha
mov edi,dword [esp+36]
; mov sb_all_redraw,dword 1
mov sb_delta,word 0
call .draw_1
mov sb_all_redraw,dword 0
@ -309,7 +308,7 @@ scroll_bar_exit
sub eax,edx
mov sb_work_size,eax
;*********************************
mov eax,sb_work_size ;sb_max_area
mov eax,sb_work_size
mov ebx,sb_max_area
cmp ebx,sb_cur_area
ja @f
@ -494,7 +493,7 @@ draw_down_arrow_vertical
pop ecx
ror ecx,16
add ecx,sb_btn_high ;14 shl 16
add ecx,sb_btn_high
rol ecx,16
mov edx,sb_line_col
@ -536,7 +535,7 @@ draw_down_arrow_vertical
@@:
cmp sb_m_keys,dword 0
jne @f ;.continue_2
jne @f
mov eax,sb_m_pos
mov sb_m_pos_2,eax
jmp .correct_1 ;.exit_sb
@ -607,7 +606,7 @@ draw_down_arrow_vertical
push eax
mov ax,sb_m_pos
cmp ax,sb_m_pos_2
je .correct ;.exit_sb
je .correct
shl eax,16
shr eax,16
@ -675,10 +674,8 @@ draw_down_arrow_vertical
mov eax,sb_ar_offset
cmp sb_position,eax ;dword 0
; je .exit_sb
jbe @f
; dec dword sb_position
sub sb_position,eax
jmp .all_sb
@@:
@ -699,7 +696,6 @@ draw_down_arrow_vertical
@@:
mov ebx,sb_btn_high ;16 ;15
; inc ebx
add bx,sb_start_y
sub cx,bx
sub ax,bx
@ -712,7 +708,6 @@ draw_down_arrow_vertical
@@:
mov edx,eax
; sub edx,sb_btn_high
push ebx
shr ebx,1
sub edx,ebx
@ -734,7 +729,6 @@ draw_down_arrow_vertical
jbe .continue
mov sb_position2,edx
; jmp .continue_1
.continue:
mov eax,sb_position2
@ -750,7 +744,7 @@ draw_down_arrow_vertical
xor eax,eax
inc eax
mov sb_position2,eax
jmp .all_sb ;.store_position
jmp .all_sb
@@:
sub eax,sb_cur_area
inc eax
@ -796,10 +790,8 @@ draw_down_arrow_vertical
sub eax,ebx
cmp sb_position,eax
pop eax
; jae .exit_sb
jae @f
; inc dword sb_position
add sb_position,ebx
jmp .all_sb
@@:
@ -826,7 +818,6 @@ scroll_bar_horizontal:
.draw:
pusha
mov edi,dword [esp+36]
; mov sb_all_redraw,dword 1
mov sb_delta,word 0
call .draw_1
mov sb_all_redraw,dword 0
@ -1066,7 +1057,7 @@ draw_down_arrow_horizontal
@@:
cmp sb_m_keys,dword 0
jne @f ;.continue_2
jne @f
mov eax,sb_m_pos
mov sb_m_pos_2,eax
jmp .correct_1 ;.exit_sb
@ -1140,7 +1131,7 @@ draw_down_arrow_horizontal
shr eax,16
shr ebx,16
cmp eax,ebx
je .correct ;.exit_sb
je .correct
; shl eax,16
; shr eax,16
@ -1208,10 +1199,8 @@ draw_down_arrow_horizontal
mov eax,sb_ar_offset
cmp sb_position,eax ;dword 0
; je .exit_sb
jbe @f
; dec dword sb_position
sub sb_position,eax
jmp .all_sb
@@:
@ -1232,7 +1221,6 @@ draw_down_arrow_horizontal
@@:
mov ebx,sb_btn_high ;16 ;15
; inc ebx
add bx,sb_start_x ;y
sub cx,bx
sub ax,bx
@ -1245,7 +1233,7 @@ draw_down_arrow_horizontal
@@:
mov edx,eax
; sub edx,sb_btn_high
push ebx
shr ebx,1
sub edx,ebx
@ -1267,7 +1255,6 @@ draw_down_arrow_horizontal
jbe .continue
mov sb_position2,edx
; jmp .continue_1
.continue:
mov eax,sb_position2
@ -1283,7 +1270,7 @@ draw_down_arrow_horizontal
xor eax,eax
inc eax
mov sb_position2,eax
jmp .all_sb ;.store_position
jmp .all_sb
@@:
sub eax,sb_cur_area
inc eax
@ -1329,10 +1316,8 @@ draw_down_arrow_horizontal
sub eax,ebx
cmp sb_position,eax
pop eax
; jae .exit_sb
jae @f
; inc dword sb_position
add sb_position,ebx
jmp .all_sb
@@: