t_edit: add gray icons

git-svn-id: svn://kolibrios.org@4128 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA 2013-10-29 12:48:21 +00:00
parent 395cf49f52
commit 886d872aa1
3 changed files with 40 additions and 9 deletions

View File

@ -486,7 +486,7 @@ tree_file_struct:
if lang eq ru if lang eq ru
hed db '’¥ªáâ®¢ë© à¥¤ ªâ®à 12.03.13',0 ;¯®¤¯¨áì ®ª­  hed db '’¥ªáâ®¢ë© à¥¤ ªâ®à 29.10.13',0 ;¯®¤¯¨áì ®ª­ 
menu_text_area: menu_text_area:
db '” ©«',0 db '” ©«',0
@ -597,7 +597,7 @@ txtFormatApply db '
else else
hed db 'Text editor 12.03.13',0 hed db 'Text editor 29.10.13',0
menu_text_area: menu_text_area:
db 'File',0 db 'File',0

View File

@ -322,7 +322,7 @@ draw_but_icon:
shr esi,16 shr esi,16
add esi,20 add esi,20
cmp esi,[procinfo.client_box.width] cmp esi,[procinfo.client_box.width]
jge @f ;кнопка не влезла в экран jge @f ;êíîïêà íå âëåçëà â îêíî
mov esi,[sc.work_button] mov esi,[sc.work_button]
int 0x40 ;ñòàâèì êíîïêó int 0x40 ;ñòàâèì êíîïêó
mov eax,7 ;bmp mov eax,7 ;bmp
@ -330,12 +330,12 @@ draw_but_icon:
pop esi edx ecx pop esi edx ecx
cmp eax,7 cmp eax,7
jne @f ;кнопка не влезла в экран jne @f ;êíîïêà íå âëåçëà â îêíî
mov ebx,ecx
ror ebx,16
cmp bx,0x4000
jne @f
mov ebx,[bmp_icon] mov ebx,[bmp_icon]
bt ecx,30 ;if (ecx or 0x40000000)
jc .gray
add ebx,TOOLBAR_ICONS_SIZE ;ïåðåìåùàåìñÿ íà ñåðûå êíîïêè
.gray:
push ecx push ecx
and ecx,0xffff and ecx,0xffff
imul ecx,1200 imul ecx,1200
@ -349,3 +349,30 @@ draw_but_icon:
pop ebx eax pop ebx eax
ret 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

View File

@ -18,6 +18,7 @@ MAX_COLOR_WORD_LEN equ 40
maxChars equ 100002 ;(...+2) maxChars equ 100002 ;(...+2)
BUF_SIZE equ 4096 ;buffer for copy|paste BUF_SIZE equ 4096 ;buffer for copy|paste
maxSyntaxFileSize equ 410000 maxSyntaxFileSize equ 410000
TOOLBAR_ICONS_SIZE equ 1200*18
include '../../proc32.inc' include '../../proc32.inc'
;include '../../config.inc' ;include '../../config.inc'
@ -131,7 +132,10 @@ load_libraries l_libs_start,load_lib_end
stdcall [OpenDialog_Init],OpenDialog_data stdcall [OpenDialog_Init],OpenDialog_data
; init toolbar file ; 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 load_image_file 'tl_sys_16.png', icon_tl_sys,54+3*256*13