't_edit' use libimg.obj (need for load *.png files)

'log_el' add new elements 'ms[2]', 'ms[2]e'

git-svn-id: svn://kolibrios.org@2632 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA 2012-04-19 14:29:46 +00:00
parent efbefc84b9
commit 7659f0b42a
15 changed files with 400 additions and 152 deletions

File diff suppressed because one or more lines are too long

View File

@ -17,6 +17,8 @@ color_s2 equ 0xff00 ;
color_s3 equ 0xff0000 ;¢à¥¬¥­­®¥ §­ ç¥­¨¥ ¤«ï á®åà ­¥­¨ï
color_border dd ini_def_c_border
opt_sign_moves dd 4
opt_fast_mode dd 0 ;¡ëáâàë© à¥¦¨¬
debug equ 0
@ -52,7 +54,7 @@ include 'le_pole.inc'
include 'le_signal.inc'
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
caption db '‹®£¨ç¥áª¨¥ í«¥¬¥­âë 05.04.12',0 ;¯®¤¯¨áì ®ª­ 
caption db '‹®£¨ç¥áª¨¥ í«¥¬¥­âë 19.04.12',0 ;¯®¤¯¨áì ®ª­ 
panel_0_coord_top equ 5 ;¢¥àå­ïï ª®®à¤¨­ â  0-£® à鸞 ¯ ­¥«¨ ¨­áâà㬥­â®¢
panel_1_coord_top equ 35
@ -89,8 +91,8 @@ ends
macro elOpt nam,col,box_x,box_y,table, tbl_i_legs, ol0, ol1, ol2
{
@@: db nam
rb @b+16-$
@@: db nam,0
rb @b+el_offs_col-$
dd col
db box_x
db box_y
@ -112,6 +114,8 @@ elOpt 'and[5]',0xffff00,5,11,tbl_and.5, tbl_il_5, 5
elOpt 'not', 0xffff, 3,3,tbl_not, tbl_il_1, 1
elOpt 'xor', 0x8000ff,5,5,tbl_xor, tbl_il_2, 2
elOpt 'sm[1]', 0x8080ff,7,7,tbl_sm, tbl_il_3, 1,4
elOpt 'ms[2]', 0x8080ff,7,14,tbl_ms_2, tbl_il_m2,6
elOpt 'ms[2]e',0x8080ff,7,17,tbl_ms_2_e,tbl_il_m2e,8
;elOpt 'cd[8]', 0x8000, 7,17,tbl_cd_8,tbl_il_8, 6,2,2 ;è¨äà â®à ­  8 ¢å®¤®¢
.end:
elOpt '???', 0x808080,3,3,tbl_and.3, tbl_il_1, 1 ;­¥ ®¯®§­ ­­ë© í«¥¬¥­â
@ -128,6 +132,20 @@ tbl_and:
tbl_xor db 0,1,1,0
tbl_sm db 0,2,2,1, 2,1,1,3
tbl_not db 1,0 ;not
;¬ã«ì⨯«¥ªá®à ¤«ï 2-å à §à來®£® ᨣ­ « 
align 4
tbl_ms_2_e: ;á® ¢å®¤®¬ 'e'
dq 0,0,0,0,0,0,0,0
tbl_ms_2:
db 0,1,0,1,0,1,0,1
db 0,1,0,1,0,1,0,1
db 0,0,1,1,0,0,1,1
db 0,0,1,1,0,0,1,1
db 0,0,0,0,1,1,1,1
db 0,0,0,0,1,1,1,1
dq 0
db 1,1,1,1,1,1,1,1
;tbl_cd_8 db ;256=2^8
;â ¡«¨æë ¤«ï ¢å®¤­ëå ­®£
@ -136,6 +154,8 @@ tbl_il_2 db 1,2,0 ;
tbl_il_3 db 1,2,2,0
tbl_il_4 db 1,2,2,2,0
tbl_il_5 db 1,2,2,2,2,0
tbl_il_m2 db 1,2,2,2,3,2,0
tbl_il_m2e db 1,2,2,2,3,2,3,0
;tbl_il_8 db 1,2,2,2,2,2,2,2,0
time dd 0
@ -227,6 +247,9 @@ key_color_s0 db 's0',0
key_color_s1 db 's1',0
key_color_s2 db 's2',0
key_color_captions db 'captions',0
ini_sec_options db 'Options',0
key_opt_sign_moves db 'signal_moves',0
key_opt_fast_mode db 'fast_mode',0
align 4
start:
@ -244,17 +267,17 @@ start:
copy_path ini_name,sys_path,file_name,0x0
stdcall dword[ini_get_color],file_name,ini_sec_color,key_color_bkgnd,ini_def_c_bkgnd
mov dword[buf_0.color],eax
mov dword[buf_0.color],eax
stdcall dword[ini_get_color],file_name,ini_sec_color,key_color_border,ini_def_c_border
mov dword[color_border],eax
mov dword[color_border],eax
stdcall dword[ini_get_color],file_name,ini_sec_color,key_color_s0,color_s0
mov dword[shem_colors],eax
mov dword[shem_colors],eax
stdcall dword[ini_get_color],file_name,ini_sec_color,key_color_s1,color_s1
mov dword[shem_colors+4],eax
mov dword[shem_colors+4],eax
stdcall dword[ini_get_color],file_name,ini_sec_color,key_color_s2,color_s2
mov dword[shem_colors+8],eax
mov dword[shem_colors+8],eax
stdcall dword[ini_get_color],file_name,ini_sec_color,key_color_captions,[color_captions]
mov dword[color_captions],eax
mov dword[color_captions],eax
mov ebx,el_opt_beg+el_offs_nam
mov ecx,(el_opt_beg.end-el_opt_beg)/size_el_opt ;ª®««¨ç¥á⢮ ⨯®¢ í«¥¬¥­â®¢
@ -263,10 +286,15 @@ start:
push ecx
stdcall dword[ini_get_color],file_name,ini_sec_color,ebx,[ebx+el_offs_col-el_offs_nam]
pop ecx
mov dword[ebx+el_offs_col-el_offs_nam],eax
mov dword[ebx+el_offs_col-el_offs_nam],eax
add ebx,size_el_opt
loop @b
stdcall dword[ini_get_int],file_name,ini_sec_options,key_opt_sign_moves,[opt_sign_moves]
mov dword[opt_sign_moves],eax
stdcall dword[ini_get_int],file_name,ini_sec_options,key_opt_fast_mode,[opt_fast_mode]
mov dword[opt_fast_mode],eax
;*** ¯®¤£®â®¢ª  ¤¨ «®£ 
stdcall [OpenDialog_Init],OpenDialog_data
stdcall [buf2d_create], buf_0 ;ᮧ¤ ­¨¥ ¡ãä¥à 
@ -367,12 +395,27 @@ timer_funct:
cmp byte[tim_ch],0
je @f
inc dword[time]
cmp dword[opt_fast_mode],0
jne .fast_m
call sign_move
stdcall [buf2d_draw], buf_0
mov eax,[time]
and eax,11b ;ªà â­®áâì 4-¬
xor edx,edx
div dword[opt_sign_moves]
cmp edx,0 ;¯à®¢¥à塞 ªà â­®áâì opt_sign_moves
jnz @f
call sign_from_elems
call sign_from_captions
jmp @f
.fast_m:
mov ecx,[opt_sign_moves]
cld
.cycle:
call sign_move
loop .cycle
call sign_from_elems
call sign_from_captions
stdcall [buf2d_draw], buf_0
@@:
popad
@ -1088,8 +1131,8 @@ but_open_file:
copy_path open_dialog_name,communication_area_default_path,file_name,0
mov [OpenDialog_data.type],0
stdcall [OpenDialog_Start],OpenDialog_data
cmp [OpenDialog_data.status],2
je .end_open_file
cmp [OpenDialog_data.status],1 ;0 - Cancel 1 - Open 2 - Error open dialog
jne .end_open_file
;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
@ -1162,7 +1205,7 @@ but_open_file:
mov byte[txt_buf+sp_offs_el_angle],al ;­ ¯à ¢«¥­¨¥
call str_next_val
;¯®  ¤à¥áã edi ­ §¢ ­¨¥ í«¥¬¥­â 
stdcall el_get_name, edi
stdcall el_get_name, edi,13 ;13 - ascii code
mov byte[txt_buf+sp_offs_el_type],al ;⨯ í«¥¬¥­â 
stdcall make_list_capts,txt_buf,edi
@ -1877,7 +1920,7 @@ proc shem_element_creat uses eax ebx, coord_x:dword, coord_y:dword
jnz @f
mov ebx,el_opt_beg+el_offs_nam ;¥á«¨ ­¥ ¢§ï«®áì ¨¬ï í«¥¬¥­â , â® ¯® 㬮«ç ­¨î ¡¥à¥¬ 1-© ¨§ ᯨ᪠
@@:
stdcall el_get_name, ebx
stdcall el_get_name, ebx,0
mov byte[txt_buf+sp_offs_el_type],al ;⨯ í«¥¬¥­â 
stdcall make_list_capts,txt_buf,ebx
@ -1888,15 +1931,32 @@ proc shem_element_creat uses eax ebx, coord_x:dword, coord_y:dword
ret
endp
;description:
;  ­ «¨§¨àã¥â áâபã á ¨¬¥­¥¬ «®£. í«¥¬¥­â  ¨ ¢®§¢à é ¥â ­®¬¥à «®£. í«¥¬¥­â 
;input:
; str - 㪠§ â¥«ì ­  áâபã ᮤ¥à¦ éãî ¨¬ï «®£. í«¥¬¥­â 
; asciiz - ᨬ¢®« ª®â®àë© ¤®«¦¥­ ¡ëâì § ¬¥­¥­ ­  ascii 0
;output:
; eax - ⨯ í«¥¬¥­â 
align 4
proc el_get_name uses ecx edi esi, str:dword
proc el_get_name uses ebx ecx edi esi, str:dword, asciiz:dword
mov edi,[str]
cmp dword[asciiz],0
je @f
mov eax,dword[asciiz]
mov ecx,el_offs_col ;à §¬¥à ⥪áâ  ¢ str ­¥ ¡®«ìè¥ el_offs_col
cld
repne scasb
mov ebx,edi
dec ebx
mov byte[ebx],0 ;0 - ᨬ¢®« ª®­æ  áâப¨ ¤«ï ¯à ¢¨«ì­®© à ¡®âë str_cmp
@@:
mov edi,[str]
mov esi,el_opt_beg+el_offs_nam
xor ecx,ecx
@@:
stdcall str_instr, edi,esi
stdcall str_cmp, edi,esi
cmp eax,0
je @f
add esi,size_el_opt
@ -1906,6 +1966,12 @@ proc el_get_name uses ecx edi esi, str:dword
jmp @b
@@:
mov eax,ecx
cmp dword[asciiz],0
je @f
mov ecx,dword[asciiz]
mov byte[ebx],cl
@@:
ret
endp
@ -2124,6 +2190,31 @@ proc str_instr uses edi esi, str0:dword, str1:dword
ret
endp
;description:
; ¯à®¢¥àï¥â ᮢ¯ ¤¥­¨¥ áâப str0 ¨ str1
;output:
; eax = 0 ¥á«¨ str0 = str1
; eax = 1 ¥á«¨ str0 != str1
align 4
proc str_cmp uses ecx edi esi, str0:dword, str1:dword
xor eax,eax
mov edi,[str0]
mov esi,[str1]
mov ecx,0x8fffffff ;ecx - ®ç¥­ì ¡®«ì讥 ç¨á«®
cld
repne scasb
;dec edi
sub edi,[str0]
mov ecx,edi ;ecx = strlen(str0)+1
mov edi,[str0]
repe cmpsb
je @f
inc eax
@@:
ret
endp
align 4
proc but_run_stop
xor byte[tim_ch],1

View File

@ -15,3 +15,6 @@ and[2]=192,0,192
and[3]=192,0,192
and[4]=192,0,192
and[5]=192,0,192
[Options]
signal_moves=4
fast_mode=0

View File

@ -0,0 +1,18 @@
size 90 80
elements 1
44 33 0 ms[2]e
captions 7
15 10 z d0
15 20 z d1
15 30 z d2
15 40 z d3
15 50 z s0
15 60 z s1
15 70 o e
points 28
15 10 1 15 20 1 15 30 1 15 40 1 15 50 1 15 60 1 15 70 1 29 30 6
31 20 6 31 43 3 31 50 12 33 10 6 33 45 3 33 60 12 35 48 3 35 70 12
42 40 4 42 48 4 42 45 4 42 43 4 42 38 4 29 38 9 31 36 9 42 36 4
42 34 4 33 34 9 53 41 1 74 41 4
subpoints 0

View File

@ -1,8 +1,8 @@
if not exist bin mkdir bin
if not exist bin\tl_sys_16.bmp @copy ..\..\develop\libraries\box_lib\trunk\tl_sys_16.bmp bin\tl_sys_16.bmp
if not exist bin\tl_nod_16.bmp @copy ..\..\develop\libraries\box_lib\trunk\tl_nod_16.bmp bin\tl_nod_16.bmp
if not exist bin\tl_sys_16.png @copy ..\..\media\log_el\trunk\tl_sys_16.png bin\tl_sys_16.png
if not exist bin\tl_nod_16.png @copy tl_nod_16.png bin\tl_nod_16.png
if not exist bin\msgbox.obj @copy msgbox.obj bin\msgbox.obj
if not exist bin\te_icon.bmp @copy te_icon.bmp bin\te_icon.bmp
if not exist bin\te_icon.png @copy te_icon.png bin\te_icon.png
if not exist bin\info mkdir bin\info
if not exist bin\box_lib.obj @fasm.exe -m 16384 ..\..\develop\libraries\box_lib\trunk\box_lib.asm bin\box_lib.obj

View File

@ -1,8 +1,8 @@
if not exist bin mkdir bin
if not exist bin\tl_sys_16.bmp @copy ..\..\develop\libraries\box_lib\trunk\tl_sys_16.bmp bin\tl_sys_16.bmp
if not exist bin\tl_nod_16.bmp @copy ..\..\develop\libraries\box_lib\trunk\tl_nod_16.bmp bin\tl_nod_16.bmp
if not exist bin\tl_sys_16.png @copy ..\..\media\log_el\trunk\tl_sys_16.png bin\tl_sys_16.png
if not exist bin\tl_nod_16.png @copy tl_nod_16.png bin\tl_nod_16.png
if not exist bin\msgbox.obj @copy msgbox.obj bin\msgbox.obj
if not exist bin\te_icon.bmp @copy te_icon.bmp bin\te_icon.bmp
if not exist bin\te_icon.png @copy te_icon.png bin\te_icon.png
if not exist bin\info mkdir bin\info
if not exist bin\box_lib.obj @fasm.exe -m 16384 ..\..\develop\libraries\box_lib\trunk\box_lib.asm bin\box_lib.obj

View File

@ -0,0 +1,99 @@
proc dll.Load, import_table:dword
mov esi,[import_table]
.next_lib: mov edx,[esi]
or edx,edx
jz .exit
push esi
mov esi,[esi+4]
mov edi,s_libdir.fname
@@: lodsb
stosb
or al,al
jnz @b
mcall 68,19,s_libdir
or eax,eax
jz .fail
stdcall dll.Link,eax,edx
push eax
mov eax, [eax]
cmp dword [eax], 'lib_'
pop eax
jnz @f
stdcall dll.Init,[eax+4]
@@:
pop esi
add esi,8
jmp .next_lib
.exit: xor eax,eax
ret
.fail: add esp,4
xor eax,eax
inc eax
ret
endp
proc dll.Link, exp:dword,imp:dword
push eax
mov esi,[imp]
test esi,esi
jz .done
.next: lodsd
test eax,eax
jz .done
stdcall dll.GetProcAddress,[exp],eax
or eax,eax
jz @f
mov [esi-4],eax
jmp .next
@@: mov dword[esp],0
.done: pop eax
ret
endp
proc dll.Init, dllentry:dword
pushad
mov eax,mem.Alloc
mov ebx,mem.Free
mov ecx,mem.ReAlloc
mov edx,dll.Load
stdcall [dllentry]
popad
ret
endp
proc dll.GetProcAddress, exp:dword,sz_name:dword
mov edx,[exp]
xor eax,eax
.next: or edx,edx
jz .end
cmp dword[edx],0
jz .end
stdcall strcmp,[edx],[sz_name]
test eax,eax
jz .ok
add edx,8
jmp .next
.ok: mov eax,[edx+4]
.end: ret
endp
proc strcmp, str1:dword,str2:dword
push esi edi
mov esi,[str1]
mov edi,[str2]
xor eax,eax
@@: lodsb
scasb
jne .fail
or al,al
jnz @b
jmp .ok
.fail: or eax,-1
.ok: pop edi esi
ret
endp
s_libdir:
db '/sys/lib/'
.fname rb 32

File diff suppressed because one or more lines are too long

View File

@ -48,7 +48,7 @@ table
</head>
<body>
<h1>TextEditor âåðñèÿ îò 27.05.2010</h1>
<h1>TextEditor версия от 19.04.2012</h1>
<h2>О программе</h2>
<p>Программа для работы с текстовыми файлами.
Лицензия свободная.</p>
@ -133,6 +133,18 @@ ends</pre>
<tr><td>Описания слов (строки текста с 0-ми в конце)</td>
<td><pre>(длинна справочного текста + 1)</pre></td></tr>
</table>
<h4>Макрос для задания ключевого слова</h4>
<p>Файлы синтаксиса можно компилировать через fasm.</p>
<pre>macro wo txt,f1,p1,p2,p3{
@@: db txt
rb @b+40-$
dd f1+0
db p1
dw p2+0
db p3
}</pre>
<h4>Замечания.</h4>
<ul>
<li>Все слова должны быть расположены в порядке следования их ASCII кодов.

View File

@ -18,10 +18,10 @@ struct symbol
ends
hed db 'TextEditor 26.08.11',0 ;¯®¤¯¨áì ®ª­ 
hed db 'TextEditor 19.04.12',0 ;¯®¤¯¨áì ®ª­ 
sc system_colors
fn_icon db 'te_icon.bmp',0
;fn_icon db 'te_icon.bmp',0
bmp_icon dd 0
run_file_70 FileInfoBlock
@ -113,6 +113,8 @@ ted_but_open_file:
stdcall [mb_create],msgbox_9,thread ;message: error run 'open file dialog'
jmp .ret_f
@@:
cmp [OpenDialog_data.status],1
jne .ret_f
mov esi,[OpenDialog_data.openfile_path]
call strlen
mov [edit1.size],eax

View File

@ -2,22 +2,22 @@ fn_col_option dd def_col_file
fn_syntax_dir db 'info/',0
def_col_file db 'default.syn',0
system_dir0 db '/sys/lib/'
lib0_name db 'box_lib.obj',0
system_dir_0 db '/sys/lib/'
lib_name_0 db 'box_lib.obj',0
system_dir1 db '/sys/lib/'
lib1_name db 'msgbox.obj',0
system_dir_1 db '/sys/lib/'
lib_name_1 db 'msgbox.obj',0
system_dir2 db '/sys/lib/'
lib2_name db 'proc_lib.obj',0
system_dir_2 db '/sys/lib/'
lib_name_2 db 'proc_lib.obj',0
fn_icon_tl_sys db 'tl_sys_16.bmp',0
fn_icon_tl_nod db 'tl_nod_16.bmp',0
system_dir_3 db '/sys/lib/'
lib_name_3 db 'libimg.obj',0
;---------------------------------------------------------------------
align 4
boxlib_import:
dd alib_init2 ;ôóíęöč˙ çŕďóńęŕĺňń˙ ěŕęđîńîě 1 đŕç ďđč ďîäęëţ÷ĺíčč áčáčëčîňĺęč, ďîňîěó â ďđîăđŕěěĺ ěĺňęŕ íŕ íĺĺ íĺ íóćíŕ
import_box_lib:
dd alib_init0 ;äã­ªæ¨ï § ¯ã᪠¥âáï ¬ ªà®á®¬ 1 à § ¯à¨ ¯®¤ª«î祭¨¨ ¡¨¡¨«¨®â¥ª¨, ¯®â®¬ã ¢ ¯à®£à ¬¬¥ ¬¥âª  ­  ­¥¥ ­¥ ­ã¦­ 
edit_box_draw dd aEdit_box_draw
edit_box_key dd aEdit_box_key
@ -92,7 +92,7 @@ boxlib_import:
version_text_edit dd sz_ted_version
dd 0,0
alib_init2 db 'lib_init',0
alib_init0 db 'lib_init',0
aEdit_box_draw db 'edit_box',0
aEdit_box_key db 'edit_box_key',0
@ -167,7 +167,7 @@ dd 0,0
sz_ted_version db 'version_text_edit',0
align 4
proclib_import:
import_proclib:
OpenDialog_Init dd aOpenDialog_Init
OpenDialog_Start dd aOpenDialog_Start
dd 0,0
@ -175,7 +175,7 @@ dd 0,0
aOpenDialog_Start db 'OpenDialog_start',0
align 4
msgbox_lib_import:
import_msgbox_lib:
mb_create dd amb_create
mb_reinit dd amb_reinit
mb_setfunctions dd amb_setfunctions
@ -183,6 +183,53 @@ dd 0,0
amb_create db 'mb_create',0
amb_reinit db 'mb_reinit',0
amb_setfunctions db 'mb_setfunctions',0
align 4
import_libimg:
dd alib_init1
;img_is_img dd aimg_is_img
;img_info dd aimg_info
;img_from_file dd aimg_from_file
;img_to_file dd aimg_to_file
;img_from_rgb dd aimg_from_rgb
;img_to_rgb dd aimg_to_rgb
img_to_rgb2 dd aimg_to_rgb2
img_decode dd aimg_decode
;img_encode dd aimg_encode
;img_create dd aimg_create
img_destroy dd aimg_destroy
;img_destroy_layer dd aimg_destroy_layer
;img_count dd aimg_count
;img_lock_bits dd aimg_lock_bits
;img_unlock_bits dd aimg_unlock_bits
;img_flip dd aimg_flip
;img_flip_layer dd aimg_flip_layer
;img_rotate dd aimg_rotate
;img_rotate_layer dd aimg_rotate_layer
;img_draw dd aimg_draw
dd 0,0
alib_init1 db 'lib_init',0
;aimg_is_img db 'img_is_img',0 ;®¯à¥¤¥«ï¥â ¯® ¤ ­­ë¬, ¬®¦¥â «¨ ¡¨¡«¨®â¥ª  ᤥ« âì ¨§ ­¨å ¨§®¡à ¦¥­¨¥
;aimg_info db 'img_info',0
;aimg_from_file db 'img_from_file',0
;aimg_to_file db 'img_to_file',0
;aimg_from_rgb db 'img_from_rgb',0
;aimg_to_rgb db 'img_to_rgb',0 ;¯à¥®¡à §®¢ ­¨¥ ¨§®¡à ¦¥­¨ï ¢ ¤ ­­ë¥ RGB
aimg_to_rgb2 db 'img_to_rgb2',0
aimg_decode db 'img_decode',0 ; ¢â®¬ â¨ç¥áª¨ ®¯à¥¤¥«ï¥â ä®à¬ â £à ä¨ç¥áª¨å ¤ ­­ëå
;aimg_encode db 'img_encode',0
;aimg_create db 'img_create',0
aimg_destroy db 'img_destroy',0
;aimg_destroy_layer db 'img_destroy_layer',0
;aimg_count db 'img_count',0
;aimg_lock_bits db 'img_lock_bits',0
;aimg_unlock_bits db 'img_unlock_bits',0
;aimg_flip db 'img_flip',0
;aimg_flip_layer db 'img_flip_layer',0
;aimg_rotate db 'img_rotate',0
;aimg_rotate_layer db 'img_rotate_layer',0
;aimg_draw db 'img_draw',0
;---------------------------------------------------------------------
align 4
wScr:
@ -197,8 +244,8 @@ wScr:
.max_area dd 100 ;+16
.cur_area dd 30 ;+20
.position dd 0 ;+24
.bckg_col dd 0xeeeeee ;+28
.frnt_col dd 0xbbddff ;+32
.bckg_col dd 0 ;+28
.frnt_col dd 0 ;+32
.line_col dd 0 ;+36
.redraw dd 0 ;+40
.delta dw 0 ;+44
@ -229,10 +276,10 @@ hScr:
.btn_high dd 15 ;+8
.type dd 1 ;+12
.max_area dd 100 ;+16
.cur_area dd 30 ;+20
.cur_area dd 30 ;+20
.position dd 0 ;+24
.bckg_col dd 0xeeeeee ;+28
.frnt_col dd 0xbbddff ;+32
.bckg_col dd 0 ;+28
.frnt_col dd 0 ;+32
.line_col dd 0 ;+36
.redraw dd 0 ;+40
.delta dw 0 ;+44
@ -262,11 +309,11 @@ ws_dir_lbox: ;
.start_y dw 70 ;+6
.btn_high dd 15 ;+8
.type dd 1 ;+12
.max_area dd 100 ;+16
.cur_area dd 30 ;+20
.max_area dd 100 ;+16
.cur_area dd 30 ;+20
.position dd 0 ;+24
.bckg_col dd 0xeeeeee ;+28
.frnt_col dd 0xbbddff ;+32
.bckg_col dd 0 ;+28
.frnt_col dd 0 ;+32
.line_col dd 0 ;+36
.redraw dd 0 ;+40
.delta dw 0 ;+44

View File

@ -22,6 +22,7 @@ maxSyntaxFileSize equ 410000
include '../../proc32.inc'
include '../../macros.inc'
include 'mem.inc'
include 'dll.inc'
include '../../develop/libraries/box_lib/load_lib.mac'
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
include 'lang.inc'
@ -31,7 +32,55 @@ include 'strlen.inc'
include 't_draw.inc' ;draw main window functions
include 't_button.inc' ;text work functions
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,0
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
;Œ ªà®á ¤«ï § £à㧪¨ ¨§®¡à ¦¥­¨© á ¨á¯®«ì§®¢ ­¨¥¬ ¡¨¡«¨®â¥ª¨ libimg.obj
;¤«ï ¨á¯®«ì§®¢ ­¨ï ¬ ªà®á  ­ã¦­ë ¯¥à¥¬¥­­ë¥:
; - run_file_70 FileInfoBlock
; - image_data dd 0
macro load_image_file path,buf,size
{
;path - ¬®¦¥â ¡ëâì ¯¥à¥¬¥­­®© ¨«¨ áâப®¢ë¬ ¯ à ¬¥â஬
if path eqtype '' ;¯à®¢¥à塞 § ¤ ­ «¨ áâப®© ¯ à ¬¥âà path
jmp @f
local .path_str
.path_str db path ;ä®à¬¨à㥬 «®ª «ì­ãî ¯¥à¥¬¥­­ãî
db 0
@@:
;32 - áâ ­¤ àâ­ë©  ¤à¥á ¯® ª®â®à®¬ã ¤®«¦¥­ ¡ëâì ¡ãä¥à á á¨á⥬­ë¬ ¯ã⥬
copy_path .path_str,[32],file_name,0x0
else
copy_path path,[32],file_name,0x0 ;ä®à¬¨à㥬 ¯®«­ë© ¯ãâì ª ä ©«ã ¨§®¡à ¦¥­¨ï, ¯®¤à §ã¬¥¢ ¥¬ çâ® ®­ ¢ ®¤­®© ¯ ¯ª¥ á ¯à®£à ¬¬®©
end if
stdcall mem.Alloc, dword size ;¢ë¤¥«ï¥¬ ¯ ¬ïâì ¤«ï ¨§®¡à ¦¥­¨ï
mov [buf],eax
mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
mov [run_file_70.Function], 0
mov [run_file_70.Position], 0
mov [run_file_70.Flags], 0
mov [run_file_70.Count], dword size
m2m [run_file_70.Buffer], [buf]
mov byte[run_file_70+20], 0
mov [run_file_70.FileName], file_name
mov ebx,run_file_70
int 0x40 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
cmp ebx,0xffffffff
je @f
;®¯à¥¤¥«ï¥¬ ¢¨¤ ¨§®¡à ¦¥­¨ï ¨ ¯¥à¥¢®¤¨¬ ¥£® ¢® ¢à¥¬¥­­ë© ¡ãä¥à image_data
stdcall dword[img_decode], dword[buf],ebx,0
mov dword[image_data],eax
;¯à¥®¡à §ã¥¬ ¨§®¡à ¦¥­¨¥ ª ä®à¬ âã rgb
stdcall dword[img_to_rgb2], dword[image_data],dword[buf]
;㤠«ï¥¬ ¢à¥¬¥­­ë© ¡ãä¥à image_data
stdcall dword[img_destroy], dword[image_data]
@@:
}
image_data dd 0 ;㪠§ â¥«ì ­  ¢à¥¬¥­­ãî ¯ ¬ïâì. ¤«ï ­ã¦¥­ ¯à¥®¡à §®¢ ­¨ï ¨§®¡à ¦¥­¨ï
icon_tl_sys dd 0 ;㪠§ â¥«ì ­  ¯ ¬ïâì ¤«ï åà ­¥­¨ï á¨á⥬­ëå ¨ª®­®ª
align 4
start:
@ -49,6 +98,7 @@ start:
call strlen
mov ecx,eax
mov edi,openfile_path
cld
rep movsb ;ª®¯¨à㥬 ¨¬ï ä ©«  ¢ ¡ãä¥à edit1
load_libraries l_libs_start,load_lib_end
@ -78,76 +128,18 @@ load_libraries l_libs_start,load_lib_end
; OpenDialog initialisation
stdcall [OpenDialog_Init],OpenDialog_data
; init bmp file
mov ecx,1200*18
stdcall mem.Alloc,ecx
mov [bmp_icon],eax
copy_path fn_icon,sys_path,file_name,0x0
mov eax,70 ;load icon file
mov [run_file_70.Function], 0
mov [run_file_70.Position], 54
mov [run_file_70.Flags], 0
mov [run_file_70.Count], 1200*18
m2m [run_file_70.Buffer], [bmp_icon]
mov byte[run_file_70+20], 0
mov [run_file_70.FileName], file_name
mov ebx,run_file_70
int 0x40
cmp ebx,-1
mov [err_ini0],1
je @f ;if open file
mov [err_ini0],0
@@:
; init toolbar file
load_image_file 'te_icon.png', bmp_icon,1200*18
;---------------------------------------------------------------------
; ç¨â ¥¬ bmp ä ©« á ªãàá®à ¬¨ ¨ «¨­¨ï¬¨
copy_path fn_icon_tl_sys,sys_path,file_name,0x0
mov ecx,3*256*13
stdcall mem.Alloc,ecx
mov dword[tree1.data_img_sys],eax
;mov [run_file_70.Function], 0
;mov [run_file_70.Position], 54
;mov [run_file_70.Flags], 0
mov [run_file_70.Count], 3*256*13
mov [run_file_70.Buffer], eax
;mov byte[run_file_70+20], 0
;mov [run_file_70.FileName], file_name
mov eax,70 ;load icon file
mov ebx,run_file_70
int 0x40
cmp ebx,0
jg @f
mov dword[tree1.data_img_sys],0
@@:
; ç¨â ¥¬ ä ©« á ªãàá®à ¬¨ ¨ «¨­¨ï¬¨
load_image_file 'tl_sys_16.png', icon_tl_sys,54+3*256*13
mov eax,dword[icon_tl_sys]
mov dword[tree1.data_img_sys],eax
;---------------------------------------------------------------------
; ç¨â ¥¬ bmp ä ©« á ¨ª®­ª ¬¨ 㧫®¢
copy_path fn_icon_tl_nod,sys_path,file_name,0x0
mov ecx,3*256*2
stdcall mem.Alloc,ecx
mov dword[tree1.data_img],eax
; mov [run_file_70.Function], 0
; mov [run_file_70.Position], 54
; mov [run_file_70.Flags], 0
mov [run_file_70.Count], 3*256*2
mov [run_file_70.Buffer], eax
; mov byte[run_file_70+20], 0
; mov [run_file_70.FileName], file_name
mov eax,70 ;load icon file
mov ebx,run_file_70
int 0x40
cmp ebx,0
jg @f
mov dword[tree1.data_img],0
@@:
; ç¨â ¥¬ ä ©« á ¨ª®­ª ¬¨ 㧫®¢
load_image_file 'tl_nod_16.png', icon_tl_sys,54+3*256*2
mov eax,dword[icon_tl_sys]
mov dword[tree1.data_img],eax
;------------------------------------------------------------------------------
copy_path fn_syntax_dir,sys_path,file_name,0x0 ;¡¥à¥¬ ¯ãâì ª ¯ ¯ª¥ á ä ©« ¬¨ ᨭ⠪á¨á 
mov eax,70
@ -243,28 +235,7 @@ draw_window:
call draw_but_toolbar
cmp [err_ini0],1
jne @f
mov eax,4
mov ebx,ted_wnd_l
add ebx,ted_rec_l
shl ebx,16
add ebx,ted_wnd_t
add ebx,ted_rec_t
mov ecx,0x80ff0000
mov edx,txtErrIni0
int 0x40
add ebx,10 ;move <--y-->
mov ecx,0x80ff0080
mov edx,file_name
int 0x40
@@:
cmp [err_ini0],1
je @f
stdcall [ted_draw], tedit0
@@:
stdcall [ted_draw], tedit0
mcall 12,2
ret
@ -502,40 +473,45 @@ button:
mcall -1 ;¢ë室 ¨§ ¯à®£à ¬¬ë
txtErrIni0 db '<27>¥ ®âªàë«áï ä ©« á ¨ª®­ª ¬¨',0
err_ini0 db 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_find db 302 dup(0)
if lang eq ru
head_f_i0:
head_f_l0 db '‘¨á⥬­ ï ®è¨¡ª ',0
head_f_i:
head_f_l db '‘¨á⥬­ ï ®è¨¡ª ',0
err_message_found_lib0 db '<27>¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'box_lib.obj',39,0
err_message_import0 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'box_lib.obj',39,0
err_message_found_lib1 db '<27>¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'msgbox.obj',39,0
err_message_import1 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'msgbox.obj',39,0
err_message_found_lib2 db '<27>¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'proc_lib.obj',39,0
err_message_import2 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'proc_lib.obj',39,0
err_message_found_lib_3 db '<27>¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'libimg.obj',39,0
err_message_import_3 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'libimg.obj',39,0
else
head_f_i0:
head_f_l0 db 'System error',0
head_f_i:
head_f_l db 'System error',0
err_message_found_lib0 db 'Sorry I cannot found library ',39,'box_lib.obj',39,0
err_message_import0 db 'Error on load import library ',39,'box_lib.obj',39,0
err_message_found_lib1 db 'Sorry I cannot found library ',39,'msgbox.obj',39,0
err_message_import1 db 'Error on load import library ',39,'msgbox.obj',39,0
err_message_found_lib2 db 'Sorry I cannot found library ',39,'proc_lib.obj',39,0
err_message_import2 db 'Error on load import library ',39,'proc_lib.obj',39,0
err_message_found_lib_3 db 'Sorry I cannot found library ',39,'libimg.obj',39,0
err_message_import_3 db 'Error on load import library ',39,'libimg.obj',39,0
end if
;library structures
l_libs_start:
lib0 l_libs lib0_name, sys_path, file_name, system_dir0, err_message_found_lib0, head_f_l0, boxlib_import,err_message_import0, head_f_i0
lib1 l_libs lib1_name, sys_path, file_name, system_dir1, err_message_found_lib1, head_f_l0, msgbox_lib_import, err_message_import1, head_f_i0
lib2 l_libs lib2_name, sys_path, file_name, system_dir2, err_message_found_lib2, head_f_l0, proclib_import, err_message_import2, head_f_i0
lib0 l_libs lib_name_0, sys_path, file_name, system_dir_0,\
err_message_found_lib0, head_f_l, import_box_lib,err_message_import0, head_f_i
lib1 l_libs lib_name_1, sys_path, file_name, system_dir_1,\
err_message_found_lib1, head_f_l, import_msgbox_lib, err_message_import1, head_f_i
lib2 l_libs lib_name_2, sys_path, file_name, system_dir_2,\
err_message_found_lib2, head_f_l, import_proclib, err_message_import2, head_f_i
lib3 l_libs lib_name_3, sys_path, file_name, system_dir_3,\
err_message_found_lib_3, head_f_l, import_libimg, err_message_import_3, head_f_i
load_lib_end:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 699 B