2020-11-02 19:44:51 +01:00
|
|
|
proc @Kolibri@OpenFileDialog$qr23Kolibri@TOpenFileStruct uses ebx esi edi ebp
|
|
|
|
call @Kolibri@GetThreadData$qv
|
2011-01-28 14:00:06 +01:00
|
|
|
mov ebp,eax
|
|
|
|
mov ebx,[esp+20]
|
|
|
|
cmp dword [ebx+4],0
|
2020-11-02 19:44:51 +01:00
|
|
|
jnz .open_file_dlg_str
|
2011-01-28 14:00:06 +01:00
|
|
|
mov esi,7
|
2020-11-02 19:44:51 +01:00
|
|
|
jmp .open_file_dlg_alloc
|
|
|
|
.open_file_dlg_str:
|
2011-01-28 14:00:06 +01:00
|
|
|
cld
|
|
|
|
mov edi,[ebx+4]
|
|
|
|
mov ecx,-1
|
|
|
|
xor al,al
|
|
|
|
repnz scas byte [edi]
|
|
|
|
not ecx
|
|
|
|
mov esi,ecx
|
2020-11-02 19:44:51 +01:00
|
|
|
.open_file_dlg_alloc:
|
2011-01-28 14:00:06 +01:00
|
|
|
push esi
|
2020-11-02 19:44:51 +01:00
|
|
|
call @@Kolibri@Alloc$qui
|
2011-01-28 14:00:06 +01:00
|
|
|
pop ecx
|
|
|
|
test eax,eax
|
2020-11-02 19:44:51 +01:00
|
|
|
jz .open_file_dlg_ret
|
2011-01-28 14:00:06 +01:00
|
|
|
mov ecx,esi
|
|
|
|
dec ecx
|
|
|
|
push esi
|
|
|
|
push ecx
|
|
|
|
push eax
|
|
|
|
mov dword [ebx],-1
|
|
|
|
cmp dword [ebx+4],0
|
2020-11-02 19:44:51 +01:00
|
|
|
jnz .open_file_dlg_copy
|
2011-01-28 14:00:06 +01:00
|
|
|
mov dword [eax],0x2F64722F
|
|
|
|
mov word [eax+4],0x2F31
|
2020-11-02 19:44:51 +01:00
|
|
|
jmp .open_file_dlg_redraw
|
|
|
|
.open_file_dlg_copy:
|
2011-01-28 14:00:06 +01:00
|
|
|
cld
|
|
|
|
mov ecx,esi
|
|
|
|
mov esi,[ebx+4]
|
|
|
|
mov edi,eax
|
|
|
|
rep movs byte [edi],[esi]
|
2020-11-02 19:44:51 +01:00
|
|
|
.open_file_dlg_redraw:
|
2011-01-28 14:00:06 +01:00
|
|
|
mov eax,12
|
|
|
|
mov ebx,1
|
|
|
|
int 0x40
|
|
|
|
xor eax,eax
|
|
|
|
mov ebx,[ebp+MENUET_THREAD_DATA_X*4]
|
|
|
|
mov ecx,[ebp+MENUET_THREAD_DATA_Y*4]
|
|
|
|
mov edx,[ebp+MENUET_THREAD_DATA_C_WINDOW*4]
|
|
|
|
mov esi,[ebp+MENUET_THREAD_DATA_C_HEADER*4]
|
|
|
|
mov edi,[ebp+MENUET_THREAD_DATA_C_BORDER*4]
|
|
|
|
int 0x40
|
|
|
|
mov eax,4
|
|
|
|
mov ebx,0x00070007
|
|
|
|
mov ecx,[ebp+MENUET_THREAD_DATA_C_TITLE*4]
|
2020-11-02 19:44:51 +01:00
|
|
|
mov edx,Kolibri_open_file_dlg_name
|
|
|
|
mov esi,Kolibri_open_file_dlg_name_end - Kolibri_open_file_dlg_name
|
2011-01-28 14:00:06 +01:00
|
|
|
int 0x40
|
|
|
|
mov eax,4
|
|
|
|
mov ebx,0x000C001E
|
|
|
|
xor ecx,ecx
|
|
|
|
mov edx,[esp]
|
|
|
|
mov esi,[esp+4]
|
|
|
|
int 0x40
|
|
|
|
mov eax,12
|
|
|
|
mov ebx,2
|
|
|
|
int 0x40
|
2020-11-02 19:44:51 +01:00
|
|
|
.open_file_dlg_loop:
|
2011-01-28 14:00:06 +01:00
|
|
|
mov eax,10
|
|
|
|
int 0x40
|
|
|
|
dec eax
|
2020-11-02 19:44:51 +01:00
|
|
|
jz .open_file_dlg_redraw
|
2011-01-28 14:00:06 +01:00
|
|
|
dec eax
|
2020-11-02 19:44:51 +01:00
|
|
|
jz .open_file_dlg_key
|
2011-01-28 14:00:06 +01:00
|
|
|
dec eax
|
2020-11-02 19:44:51 +01:00
|
|
|
jz .open_file_dlg_end
|
|
|
|
jmp .open_file_dlg_loop
|
|
|
|
.open_file_dlg_key:
|
2011-01-28 14:00:06 +01:00
|
|
|
xor edi,edi
|
2020-11-02 19:44:51 +01:00
|
|
|
.open_file_dlg_key_loop:
|
2011-01-28 14:00:06 +01:00
|
|
|
mov eax,2
|
|
|
|
int 0x40
|
|
|
|
test al,al
|
2020-11-02 19:44:51 +01:00
|
|
|
jnz .open_file_dlg_key_end
|
2011-01-28 14:00:06 +01:00
|
|
|
cmp ah,27
|
2020-11-02 19:44:51 +01:00
|
|
|
jz .open_file_dlg_end
|
2011-01-28 14:00:06 +01:00
|
|
|
cmp ah,13
|
2020-11-02 19:44:51 +01:00
|
|
|
jz .open_file_dlg_apply
|
2011-01-28 14:00:06 +01:00
|
|
|
cmp ah,8
|
2020-11-02 19:44:51 +01:00
|
|
|
jz .open_file_dlg_key_bsp
|
2011-01-28 14:00:06 +01:00
|
|
|
cmp ah,32
|
2020-11-02 19:44:51 +01:00
|
|
|
jna .open_file_dlg_key_loop
|
2011-01-28 14:00:06 +01:00
|
|
|
mov ebx,[esp+4]
|
|
|
|
cmp ebx,[esp+8]
|
2020-11-02 19:44:51 +01:00
|
|
|
jb .open_file_dlg_key_any
|
2011-01-28 14:00:06 +01:00
|
|
|
lea esi,[ebx+2*ebx]
|
|
|
|
shr esi,1
|
|
|
|
inc esi
|
|
|
|
push eax
|
|
|
|
push esi
|
|
|
|
push dword [esp+8]
|
2020-11-02 19:44:51 +01:00
|
|
|
call @@Kolibri@ReAlloc$qpvui
|
2011-01-28 14:00:06 +01:00
|
|
|
add esp,8
|
|
|
|
mov ecx,eax
|
|
|
|
pop eax
|
|
|
|
test ecx,ecx
|
2020-11-02 19:44:51 +01:00
|
|
|
jz .open_file_dlg_key
|
2011-01-28 14:00:06 +01:00
|
|
|
mov [esp+8],esi
|
|
|
|
mov [esp],ecx
|
2020-11-02 19:44:51 +01:00
|
|
|
.open_file_dlg_key_any:
|
2011-01-28 14:00:06 +01:00
|
|
|
mov esi,ebx
|
|
|
|
add esi,[esp]
|
|
|
|
mov byte [esi],ah
|
|
|
|
inc ebx
|
|
|
|
mov edi,1
|
|
|
|
mov [esp+4],ebx
|
2020-11-02 19:44:51 +01:00
|
|
|
jmp .open_file_dlg_key_loop
|
|
|
|
.open_file_dlg_key_bsp:
|
2011-01-28 14:00:06 +01:00
|
|
|
mov eax,[esp+4]
|
|
|
|
test eax,eax
|
2020-11-02 19:44:51 +01:00
|
|
|
jz .open_file_dlg_key_loop
|
2011-01-28 14:00:06 +01:00
|
|
|
dec eax
|
|
|
|
mov edi,1
|
|
|
|
mov [esp+4],eax
|
2020-11-02 19:44:51 +01:00
|
|
|
jmp .open_file_dlg_key_loop
|
|
|
|
.open_file_dlg_key_end:
|
2011-01-28 14:00:06 +01:00
|
|
|
test edi,edi
|
2020-11-02 19:44:51 +01:00
|
|
|
jnz .open_file_dlg_redraw
|
|
|
|
jmp .open_file_dlg_loop
|
|
|
|
.open_file_dlg_apply:
|
2011-01-28 14:00:06 +01:00
|
|
|
mov eax,[esp+4]
|
|
|
|
inc eax
|
|
|
|
mov [esp+8],eax
|
|
|
|
push eax
|
|
|
|
push dword [esp+4]
|
2020-11-02 19:44:51 +01:00
|
|
|
call @@Kolibri@ReAlloc$qpvui
|
2011-01-28 14:00:06 +01:00
|
|
|
add esp,8
|
|
|
|
test eax,eax
|
2020-11-02 19:44:51 +01:00
|
|
|
jz .open_file_dlg_end
|
2011-01-28 14:00:06 +01:00
|
|
|
mov eax,[esp]
|
|
|
|
mov esi,eax
|
|
|
|
add eax,[esp+4]
|
|
|
|
mov byte [eax],0
|
|
|
|
add esp,12
|
|
|
|
mov ebx,[esp+20]
|
|
|
|
mov dword [ebx],2
|
|
|
|
push dword [ebx+4]
|
2020-11-02 19:44:51 +01:00
|
|
|
call @@Kolibri@Free$qpv
|
2011-01-28 14:00:06 +01:00
|
|
|
pop ecx
|
|
|
|
mov [ebx+4],esi
|
2020-11-02 19:44:51 +01:00
|
|
|
jmp .open_file_dlg_invalidate
|
|
|
|
.open_file_dlg_end:
|
|
|
|
call @@Kolibri@Free$qpv
|
2011-01-28 14:00:06 +01:00
|
|
|
add esp,12
|
|
|
|
mov ebx,[esp+20]
|
|
|
|
mov dword [ebx],1
|
2020-11-02 19:44:51 +01:00
|
|
|
.open_file_dlg_invalidate:
|
2011-01-28 14:00:06 +01:00
|
|
|
push ebp
|
|
|
|
push dword 1
|
2020-11-02 19:44:51 +01:00
|
|
|
call @@Kolibri@Invalidate$qippv
|
2011-01-28 14:00:06 +01:00
|
|
|
add esp,8
|
2020-11-02 19:44:51 +01:00
|
|
|
.open_file_dlg_ret:
|
2011-01-28 14:00:06 +01:00
|
|
|
ret
|
2020-11-02 19:44:51 +01:00
|
|
|
endp
|
|
|
|
|
|
|
|
Kolibri_open_file_dlg_name:
|
2011-01-28 14:00:06 +01:00
|
|
|
db 'Open file'
|
2020-11-02 19:44:51 +01:00
|
|
|
Kolibri_open_file_dlg_name_end:
|
|
|
|
|