forked from KolibriOS/kolibrios
OpenDialog:
1) use EditBox to display and enter the path, switch by use Tab key 2) fixed sorting of files 3) Icons by Leency git-svn-id: svn://kolibrios.org@1244 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
7ad1b8162e
commit
38098ecc9f
@ -40,6 +40,7 @@ dd path
|
|||||||
|
|
||||||
include '../../../../../macros.inc'
|
include '../../../../../macros.inc'
|
||||||
include '../../load_lib.mac'
|
include '../../load_lib.mac'
|
||||||
|
include 'editbox_ex.mac'
|
||||||
;include 'macros.inc'
|
;include 'macros.inc'
|
||||||
;include 'load_lib.mac'
|
;include 'load_lib.mac'
|
||||||
@use_library
|
@use_library
|
||||||
@ -119,6 +120,9 @@ control_minimal_window_size:
|
|||||||
ret
|
ret
|
||||||
;---------------------------------------------------------------------
|
;---------------------------------------------------------------------
|
||||||
key:
|
key:
|
||||||
|
mov al,[focus_pointer]
|
||||||
|
test al,al
|
||||||
|
jne key_ASCII
|
||||||
mcall 2
|
mcall 2
|
||||||
xor ebx,ebx
|
xor ebx,ebx
|
||||||
cmp [extended_key],1
|
cmp [extended_key],1
|
||||||
@ -172,6 +176,8 @@ key:
|
|||||||
je NumPad_invert_Up
|
je NumPad_invert_Up
|
||||||
cmp ah,158
|
cmp ah,158
|
||||||
je symbol_a_up
|
je symbol_a_up
|
||||||
|
cmp ah,15 ;143 ; Tab
|
||||||
|
je change_focus_area
|
||||||
jmp still
|
jmp still
|
||||||
.extended_key:
|
.extended_key:
|
||||||
mov [extended_key],0
|
mov [extended_key],0
|
||||||
@ -263,6 +269,62 @@ key:
|
|||||||
@@:
|
@@:
|
||||||
ret
|
ret
|
||||||
;---------------------------------------------------------------------
|
;---------------------------------------------------------------------
|
||||||
|
change_focus_area:
|
||||||
|
mov al,[focus_pointer]
|
||||||
|
inc al
|
||||||
|
and al,1
|
||||||
|
mov [focus_pointer],al
|
||||||
|
.1:
|
||||||
|
mov edi,edit1
|
||||||
|
test al,al
|
||||||
|
jne @f
|
||||||
|
mov [file_browser_data_1.select_panel_counter],1
|
||||||
|
and [edi+44],dword 0xFFFFFFFD ; ed_focus
|
||||||
|
mov [edi+12],dword 0xffffff; color white
|
||||||
|
call draw_draw_file_browser1
|
||||||
|
mcall 66, 1, 1
|
||||||
|
jmp still
|
||||||
|
@@:
|
||||||
|
mov [file_browser_data_1.select_panel_counter],0
|
||||||
|
or [edi+44],dword ed_focus
|
||||||
|
mov [edi+12],dword 0xffffb0 ; color yellow
|
||||||
|
call draw_draw_file_browser1
|
||||||
|
mcall 66, 1, 0
|
||||||
|
jmp still
|
||||||
|
;---------------------------------------------------------------------
|
||||||
|
key_ASCII:
|
||||||
|
mcall 2
|
||||||
|
cmp ah,9
|
||||||
|
je change_focus_area
|
||||||
|
cmp ah,13
|
||||||
|
je .load_dir
|
||||||
|
cmp ah,27
|
||||||
|
je button.exit
|
||||||
|
push dword name_editboxes
|
||||||
|
call [edit_box_key]
|
||||||
|
jmp still
|
||||||
|
.load_dir:
|
||||||
|
mov [file_browser_data_1.select_panel_counter],1
|
||||||
|
xor eax,eax
|
||||||
|
mov [focus_pointer],al
|
||||||
|
mcall 66, 1, 1
|
||||||
|
|
||||||
|
xor eax,eax
|
||||||
|
mov esi,dir_pach
|
||||||
|
cld
|
||||||
|
@@:
|
||||||
|
lodsb
|
||||||
|
test al,al
|
||||||
|
jne @r
|
||||||
|
sub esi,2
|
||||||
|
cmp [esi],byte '/'
|
||||||
|
jne @f
|
||||||
|
xor eax,eax
|
||||||
|
mov [esi],al
|
||||||
|
@@:
|
||||||
|
call load_next_dir.1
|
||||||
|
jmp still
|
||||||
|
;---------------------------------------------------------------------
|
||||||
select_disk:
|
select_disk:
|
||||||
call check_alt
|
call check_alt
|
||||||
.1:
|
.1:
|
||||||
@ -564,16 +626,29 @@ mouse:
|
|||||||
cmp [scroll_bar_data_vertical.delta2],0
|
cmp [scroll_bar_data_vertical.delta2],0
|
||||||
jne .scrollbar
|
jne .scrollbar
|
||||||
|
|
||||||
|
mov [file_browser_data_1.select_flag],0
|
||||||
|
|
||||||
push dword file_browser_data_1
|
push dword file_browser_data_1
|
||||||
call [FileBrowser_mouse]
|
call [FileBrowser_mouse]
|
||||||
|
|
||||||
mov eax,file_browser_data_1.mouse_keys_delta
|
mov eax,file_browser_data_1.mouse_keys_delta
|
||||||
cmp [eax],dword 3
|
cmp [eax],dword 3
|
||||||
jne .scrollbar
|
jne .check_focus ;.scrollbar
|
||||||
mov [eax],dword 0
|
mov [eax],dword 0
|
||||||
call load_next_dir
|
call load_next_dir
|
||||||
jmp still
|
jmp still
|
||||||
|
;---------------------------------------------------
|
||||||
|
.check_focus:
|
||||||
|
mov ebx,[file_browser_data_1.select_flag]
|
||||||
|
test ebx,ebx
|
||||||
|
jz .scrollbar ;@f
|
||||||
|
mov al,[focus_pointer]
|
||||||
|
test al,al
|
||||||
|
jz .scrollbar
|
||||||
|
xor eax,eax
|
||||||
|
mov [focus_pointer],al
|
||||||
|
jmp change_focus_area.1
|
||||||
|
;---------------------------------------------------
|
||||||
.scrollbar:
|
.scrollbar:
|
||||||
mov eax,[scroll_bar_data_vertical.max_area]
|
mov eax,[scroll_bar_data_vertical.max_area]
|
||||||
cmp eax,[scroll_bar_data_vertical.cur_area]
|
cmp eax,[scroll_bar_data_vertical.cur_area]
|
||||||
@ -623,12 +698,32 @@ mouse:
|
|||||||
call [menu_bar_mouse]
|
call [menu_bar_mouse]
|
||||||
|
|
||||||
cmp [menu_data_3.click],dword 1
|
cmp [menu_data_3.click],dword 1
|
||||||
jne .check_scroll_event
|
jne .check_editboxes
|
||||||
|
|
||||||
cmp [menu_data_3.cursor_out],dword 0
|
cmp [menu_data_3.cursor_out],dword 0
|
||||||
jne analyse_out_menu_3
|
jne analyse_out_menu_3
|
||||||
jmp .menu_bar_1
|
jmp .menu_bar_1
|
||||||
;---------------------------------------------------
|
;---------------------------------------------------
|
||||||
|
.check_editboxes:
|
||||||
|
mov eax,[edit1+44]
|
||||||
|
and eax,10b
|
||||||
|
push dword name_editboxes
|
||||||
|
call [edit_box_mouse]
|
||||||
|
mov ebx,[edit1+44]
|
||||||
|
and ebx,10b
|
||||||
|
cmp eax,ebx
|
||||||
|
je .check_scroll_event
|
||||||
|
mov al,[focus_pointer]
|
||||||
|
test al,al
|
||||||
|
jnz .check_scroll_event
|
||||||
|
xor eax,eax
|
||||||
|
test ebx,10b
|
||||||
|
jz @f
|
||||||
|
inc eax
|
||||||
|
@@:
|
||||||
|
mov [focus_pointer],al
|
||||||
|
jmp change_focus_area.1
|
||||||
|
;---------------------------------------------------
|
||||||
.check_scroll_event:
|
.check_scroll_event:
|
||||||
mov eax,[mouse_position]
|
mov eax,[mouse_position]
|
||||||
xor ebx,ebx
|
xor ebx,ebx
|
||||||
@ -818,7 +913,10 @@ load_next_dir:
|
|||||||
mov ecx,[scroll_bar_data_vertical.y]
|
mov ecx,[scroll_bar_data_vertical.y]
|
||||||
inc ecx
|
inc ecx
|
||||||
mcall 13,,,0xcccccc
|
mcall 13,,,0xcccccc
|
||||||
|
mov edi,edit1
|
||||||
|
xor eax,eax
|
||||||
|
mov [edi+44],eax
|
||||||
|
mov [edi+12],dword 0xffffff ; color white
|
||||||
call draw_draw_file_browser1
|
call draw_draw_file_browser1
|
||||||
ret
|
ret
|
||||||
.exit_dir:
|
.exit_dir:
|
||||||
@ -1199,6 +1297,32 @@ draw_for_fs_errors:
|
|||||||
ret
|
ret
|
||||||
;---------------------------------------------------------------------
|
;---------------------------------------------------------------------
|
||||||
draw_dir_pach:
|
draw_dir_pach:
|
||||||
|
mov esi,dir_pach
|
||||||
|
cld
|
||||||
|
@@:
|
||||||
|
lodsb
|
||||||
|
test al,al
|
||||||
|
jne @r
|
||||||
|
sub esi,dir_pach
|
||||||
|
mov eax,esi
|
||||||
|
dec eax
|
||||||
|
mov edi, edit1
|
||||||
|
mov [edi+48], eax ;ed_size
|
||||||
|
mov [edi+52], eax ;ed_pos
|
||||||
|
|
||||||
|
mov eax,[file_browser_data_1.x]
|
||||||
|
mov ebx,eax
|
||||||
|
shr ebx,16
|
||||||
|
and eax,0xffff
|
||||||
|
|
||||||
|
mov [edi],eax
|
||||||
|
mov [edi+4],ebx
|
||||||
|
|
||||||
|
push dword name_editboxes
|
||||||
|
call [edit_box_draw]
|
||||||
|
ret
|
||||||
|
|
||||||
|
draw_dir_pach_1:
|
||||||
mov ebx,[file_browser_data_1.x]
|
mov ebx,[file_browser_data_1.x]
|
||||||
mcall 13,,<7,15>,0xffffb0
|
mcall 13,,<7,15>,0xffffb0
|
||||||
mov bx,10
|
mov bx,10
|
||||||
@ -1427,10 +1551,18 @@ load_icons:
|
|||||||
jmp button.exit
|
jmp button.exit
|
||||||
;---------------------------------------------------------------------
|
;---------------------------------------------------------------------
|
||||||
sort_directory:
|
sort_directory:
|
||||||
push dword [sort_type] ; sort mode
|
|
||||||
mov eax,[file_browser_data_1.folder_data]
|
mov eax,[file_browser_data_1.folder_data]
|
||||||
push dword [eax+4] ; number of files
|
mov ebx,[eax+4] ; number of files
|
||||||
add eax,32
|
add eax,32
|
||||||
|
cmp [eax+40],word '..'
|
||||||
|
jne @f
|
||||||
|
cmp [eax+40+2],byte 0
|
||||||
|
jne @f
|
||||||
|
dec ebx
|
||||||
|
add eax,304
|
||||||
|
@@:
|
||||||
|
push dword [sort_type] ; sort mode
|
||||||
|
push ebx ; number of files
|
||||||
push eax ; data files
|
push eax ; data files
|
||||||
call [sort_dir]
|
call [sort_dir]
|
||||||
ret
|
ret
|
||||||
@ -2176,6 +2308,8 @@ error_window db 0
|
|||||||
|
|
||||||
filter_flag db 1
|
filter_flag db 1
|
||||||
|
|
||||||
|
focus_pointer db 0
|
||||||
|
;---------------------------------------------------------------------
|
||||||
start_pach:
|
start_pach:
|
||||||
db '/rd/1',0
|
db '/rd/1',0
|
||||||
|
|
||||||
@ -2448,6 +2582,16 @@ file_browser_data_1:
|
|||||||
.mouse_pos_old dd 0 ;+196
|
.mouse_pos_old dd 0 ;+196
|
||||||
.marked_counter dd 0 ;+200
|
.marked_counter dd 0 ;+200
|
||||||
;---------------------------------------------------------------------
|
;---------------------------------------------------------------------
|
||||||
|
; for EDITBOX
|
||||||
|
align 4
|
||||||
|
name_editboxes:
|
||||||
|
edit1 edit_box 200,10,7,0xffffff,0xbbddff,0,0,0,4095,dir_pach,mouse_dd,,0
|
||||||
|
name_editboxes_end:
|
||||||
|
|
||||||
|
;mouse_flag: dd 0x0
|
||||||
|
|
||||||
|
mouse_dd rd 1
|
||||||
|
;---------------------------------------------------------------------
|
||||||
;---------------------------------------------------------------------
|
;---------------------------------------------------------------------
|
||||||
features_table:
|
features_table:
|
||||||
.type_table:
|
.type_table:
|
||||||
|
@ -4,8 +4,8 @@ if not exist bin mkdir bin
|
|||||||
@fasm.exe -m 16384 ctrldemo.asm bin\ctrldemo.kex
|
@fasm.exe -m 16384 ctrldemo.asm bin\ctrldemo.kex
|
||||||
@kpack bin\ctrldemo.kex
|
@kpack bin\ctrldemo.kex
|
||||||
|
|
||||||
@fasm.exe -m 16384 OpenDial.asm bin\OpenDial.kex
|
@fasm.exe -m 16384 OpenDial.asm bin\OpenDial
|
||||||
@kpack bin\OpenDial.kex
|
@kpack bin\OpenDial
|
||||||
|
|
||||||
@copy reload_16x16_8b.png bin\reload_16x16_8b.png
|
@copy reload_16x16_8b.png bin\reload_16x16_8b.png
|
||||||
@copy cnv_png.obj bin\cnv_png.obj
|
@copy cnv_png.obj bin\cnv_png.obj
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
echo "lang fix en" > lang.inc
|
echo "lang fix en" > lang.inc
|
||||||
mkdir bin
|
mkdir bin
|
||||||
fasm -m 16384 ctrldemo.asm ./bin/ctrldemo.kex
|
fasm -m 16384 ctrldemo.asm ./bin/ctrldemo.kex
|
||||||
fasm -m 16384 OpenDial.asm ./bin/OpenDial.kex
|
fasm -m 16384 OpenDial.asm ./bin/OpenDial
|
||||||
fasm -m 16384 editbox_ex.asm ./bin/editbox_ex.kex
|
fasm -m 16384 editbox_ex.asm ./bin/editbox_ex.kex
|
||||||
rm -f lang.inc
|
rm -f lang.inc
|
||||||
cp reload_16x16_8b.png ./bin/reload_16x16_8b.png
|
cp reload_16x16_8b.png ./bin/reload_16x16_8b.png
|
||||||
|
@ -9,6 +9,7 @@ doc=3
|
|||||||
exc=3
|
exc=3
|
||||||
wtx=3
|
wtx=3
|
||||||
inf=3
|
inf=3
|
||||||
|
xml=3
|
||||||
jpg=6
|
jpg=6
|
||||||
jpe=6
|
jpe=6
|
||||||
jpeg=6
|
jpeg=6
|
||||||
@ -84,6 +85,9 @@ mpe=11
|
|||||||
mpeg=11
|
mpeg=11
|
||||||
flv=11
|
flv=11
|
||||||
3gp=11
|
3gp=11
|
||||||
|
mkv=11
|
||||||
|
wmv=11
|
||||||
|
mov=11
|
||||||
img=5
|
img=5
|
||||||
ima=5
|
ima=5
|
||||||
imz=5
|
imz=5
|
||||||
@ -122,7 +126,13 @@ chr=12
|
|||||||
mt=12
|
mt=12
|
||||||
htm=13
|
htm=13
|
||||||
html=13
|
html=13
|
||||||
|
mht=13
|
||||||
lif=14
|
lif=14
|
||||||
3ds=15
|
3ds=15
|
||||||
kex=16
|
kex=16
|
||||||
skn=17
|
skn=17
|
||||||
|
obj=18
|
||||||
|
dll=18
|
||||||
|
ocx=18
|
||||||
|
so=18
|
||||||
|
drv=18
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 5.0 KiB |
Loading…
Reference in New Issue
Block a user