From f8c3f541523f53708ccc4f90e9801a119e884f8f Mon Sep 17 00:00:00 2001 From: IgorA Date: Thu, 27 May 2010 15:30:32 +0000 Subject: [PATCH] element 'OpenDialog' get from '/rd/1/File managers/' in programs 't_edit', 'planet_v' git-svn-id: svn://kolibrios.org@1468 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/other/planet_v/planet_v.asm | 4 ++-- programs/other/t_edit/t_button.inc | 34 +++++++++++++++++++++++++++- programs/other/t_edit/t_data.inc | 12 +++++++--- 3 files changed, 44 insertions(+), 6 deletions(-) diff --git a/programs/other/planet_v/planet_v.asm b/programs/other/planet_v/planet_v.asm index 5d6554cc8d..48bc0262f5 100644 --- a/programs/other/planet_v/planet_v.asm +++ b/programs/other/planet_v/planet_v.asm @@ -848,7 +848,7 @@ endp align 4 fun_opn_dlg: ;функция для вызова OpenFile диалога pushad - copy_path open_dialog_name,sys_path,file_name,0 + copy_path open_dialog_name,communication_area_default_path,file_name,0 mov [OpenDialog_data.type],2 mov dword[plugin_path],0 ;что-бы при открытии диалогового окна путь всегда брался из OpenDialog_data.dir_default_path start_OpenDialog OpenDialog_data @@ -969,7 +969,7 @@ communication_area_name: open_dialog_name: db 'opendial',0 communication_area_default_path: - db '/rd/1',0 + db '/rd/1/File managers/',0 Filter: dd Filter.end - Filter.1 diff --git a/programs/other/t_edit/t_button.inc b/programs/other/t_edit/t_button.inc index 954753c5f8..248b34a820 100644 --- a/programs/other/t_edit/t_button.inc +++ b/programs/other/t_edit/t_button.inc @@ -136,11 +136,19 @@ ted_but_open_file: jmp .ret_f @@: - copy_path open_dialog_name,sys_path,file_name,0 + copy_path open_dialog_name,communication_area_default_path,file_name,0 mov [OpenDialog_data.type],0 start_OpenDialog OpenDialog_data cmp [OpenDialog_data.status],2 jne @f + stdcall mem_spac, msgbox_9.fdp,100 + mov esi,file_name + call strlen + cmp eax,100 + jle .no_crop + mov eax,100 + .no_crop: + stdcall mem_copy, esi,msgbox_9.fdp,eax stdcall [mb_create],msgbox_9,thread ;message: error run 'open file dialog' jmp .ret_f @@: @@ -155,6 +163,30 @@ ted_but_open_file: popad ret +align 4 +proc mem_copy, source:dword, destination:dword, len:dword + push ecx esi edi + cld + mov esi, dword[source] + mov edi, dword[destination] + mov ecx, dword[len] + rep movsb + pop edi esi ecx + ret +endp + +align 4 +proc mem_spac, mem:dword, len:dword + push eax ecx edi + cld + mov al,' ' + mov edi, dword[mem] + mov ecx, dword[len] + repne stosb + pop edi ecx eax + ret +endp + ;input: ; eax = код ошибки ; ebx = колличество прочитанных байт diff --git a/programs/other/t_edit/t_data.inc b/programs/other/t_edit/t_data.inc index d3cdf1e54c..4178dcbe8d 100644 --- a/programs/other/t_edit/t_data.inc +++ b/programs/other/t_edit/t_data.inc @@ -335,7 +335,7 @@ communication_area_name: open_dialog_name: db 'opendial',0 communication_area_default_path: - db '/rd/1',0 + db '/rd/1/File managers/',0 Filter: dd Filter.end - Filter.1 @@ -542,7 +542,10 @@ msgbox_8: msgbox_9: db 3,0 db 'Внимание',0 - db 'Не открылся ',39,'диалог открытия файла.',39,0 + db 'Не открылся ',39,'диалог открытия файла',39,'.',13 + .fdp: + rb 100 + db 0 db 'Закрыть',0 db 0 @@ -647,7 +650,10 @@ msgbox_8: msgbox_9: db 3,0 db 'Warning',0 - db 'Error run ',39,'open file dialog',39,0 + db 'Error run ',39,'open file dialog',39,'.',13 + .fdp: + rb 100 + db 0 db 'Close',0 db 0