Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 1466 → Rev 1467

/programs/other/t_edit/readme.htm
48,7 → 48,7
</head>
 
<body>
<h1>TextEditor âåðñèÿ îò 29.04.2010</h1>
<h1>TextEditor âåðñèÿ îò 27.05.2010</h1>
<h2>Î ïðîãðàììå</h2>
<p>Ïðîãðàììà äëÿ ðàáîòû ñ òåêñòîâûìè ôàéëàìè.
Ëèöåíçèÿ ñâîáîäíàÿ.</p>
77,7 → 77,7
<tr><td>Ìíîãîêðàòíàÿ îòìåíà/ïîâòîð äåéñòâèé</td>
<td>íåò</td><td>åñòü</td></tr>
<tr><td>Îãðàíè÷åíèÿ íà ðàçìåð ôàéëîâ</td>
<td>íåò</td><td>åñòü</td></tr>
<td>íåò</td><td>åñòü ïðè îòêðûòèè ôàéëîâ, ïðè ðåäàêòèðîâàíèè íåò</td></tr>
</table>
 
<h2>Íåêîòîðûå íåäîðàáîòêè</h2>
147,7 → 147,7
<ul>
<li>Åâòèõîâ Ìàêñèì (Maxxxx32) - ýëåìåíò EditBox.</li>
<li>Àëåêñåé Òåïëîâ (Lrz) - ýëåìåíò EditBox, ìàêðîñ load_library.</li>
<li>Mario79 - ýëåìåíò ñêðîëëèíã.</li>
<li>Mario79 - ýëåìåíòû: ñêðîëëèíãè, ìåíþ, OpenDial.</li>
<li>Diamond - çà ïðîãðàììó KlbrInWin, è ïîìîùü ïðè íàïèñàíèè ïðîãðàììû.</li>
<li>Insolor - çà òåñòèðîâàíèå ïðîãðàììû íà îøèáêè.</li>
<li>Leency è äðóãèì, êòî ïîìîãàë íà ôîðóìå ñîâåòàìè.</li>
/programs/other/t_edit/strlen.inc
28,8 → 28,7
; destroys : nothing
;********************************************************************
strlen:
push ecx
push edi
push ecx edi
pushfd
cld ; !
mov ecx,-1
40,8 → 39,7
sub eax,esi
dec eax
popfd
pop edi
pop ecx
pop edi ecx
ret
 
 
51,8 → 49,7
; Copyright (c) 2009 Igor Afanasiev
 
linlen:
push ecx
push edi
push ecx edi
pushfd
cld ; !
mov ecx,eax
64,8 → 61,7
sub eax,esi
dec eax
popfd
pop edi
pop ecx
pop edi ecx
ret
;%endif
 
/programs/other/t_edit/t_button.inc
26,7 → 26,7
ends
 
 
hed db 'TextEditor 17.05.10',0 ;¯®¤¯¨áì ®ª­ 
hed db 'TextEditor 27.05.10',0 ;¯®¤¯¨áì ®ª­ 
sc system_colors
 
fn_icon db 'te_icon.bmp',0
126,7 → 126,8
; äã­ªæ¨ï ®âªàëâ¨ï ä ©«  á ¢®§¬®¦­ë¬ ®ª­®¬ á®®¡é¥­¨ï (® ¢®§¬®¦­®á⨠®â¬¥­¨âì ®âªàë⨥)
align 4
ted_but_open_file:
push eax ebx
pushad
 
stdcall [ted_can_save], tedit0
cmp al,1
jne @f
134,10 → 135,24
stdcall [mb_setfunctions],msgbox_5_funct
jmp .ret_f
@@:
 
copy_path open_dialog_name,sys_path,file_name,0
mov [OpenDialog_data.type],0
start_OpenDialog OpenDialog_data
cmp [OpenDialog_data.status],2
jne @f
stdcall [mb_create],msgbox_9,thread ;message: error run 'open file dialog'
jmp .ret_f
@@:
mov esi,[OpenDialog_data.openfile_path]
call strlen
mov [edit1.size],eax
mov [edit1.pos],eax
stdcall [edit_box_draw], edit1
stdcall [ted_open_file], tedit0,run_file_70,[edit1.text]
call ted_messages_after_open_file
.ret_f:
pop ebx eax
popad
ret
 
;input:
/programs/other/t_edit/t_data.inc
1,4 → 1,3
;--- äàííûå ïðîãðàììû ----------------------------------------------
fn_col_option dd def_col_file
fn_syntax_dir db 'info/',0
def_col_file db 'default.syn',0
11,19 → 10,7
 
fn_icon_tl_sys db 'tl_sys_16.bmp',0
fn_icon_tl_nod db 'tl_nod_16.bmp',0
;---------------------------------------------------------------------
fileinfo:
dd 5
dd 0
dd 0
dd 0
dd file_info
string:
db 0
dd file_name
 
;plugin dd 0
 
;---------------------------------------------------------------------
align 4
myimport:
97,7 → 84,7
ted_but_reverse dd sz_ted_but_reverse
ted_but_find_next dd sz_ted_but_find_next
ted_text_colored dd sz_ted_text_colored
;;;version_text_edit dd sz_ted_version
;version_text_edit dd sz_ted_version
 
dd 0,0
 
171,7 → 158,7
sz_ted_but_reverse db 'ted_but_reverse',0
sz_ted_but_find_next db 'ted_but_find_next',0
sz_ted_text_colored db 'ted_text_colored',0
;;;sz_ted_version db 'version_text_edit',0
;sz_ted_version db 'version_text_edit',0
;--------------------------------------------------
align 4
msgbox_lib_import:
252,7 → 239,7
.ar_offset dd 1 ;+84
;---------------------------------------------------------------------
align 4
ws_dir_lbox: ;äî÷åðíèé ñêðîëëèíã äëÿ ýëåìåíòà ListBox
ws_dir_lbox: ;¤®ç¥à­¨© áªà®««¨­£ ¤«ï í«¥¬¥­â  ListBox
.x:
.size_x dw 16 ;+0
.start_x dw 0 ;+2
326,14 → 313,50
.font_height dd 8 ;+108
.cursor_out dd 0 ;+112
.get_mouse_flag dd 0 ;+116
;-------------------------
 
;---------------------------------------------------------------------
align 4
OpenDialog_data:
.type dd 0
.procinfo dd procinfo ;+4
.com_area_name dd communication_area_name ;+8
.com_area dd 0 ;+12
.opendir_path dd plugin_path ;+16
.dir_default_path dd openfile_path ;+20
.start_path dd file_name ;+24 ¯ãâì ª ¤¨ «®£ã ®âªàëâ¨ï ä ©«®¢
.draw_window dd draw_window ;+28
.status dd 0 ;+32
.openfile_path dd openfile_path ;+36 ¯ãâì ª ®âªà뢠¥¬®¬ã ä ©«ã
.filename_area dd filename_area ;+40
.filter_area dd Filter
 
communication_area_name:
db 'FFFFFFFF_open_dialog',0
open_dialog_name:
db 'opendial',0
communication_area_default_path:
db '/rd/1',0
 
Filter:
dd Filter.end - Filter.1
.1:
db 'ASM',0
db 'CPP',0
db 'INC',0
db 'INI',0
db 'TXT',0
db 'H',0
db 'HTM',0
db 'HTML',0
.end:
db 0
 
TED_PANEL_NULL equ 0 ;­¥â ®âªàë⮩ ¯ ­¥«¨
TED_PANEL_FIND equ 1 ;¯ ­¥«ì ¯®¨áª 
TED_PANEL_SYNTAX equ 2 ;¯ ­¥«ì ¢ë¡®à  ä ©«®¢ ¯®¤á¢¥âª¨
TED_PANEL_WIDTH equ 150 ;è¨à¨­  ¯ ­¥«¨
 
count_of_dir_list_files equ 15
count_of_dir_list_files equ 15 ;¬ ªá¨¬ «ì­®¥ ç¨á«® ä ©«®¢ ᨭ⠪á¨á  ¯®ª §ë¢ ¥¬ëå ¢ ®ª­¥ í«¥¬¥­â  tree1
 
;------------------------------------------------------------------------------
struct TexSelect
436,7 → 459,6
.end:
db 0
 
;--------
msgbox_1:
dw 0
db '‚­¨¬ ­¨¥',0 ;+2 = +MB_TEXT_OFFSET
447,7 → 469,7
db 0
msgbox_2:
db 3,0
db '‚­¨¬ ­¨¥',0 ;+2 = +MB_TEXT_OFFSET
db '‚­¨¬ ­¨¥',0
db '‘®åà ­¨âì ¨§¬¥­¥­¨ï ¢ ä ©«¥?',0
db '‘®åà ­¨âì',0
db '¥ á®åà ­ïâì',0
460,7 → 482,7
 
msgbox_3:
db 1,0
db '‚­¨¬ ­¨¥',0 ;+2 = +MB_TEXT_OFFSET
db '‚­¨¬ ­¨¥',0
db 'Žè¨¡ª  ¯à¨ ®âªàë⨨ ä ©«  á 梥⮢묨 ­ áâனª ¬¨!',13,\
'®â®¬ã ¢ë¤¥«¥­¨¥ á«®¢ 梥⮬ ­¥ ¢®§¬®¦­®.',13,\
' (ª®¤ ®è¨¡ª¨ ='
471,7 → 493,7
 
msgbox_4:
db 1,0
db '‚­¨¬ ­¨¥',0 ;+2 = +MB_TEXT_OFFSET
db '‚­¨¬ ­¨¥',0
db 'Žè¨¡ª  ¯à¨ ®âªàë⨨ ä ©« !',13,\
'‚®§¬®¦­® ¨¬ï ä ©«  ¢¢¥¤¥­® ­¥ ¯à ¢¨«ì­®.',13,\
' (ª®¤ ®è¨¡ª¨ ='
482,7 → 504,7
 
msgbox_5:
db 3,0
db '‚­¨¬ ­¨¥',0 ;+2 = +MB_TEXT_OFFSET
db '‚­¨¬ ­¨¥',0
db '‘®åà ­¨âì ¨§¬¥­¥­¨ï ¢ ä ©«¥?',0
db '¥ á®åà ­ïâì',0
db 'Žâ¬¥­ ',0
493,7 → 515,7
 
msgbox_6:
db 1,0
db '‚­¨¬ ­¨¥',0 ;+2 = +MB_TEXT_OFFSET
db '‚­¨¬ ­¨¥',0
db 'Žè¨¡ª  ¯à¨ á®åà ­¥­¨¨ ä ©« !',13,\
'‚®§¬®¦­® ¨¬ï ä ©«  ¢¢¥¤¥­® ­¥ ¯à ¢¨«ì­®.',13,\
' (ª®¤ ®è¨¡ª¨ ='
503,7 → 525,7
db 0
msgbox_7:
db 1,0
db '’¥ªáâ ­¥ ­ ©¤¥­',0 ;+2 = +MB_TEXT_OFFSET
db '’¥ªáâ ­¥ ­ ©¤¥­',0
db '„®á⨣­ãâ ª®­¥æ ¤®ªã¬¥­â .',13,\
'®¯à®¡ã©â¥ ¯¥à¥©â¨ ¢ ­ ç «® ¤®ªã¬¥­â ',13,\
'¨«¨ ¨§¬¥­¨âì § ¯à®á ¨ ¯®¢â®à¨âì ¯®¨áª.',0
511,13 → 533,20
db 0
msgbox_8:
db 3,0
db '‚­¨¬ ­¨¥',0 ;+2 = +MB_TEXT_OFFSET
db '‚­¨¬ ­¨¥',0
db '„«ï ¢ë室  § ¢¥àè¨â¥ à ¡®âã á ä ©«®¬.',13,\
'®¯à®¡ã©â¥ á®åà ­¨âì ¨§¬¥­¥­¨ï ¢ ä ©«¥',13,\
'¨«¨ ­ ç âì ­®¢ë© ¯ãá⮩.',0
db 'Žâ¬¥­ ',0
db 0
msgbox_9:
db 3,0
db '‚­¨¬ ­¨¥',0
db '¥ ®âªàë«áï ',39,'¤¨ «®£ ®âªàëâ¨ï ä ©« .',39,0
db '‡ ªàëâì',0
db 0
 
txtFile db '” ©«:',0
txtFindCapt db '®¨áª',0
txtFindNext db ' ©â¨ ¤ «¥¥',0
txtFormatCapt db '”®à¬ â',0
535,7 → 564,6
.end:
db 0
 
;--------
msgbox_1:
dw 0
db 'Warning',0 ;+2 = +MB_TEXT_OFFSET
546,7 → 574,7
db 0
msgbox_2:
db 3,0
db 'Warning',0 ;+2 = +MB_TEXT_OFFSET
db 'Warning',0
db 'Save changes to the file?',0
db 'Save',0
db 'Discard',0
559,7 → 587,7
 
msgbox_3:
db 1,0
db 'Warning',0 ;+2 = +MB_TEXT_OFFSET
db 'Warning',0
db 'Error opening the file with the color settings!',13,\
'Because color selection of words is not possible.',13,\
' (error code ='
570,7 → 598,7
 
msgbox_4:
db 1,0
db 'Warning',0 ;+2 = +MB_TEXT_OFFSET
db 'Warning',0
db 'Error opening file!',13,\
'Maybe the file name is not entered correctly.',13,\
' (error code ='
581,7 → 609,7
 
msgbox_5:
db 3,0
db 'Warning',0 ;+2 = +MB_TEXT_OFFSET
db 'Warning',0
db 'Save changes to the file?',0
db 'Discard',0
db 'Cancel',0
592,7 → 620,7
 
msgbox_6:
db 1,0
db 'Warning',0 ;+2 = +MB_TEXT_OFFSET
db 'Warning',0
db 'Error saving file!',13,\
'Maybe the file name is not entered correctly.',13,\
' (error code ='
602,7 → 630,7
db 0
msgbox_7:
db 1,0
db 'Text not found.',0 ;+2 = +MB_TEXT_OFFSET
db 'Text not found.',0
db 'Reached end of the document.',13,\
'Try to go to the beginning of the document',13,\
'or change the query and search again.',0
610,13 → 638,20
db 0
msgbox_8:
db 3,0
db 'Warning',0 ;+2 = +MB_TEXT_OFFSET
db 'Warning',0
db 'To quit, quit the file.',13,\
'Try to keep changes to a file',13,\
'or start a new blank file.',0
db 'Cancel',0
db 0
msgbox_9:
db 3,0
db 'Warning',0
db 'Error run ',39,'open file dialog',39,0
db 'Close',0
db 0
 
txtFile db 'File:',0
txtFindCapt db 'Search',0
txtFindNext db 'Find next',0
txtFormatCapt db 'Format',0
623,7 → 658,6
txtFormatApply db 'Apply',0
 
end if
;------
 
KM_SHIFT equ 0x00010000
KM_CTRL equ 0x00020000
/programs/other/t_edit/t_edit.asm
25,6 → 25,9
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
 
include 'lang.inc'
include '../../develop/libraries/box_lib/asm/trunk/opendial.mac'
use_OpenDialog
 
include 't_data.inc'
include 'strlen.inc'
include 't_draw.inc' ;draw main window functions
47,7 → 50,7
mov esi,file_name
call strlen
mov ecx,eax
mov edi,buf_cmd_lin
mov edi,openfile_path
rep movsb ;ª®¯¨à㥬 ¨¬ï ä ©«  ¢ ¡ãä¥à edit1
 
load_libraries l_libs_start,load_lib_end
67,8 → 70,10
;---------------------------------------------------------------------
stdcall [ted_init], tedit0
stdcall dword[tl_data_init], tree1
;---------------------------------------------------------------------
 
; OpenDialog initialisation
init_OpenDialog OpenDialog_data
 
; init bmp file
mov ecx,1200*18
call mem_Alloc
170,9 → 175,9
stdcall [ted_init_syntax_file], tedit0,run_file_70,file_name
 
;--- get cmd line ---
cmp byte[buf_cmd_lin+3],0 ;buf_cmd_lin
cmp byte[openfile_path+3],0 ;openfile_path
je @f ;if file names exist
mov esi,buf_cmd_lin
mov esi,openfile_path
call strlen ;eax=strlen
mov [edit1.size],eax
call but_no_msg_OpenFile
180,11 → 185,31
 
align 4
red_win:
call draw_window
 
align 4
still:
mov eax,10
mcall
 
cmp al,1 ;¨§¬. ¯®«®¦¥­¨¥ ®ª­ 
jz red_win
cmp al,2
jz key
cmp al,3
jz button
cmp al,6
jz mouse
 
jmp still
 
align 4
draw_window:
mcall 12,1
 
xor eax,eax
mov ebx,10*65536+485
mov ecx,10*65536+280
mov ecx,10*65536+320
mov edx,[sc.work]
or edx,0x73000000
mov edi,hed
202,6 → 227,13
inc bx
int 0x40
 
mov eax,4
mov ebx,185*65536+9
mov ecx,[sc.work_text]
or ecx,0x80000000
mov edx,txtFile
int 0x40
 
stdcall [edit_box_draw], dword edit1
stdcall [menu_bar_draw], dword menu_data_1
 
231,25 → 263,9
@@:
 
mcall 12,2
ret
 
align 4
still:
mov eax,10
mcall
 
cmp al,1 ;¨§¬. ¯®«®¦¥­¨¥ ®ª­ 
jz red_win
cmp al,2
jz key
cmp al,3
jz button
cmp al,6
jz mouse
 
jmp still
 
 
align 4
mouse:
stdcall [edit_box_mouse], dword edit1
 
490,10 → 506,9
txtErrIni0 db '¥ ®âªàë«áï ä ©« á ¨ª®­ª ¬¨',0
err_ini0 db 0
 
edit1 edit_box 250, 220, 5, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 300, buf_cmd_lin, mouse_dd, 0
edit1 edit_box 250, 220, 5, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 4090, openfile_path, mouse_dd, 0
edit2 edit_box TED_PANEL_WIDTH-1, 0, 20, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 300, buf_find, mouse_dd, 0
 
buf_cmd_lin db 302 dup(0)
buf_find db 302 dup(0)
 
if lang eq ru
522,6 → 537,7
 
 
i_end:
rb 1024
align 16
procinfo process_information
thread:
533,6 → 549,12
rb 4096
file_name_rez:
rb 4096
plugin_path:
rb 4096
openfile_path:
rb 4096
filename_area:
rb 256
file_info:
rb 40
mem: