diff --git a/programs/other/t_edit/t_data.inc b/programs/other/t_edit/t_data.inc index 4871c365d2..514f4ae736 100644 --- a/programs/other/t_edit/t_data.inc +++ b/programs/other/t_edit/t_data.inc @@ -486,7 +486,7 @@ tree_file_struct: if lang eq ru -hed db '’ҐЄбв®ўл© аҐ¤ Єв®а 12.03.13',0 ;Ї®¤ЇЁбм ®Є­  +hed db '’ҐЄбв®ўл© аҐ¤ Єв®а 29.10.13',0 ;Ї®¤ЇЁбм ®Є­  menu_text_area: db '” ©«',0 @@ -597,7 +597,7 @@ txtFormatApply db ' else -hed db 'Text editor 12.03.13',0 +hed db 'Text editor 29.10.13',0 menu_text_area: db 'File',0 diff --git a/programs/other/t_edit/t_draw.inc b/programs/other/t_edit/t_draw.inc index 7928330b11..814bd1fbd9 100644 --- a/programs/other/t_edit/t_draw.inc +++ b/programs/other/t_edit/t_draw.inc @@ -322,7 +322,7 @@ draw_but_icon: shr esi,16 add esi,20 cmp esi,[procinfo.client_box.width] - jge @f ;кнопка не влезла в экран + jge @f ;кнопка не влезла в окно mov esi,[sc.work_button] int 0x40 ;ставим кнопку mov eax,7 ;bmp @@ -330,12 +330,12 @@ draw_but_icon: pop esi edx ecx cmp eax,7 - jne @f ;кнопка не влезла в экран - mov ebx,ecx - ror ebx,16 - cmp bx,0x4000 - jne @f + jne @f ;кнопка не влезла в окно mov ebx,[bmp_icon] + bt ecx,30 ;if (ecx or 0x40000000) + jc .gray + add ebx,TOOLBAR_ICONS_SIZE ;перемещаемся на серые кнопки + .gray: push ecx and ecx,0xffff imul ecx,1200 @@ -349,3 +349,30 @@ draw_but_icon: pop ebx eax ret +;descrition: +; функция для генерирования серых иконок +;input: +; buf_rgb - буфер с входным 24 битным цветным изображением +; buf_g24 - буфер с выходным 24 битным серым изображением +; pixels - число пикселей в изображении +align 4 +proc img_to_gray uses eax ebx ecx edi esi, buf_rgb:dword, buf_g24:dword, pixels:dword + mov esi,[buf_rgb] + mov edi,[buf_g24] + mov ecx,[pixels] + @@: + movzx eax,byte[esi] + movzx ebx,byte[esi+1] + add eax,ebx + movzx ebx,byte[esi+2] + add eax,ebx + shr eax,2 + mov ah,al + mov word[edi],ax + mov byte[edi+2],al + add esi,3 + add edi,3 + loop @b + ret +endp + diff --git a/programs/other/t_edit/t_edit.asm b/programs/other/t_edit/t_edit.asm index 6832377cbd..5c3d112c31 100644 --- a/programs/other/t_edit/t_edit.asm +++ b/programs/other/t_edit/t_edit.asm @@ -18,6 +18,7 @@ MAX_COLOR_WORD_LEN equ 40 maxChars equ 100002 ;(...+2) BUF_SIZE equ 4096 ;buffer for copy|paste maxSyntaxFileSize equ 410000 +TOOLBAR_ICONS_SIZE equ 1200*18 include '../../proc32.inc' ;include '../../config.inc' @@ -131,7 +132,10 @@ load_libraries l_libs_start,load_lib_end stdcall [OpenDialog_Init],OpenDialog_data ; init toolbar file - load_image_file 'te_icon.png', bmp_icon,1200*18 + load_image_file 'te_icon.png', bmp_icon,TOOLBAR_ICONS_SIZE*2 ;г¬­®¦Ґ­ЁҐ ­  2 ¤«п бҐале Є­®Ї®Є + mov eax,[bmp_icon] + add eax,TOOLBAR_ICONS_SIZE + stdcall img_to_gray, [bmp_icon],eax,(TOOLBAR_ICONS_SIZE)/3 ;--------------------------------------------------------------------- ; зЁв Ґ¬ д ©« б Єгаб®а ¬Ё Ё «Ё­Ёп¬Ё load_image_file 'tl_sys_16.png', icon_tl_sys,54+3*256*13