/programs/media/scrshoot/editbox.inc |
---|
1,6 → 1,15 |
; <Lrz> 21.07.2006 ¤®¡ ¢«¥ äãªæ¨ï ª®¯ª¨ Del, ⥯¥àì ¬®¦® 㤠«ïâì ᨬ¢®«ë ¯à¨ ¯®¬®é¨ ¤ ®© ª®« ¢¨è¨ |
; <Lrz> 01.02.2007 ¤®à ¡®âª edit_box, ¨á¯à ¢¨« ¡ £¨. |
; <Lrz> 26.01.2007 ®à¬ «ì ï à ¡®â ª®¬¯ ¥â ¨á¯à ¢¨« äãªæ¨î .check_offset |
; <Lrz> 24.01.2007 ¯®ä¨ªá¥« ¡ £¨ ¢ë§¢ ë¥ ¥ ¯à ¢¨«ìë¬ ª®¤®¬ )). |
; <Lrz> 22.01.2007 ¨§¡ ¢¨«áï ®â £«îª®¢ ¯à¨ à ¡®â¥ á ¢ë¤¥«¥¨¥¬ ¨ 㤠«¥¨¥, ª®à४â ï à ¡®â ª« ¢¨è¥© del & backspase |
; <Lrz> 20.01.2007 ॠ«¨§®¢ « ¢ë¤¥«¥¨¥ ⥪áâ ¯® shift |
; <Lrz> 12.12.2006 ॠ«¨§®¢ « ¯®¤¤¥à¦ªã ª®¯ª¨ insert ¨ ᥣ®¤ï ª®¬¯®¥â ¯®çâ¨ à ¡®â ¥â!!!! |
; <Lrz> 07.12.2006 ¯à®¤®«¦ ¥âáï à ¡®â ¤ ¯¥à¥à ¡®âª®© ª®¬¯®¥â ,¨§¬¥¥¨ï¬ ¯®¤¢¥à£«¨áì ¬®£¨¥ äãªæ¨¨, ¯¥à¥à ¡®â ¢ë¢®¤ ⥪áâ , â ª ¦¥ «£®à¨â¬ ¢¥á¥¨ï ᨬ¢®«®¢. |
; <Lrz> 03.09.2006 ¯® ¢®§¬®¦®á⨠®âª § «áï ®â 16 ¡¨â®© à¨ä¬¥â¨ª¨, ¤®¡ ¢¨« ®¢ë¥ ¡ £¨ |
; <Lrz> 09.08.2006 ¯à®¨§¢¥¤¥ ®¯â¨¬¨§ æ¨ï à ¡®âë ª®¯®ª DEL ¨ Backspace, 㬥ìè¥ à §¬¥à ¢ë¯®«ï¥¬®£® ª®¤ . |
; <Lrz> 21.07.2006 ¤®¡ ¢«¥ äãªæ¨ï ª®¯ª¨ Del, ⥯¥àì ¬®¦® 㤠«ïâì ᨬ¢®«ë ¯à¨ ¯®¬®é¨ ¤ ®© ª« ¢¨è¨ |
; ¢â®à: ¢â¨å®¢ ªá¨¬ (Maxxxx32) email: maxxxxm@mail.ru |
; â ¯®á«¥¤¨å ¨§¬¥¥¨©: 13.07.06 10:40 |
; â ¯®á«¥¤¨å ¨§¬¥¥¨©: 13.06.06 10:40 |
; ¯¨è¨â¥ ¢ ¨á室®¬ ª®¤¥ ᢮¥© ¯à®£à ¬¬ë use_edit_box, |
; íâ® ¢áâ ¢¨â ¥®¡å®¤¨¬ë¥ ¯à®æ¥¤ãàë ¢ ª®¤ ¢ 襩 ¯à®£à ¬¬ë. |
; à®æ¥¤ãàë: |
14,7 → 23,7 |
; ®áâ ¢¨âì 㪠§ ⥫ì áâàãªâãàã. |
; ਬ¥à áâàãªâãàë: |
; some_edit edit_box 100,10,30,0x00ffffff,0,0x00aaaaaa,0,255,some_edit_text |
; ¤«¨ , «¥¢®, ¢¥àå, 梥â ä® , 梥â à ¬ª¨, ¥á«¨ ¢ë¡à , |
; ¤«¨ , ¢ëá®â , ¢¥àå, 梥â ä® , 梥â à ¬ª¨, ¥á«¨ ¢ë¡à , |
; 梥â à ¬ª¨, ¥á«¨ ¥ ¢ë¡à , ¬ ªá¨¬ «ì®¥ ª®«¨ç¥á⢮ ᨬ¢®«®¢, |
; 㪠§ â¥«ì ¡ãä¥à, £¤¥ ¡ã¤ãâ åà ¨âáï ᨬ¢®«ë. ãä¥à ¤®«¦¥ |
; ®ª 稢 âìáï ã«¥¬, ¯à¨¬¥à ¥á«¨ ¬ ªá¨¬ «ì®¥ ª®«¨ç¥á⢮ 255: |
41,20 → 50,26 |
macro use_edit_box |
{ |
edit_box: |
ed_width equ [edi] |
ed_left equ [edi+2] |
ed_top equ [edi+4] |
ed_color equ [edi+6] |
ed_focus_border_color equ [edi+10] |
ed_blur_border_color equ [edi+14] |
ed_text_color equ [edi+18] |
ed_flags equ [edi+22] |
ed_max equ [edi+24] |
ed_size equ [edi+26] |
ed_pos equ [edi+28] |
ed_offset equ [edi+30] |
ed_text equ [edi+32] |
ed_width equ [edi] ;è¨à¨ ª®¬¯®¥â |
ed_left equ [edi+4] ;¯®«®¦¥¨¥ ¯® ®á¨ å |
ed_top equ [edi+8] ;¯®«®¦¥¨¥ ¯® ®á¨ ã |
ed_color equ [edi+12] ;梥â ä® ª®¬¯®¥â |
ed_focus_border_color equ [edi+16] ;梥â à ¬ª¨ ª®¬¯®¥â |
ed_blur_border_color equ [edi+20] ;梥⠥ ªâ¨¢®£® ª®¬¯®¥â |
ed_text_color equ [edi+24] ;梥â ⥪áâ |
ed_max equ [edi+28] ;ª®«-¢® ᨬ¢®«®¢ ª®â®àë¥ ¬®¦® ¬ ªá¨¬ «ì® ¢¢¥á⨠|
ed_text equ [edi+32] ;㪠§ â¥«ì ¡ãä¥à |
ed_flags equ [edi+36] ;ä« £¨ |
ed_size equ [edi+38] ;ª®«-¢® ᨬ¢®«®¢ |
ed_pos equ [edi+42] ;¯®§¨æ¨ï ªãàá®à |
ed_offset equ [edi+46] ;ᬥ饨¥ |
cl_curs_x equ [edi+50] ;¯à¥¤ë¤ã饥 ª®®à¤¨ â ªãàá®à ¯® å |
cl_curs_y equ [edi+54] ;¯à¥¤ë¤ã饥 ª®®à¤¨ â ªãàá®à ¯® ã |
ed_shift_pos equ [edi+58] |
ed_height=14 ; ¢ëá®â |
shift_color=0x6a9480 |
ed_insert=10000b |
ed_insert_cl=1111111111101111b |
;========================================================== |
;=== ¯à®æ¥¤ãà ¯à®à¨á®¢ª¨ ================================= |
;========================================================== |
61,18 → 76,17 |
.draw: |
pusha |
;--- à¨á㥬 à ¬ªã --- |
call .draw_border |
call .draw_border ; ãªæ¨ï áâ ¡¨«ì |
.draw_bg_cursor_text: |
;--- ¨§¬¥ï¥¬ ᬥ饨¥, ¥á«¨ ¤® --- |
call .check_offset |
call .check_offset ;¢ëç¨á«¥¨¥ ¯®§¨æ¨¨ ªãàá®à áâ ¡¨«ì |
;--- à¨á㥬 ¢ãâà¥îî ®¡« áâì --- |
call .draw_bg |
call .draw_bg ; à¨á®¢ âì ¯àאַ㣮«ì¨ª à ¡®ç¥© ®¡« á⨠|
.draw_cursor_text: |
;--- à¨á㥬 ªãàá®à --- |
;--- ¬®¦¥â ¥£® ¥ ¤® à¨á®¢ âì ---- |
bt word ed_flags,1 |
jnc @f |
test word ed_flags,ed_focus |
je @f |
call .draw_cursor |
@@: |
call .draw_text |
79,80 → 93,93 |
popa |
ret |
;.str: |
; mov ecx,0x0a ;§ ¤ ¥âáï á¨á⥬ áç¨á«¥¨ï ¨§¬¥ïîâáï ॣ¨áâàë ebx,eax,ecx,edx ¢å®¤ë¥ ¯ à ¬¥âàë eax - ç¨á«® |
; ;¯à¥à¥¢®¤ ç¨á« ¢ ASCII áâப㠢§®¤ë¥ ¤ ë¥ ecx=á¨á⥬ áç¨á«¥ï edi ¤à¥á ªã¤ § ¯¨áë¢ âì, ¡ã¤¥¬ áâபã, ¯à¨ç¥¬ ª®¥æ ¯¥à¥¬¥®© |
; cmp eax,ecx ;áà ¢¨âì ¥á«¨ ¢ eax ¬¥ìè¥ ç¥¬ ¢ ecx â® ¯¥à¥©â¨ @@-1 â.¥. pop eax |
; jb @f |
; xor edx,edx ;®ç¨áâ¨âì edx |
; div ecx ;à §¤¥«¨âì - ®áâ ⮪ ¢ edx |
; push edx ;¯®«®¦¨âì ¢ á⥪ |
; ;dec edi ;ᬥ饨¥ ¥®¡å®¤¨¬®¥ ¤«ï § ¯¨á¨ á ª®æ áâப¨ |
; call .str;¯¥à¥©â¨ á ¬ã ᥡï â.¥. ¢ë§¢ âì á ¬ã á¥¡ï ¨ â ª ¤® ⮣® ¬®¬¥â ¯®ª ¢ eax ¥ á⠥⠬¥ìè¥ ç¥¬ ¢ ecx |
; pop eax |
; @@: ;cmp al,10 ;¯à®¢¥à¨âì ¥ ¬¥ìè¥ «¨ § 票¥ ¢ al 祬 10 (¤«ï á¨á⥬ë áç¨á«¥ï 10 ¤ ï ª®¬ ¤ - «¨è ï)) |
; ;sbb al,$69 ;- ç¥áâ® ¤ ï ¨áâàãªæ¨ï ¬¥ï § áâ ¢«ï¥â § ¤ã¬ âìáï â.¥. ï ¥ § î ª ª íâ® à ¡®â ¥â |
; ;das ;¯®á«¥ ¤ ®© ª®¬ ¤ë ª ª ¡ë ¯à®¨á室¨â 㬥ì襨¥ al 66h (¢ ª¨£¥ ¯¨á ® ¤à㣮¥) |
; or al,0x30 ;¤ ï ª®¬ ¤ ª®à®ç¥ 祬 ¤¢¥ ¢ëè¥ |
; stosb ;§ ¯¨á âì í«¥¬¥â ¨§ ॣ¨áâà al ¢ ï祪㠯 ¬ï⨠es:edi |
; |
; ret ;¢¥àãâìáï ç¥ì ¨â¥à¥áë© å®¤ â.ª. ¯®ª ¢ á⥪¥ åà ¨âìáï ª®«-¢® ¢ë§®¢®¢ â® á⮫쪮 à § ¬ë ¨ ¡ã¤¥¬ ¢ë§ë¢ âìáï |
;---------------------------------------------------------- |
;--- ¯à®æ¥¤ãà ¯à®à¨á®¢ª¨ ⥪áâ -------------------------- |
;---------------------------------------------------------- |
.draw_text: |
;--- ¢ëç¨á«ï¥¬, ᪮«ìª® ¯®¬¥é ¥âáï ᨬ¢®«®¢ --- |
;--- çâ®¡ë ¬ãá®à ¥ à¨á®¢ âì --- |
call .get_n |
;--- çâ®¡ë ¬ãá®à ¥ à¨á®¢ âì --- |
movsx esi,word ed_size |
sub si,ed_offset |
cmp ax,si |
ja @f |
mov si,ax |
@@: |
mov esi,ed_size |
mov ebx,ed_offset |
sub esi,ebx |
cmp eax,esi |
jae @F |
mov esi,eax ;çâ®¡ë ¥ ¢ë室¨âì § ¯à¥¤¥«ë íªà |
;--- à¨á㥬 ⥪áâ --- |
mov eax,4 |
mov bx,ed_left |
add bx,2 |
@@: mov eax,4 |
mov ebx,ed_left |
mov edx,ed_offset |
add ebx,2 |
shl ebx,16 |
mov bx,ed_top |
add bx,4 |
add ebx,4 |
mov ecx,ed_text_color |
movsx edx,word ed_offset |
add edx,ed_text |
int 0x40 |
ret |
;---------------------------------------------------------- |
;--- ¯à®æ¥¤ãà ¯à®à¨á®¢ª¨ ä® ---------------------------- |
;¢å®¤ë¥ ¤ ë¥ |
;eax |
;edx - color |
;---------------------------------------------------------- |
.draw_bg_eax: |
pusha |
movsx ebx,ax |
lea ebx,[ebx*2+ebx] |
shl bx,1 |
shl ebx,16 |
shr eax,16 |
lea eax,[eax*2+eax] |
shl ax,1 |
add ax,ed_left |
add ax,2 |
mov bx,ax |
ror ebx,16 |
mov ecx,ed_top |
add ecx,1 |
shl ecx,16 |
mov cx,13 |
mov eax,13 |
int 0x40 |
ret |
jmp @f |
.draw_bg: |
pusha |
mov bx,ed_left |
inc bx |
mov ebx,ed_left |
add ebx,1 |
shl ebx,16 |
mov bx,ed_width |
dec bx |
sub ebx,1 |
@@: |
mov cx,ed_top |
inc cx |
mov ecx,ed_top |
mov eax,13 |
add ecx,1 |
shl ecx,16 |
mov edx,ed_color |
mov cx,ed_height |
dec cx |
mov edx,ed_color |
mov eax,13 |
sub ecx,1 |
int 0x40 |
popa |
ret |
;---------------------------------------------------------- |
;--- ¯à®æ¥¤ãà ¯®«ãç¥¨ï ª®«¨ç¥á⢠ᨬ¢®«®¢ -------------- |
;--- ¯à®æ¥¤ãà ¯®«ãç¥¨ï ª®«¨ç¥á⢠ᨬ¢®«®¢ ¢ ⥪ã饩 é¨à¨¥ ª®¬¯®¥â -------------- |
;---------------------------------------------------------- |
.get_n: |
xor edx,edx |
movsx eax,word ed_width |
sub ax,4 |
mov bx,6 |
div bx |
mov eax,ed_width ;¯®«ã祬 è¨à¨ã ª®¬¯®¥â |
xor edx,edx ;१ã«ìâ â à ᯮ«®£ ¥âáï ¢ ¯ ॠedx:eax ¢ eax - ®áâ ⮪ |
sub eax,4 ;¢ëç⨬ 4 |
mov ebx,6 ;§ £à㧬¨ ¤¥«¨â¥«ì |
div ebx ;à §¬¤¥«¨¬ 6 |
ret |
;---------------------------------------------------------- |
160,26 → 187,40 |
;---------------------------------------------------------- |
.clear_cursor: |
mov edx,ed_color |
jmp @f |
test word ed_flags,ed_shift |
je @f |
mov edx,shift_color |
@@: |
mov ebx,cl_curs_x |
mov ecx,cl_curs_y |
jmp .draw_curs |
.draw_cursor: |
mov edx,ed_text_color |
@@: |
movsx ebx,word ed_pos |
sub bx,ed_offset |
;lea ebx,[ebx*2+ebx] |
;shl ebx,1 |
imul ebx,6 |
mov ebx,ed_pos |
mov ecx,ed_offset |
sub ebx,ecx |
lea ebx,[ebx*2+ebx] |
shl ebx,1 |
;imul ebx,6 |
add bx,ed_left |
inc bx |
push bx |
mov ecx,ed_top |
inc ebx |
add ecx,2 |
mov ebp,ebx |
shl ebx,16 |
pop bx |
mov cx,ed_top |
add cx,2 |
push cx |
mov bx,bp |
mov ebp,ecx |
shl ecx,16 |
pop cx |
mov cx,bp |
add cx,ed_height-4 |
mov cl_curs_x,ebx |
mov cl_curs_y,ecx |
.draw_curs: |
mov eax,38 |
int 0x40 |
ret |
189,349 → 230,547 |
;---------------------------------------------------------- |
.draw_border: |
;--- 梥â à ¬ª¨ --- |
bt word ed_flags,1 |
test dword ed_flags,ed_focus |
mov edx,ed_focus_border_color |
jc @f |
jne @f |
mov edx,ed_blur_border_color |
@@: |
;--- ᢥàåã --- |
mov bx,ed_left |
push bx |
mov eax,38 |
mov ebx,ed_left |
mov ecx,ebx |
shl ebx,16 |
pop bx |
mov bx,cx |
add bx,ed_width |
mov cx,ed_top |
push cx |
mov ecx, ed_top |
mov esi,ecx |
shl ecx,16 |
pop cx |
mov eax,38 |
mov cx,si |
int 0x40 |
;--- ᨧã --- |
push cx |
add cx,ed_height |
push cx |
mov esi,ecx |
add ecx,ed_height |
mov ebp,ecx |
shl ecx,16 |
pop cx |
mov cx,bp |
int 0x40 |
;--- á«¥¢ --- |
pop cx |
push bx |
mov cx,si |
mov ebp,ebx |
sub bx,ed_width |
int 0x40 |
;--- á¯à ¢ --- |
pop bx |
push bx |
mov ebx,ebp |
shl ebx,16 |
pop bx |
mov bx,bp |
int 0x40 |
ret |
;---------------------------------------------------------- |
;--- ¯à®¢¥àª , § 襫 «¨ ªãàá®à § £à ¨æë ¨, ¥á«¨ ¤®, --- |
;--- ¨§¬¥ï¥¬ ᬥ饨¥ ------------------------------------ |
;--- eax = 1, ¥á«¨ ¥ ¨§¬¥¨«®áì ¨«¨ eax = 0, ¥á«¨ |
;--- eax = -1, ¥á«¨ ¥ ¨§¬¥¨«®áì ¨«¨ eax = 0, ¥á«¨ |
; ¨§¬¥¨«®áì |
;---------------------------------------------------------- |
.check_offset: |
push word ed_offset |
call .get_n |
;--- ¯à ¢¥¥ --- |
mov bx,ed_offset |
add bx,ax |
cmp bx,ed_pos |
pushad |
mov ecx,ed_pos |
mov ebx,ed_offset |
cmp ebx,ecx |
ja .sub_8 |
push ebx |
call .get_n ;¯®«ã稬 ª®«-¢® ᨬ¢®«®¢ ¢ ¯ ॠॣ¨áâ஢ edx:eax |
pop ebx |
mov edx,ebx |
add edx,eax ;ed_offset+width editbox |
cmp edx,ecx |
ja @f |
mov bx,ed_pos |
mov cx,ax |
shr cx,2 |
sub bx,cx |
mov cx,ax |
shr cx,1 |
sub bx,cx |
mov ed_offset,bx |
mov edx,ed_size |
cmp edx,ecx |
je .add_end |
sub edx,ecx |
cmp edx,8 |
jbe .add_8 |
add ebx,8 |
jmp .chk_d |
.sub_8: cmp ecx,0 |
je .sub_min |
cmp ebx,8 |
jbe .sub_min |
sub ebx,8 ;ebx=ed_offset |
jmp .chk_d |
.sub_min: |
xor ebx,ebx |
jmp .chk_d |
.add_end:sub edx,eax |
mov ebx,edx |
jmp .chk_d |
.add_8: add ebx,edx |
; ;----------- ®â« ¤ª |
; pushad |
; mov [data_of_code],0 |
; mov eax,ebx;ed_offset |
; mov edi,data_of_code |
; call .str |
; ;à¨á®¢ ¨¥ ä® |
; mov eax,13 |
; mov ebx,178*65536+36 |
; mov ecx,28*65536+10 |
; xor edx,edx |
; int 0x40 |
; ;¢ë¢®¤ § 票ï íªà |
; mov eax,4 |
; mov ebx,180*65536+30 |
; mov ecx,0x10DDBBCC |
; mov edx,data_of_code |
; mov esi,4 |
; int 0x40 |
; popad |
; ;----------- ®â« ¤ª |
.chk_d: mov ed_offset,ebx |
call .draw_bg |
mov dword [esp+28],-1 |
popad |
ret |
@@: |
;--- «¥¢¥¥ --- |
mov bx,ed_offset |
cmp bx,ed_pos |
jb @f |
mov bx,ed_pos |
mov cx,ax |
shr cx,2 |
sub bx,cx |
jnc $+5 |
xor bx,bx |
mov ed_offset,bx |
@@: |
xor eax,eax |
pop bx |
cmp bx,ed_offset |
jne @f |
inc eax |
@@: |
mov dword [esp+28],0 |
popad |
ret |
;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
; mov ebx,eax |
; mov eax,ed_pos |
; xor edx,edx |
; idiv ebx |
; xor edx,edx |
; imul eax,ebx |
; mov ed_offset,eax |
; pop ebx |
; cmp ax,bx |
; je @f |
;;;;;;;; ¤ ë¥ ¤«ï § ªà 訢 ¨ï ¢á¥© ¯®«®áë ¯àאַ㣮«ì¨ª |
; mov ebx,ed_left |
; inc ebx |
; shl ebx,16 |
; mov bx,ed_width |
; dec ebx |
; mov edx,ed_color |
; call .draw_bg_eax |
; mov dword [esp+28],0 |
;@@: popad |
; ret |
;========================================================== |
;=== ®¡à ¡®âª ª« ¢¨ âãàë ================================= |
;========================================================== |
.key: |
pusha |
bt word ed_flags,1 ; ¥á«¨ ¥ ¢ 䮪ãá¥, ¢ë室¨¬ |
jc @f |
popa |
ret |
@@: |
test word ed_flags,ed_focus ; ¥á«¨ ¥ ¢ 䮪ãá¥, ¢ë室¨¬ |
je .no_figure ;@f |
xor ecx,ecx |
push eax |
inc ecx |
mov eax,66 |
mov ebx,3 |
int 0x40 |
test al,0x03 |
je @f |
or word ed_flags,ed_shift |
@@: pop eax |
;---------------------------------------------------------- |
;--- ¯à®¢¥à塞, çâ® ¦ â® -------------------------------- |
;---------------------------------------------------------- |
cmp ah,8 |
je .backspace |
jz .backspace |
cmp ah,0xb6 |
je .delete |
jz .delete |
cmp ah,176 |
je .left |
jz .left |
cmp ah,179 |
je .right |
jz .right |
cmp ah,180 |
je .home |
jz .home |
cmp ah,181 |
je .end |
jz .end |
cmp ah,185 ;insert |
jz .insert |
;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
; £«ãèª ®¡à ¡®âªã ª« ¢¨è ¢¢¥àå ¨ ¢¨§ |
;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
cmp ah,177 |
jz .no_figure |
cmp ah,178 |
jz .no_figure |
cmp ah,27 ;ESC - ª« ¢¨è )) |
jz .no_figure |
;--- ¦ â ¤àã£ ï ª« ¢¨è --- |
bt word ed_flags,15 ; ⮫쪮 æ¨äàë ? |
jnc @f |
test word ed_flags,ed_figure_only ; ⮫쪮 æ¨äàë ? |
jz @f |
cmp ah,'0' |
jb .no_figure |
cmp ah,'9' |
ja .no_figure |
jmp @f |
;¯à®¢¥àª shift |
@@: test word ed_flags,ed_shift_on |
je @f |
;å®¤ë¥ ¤ ë¥ edx=ed_size;ecx=ed_pos |
push eax |
mov edx,ed_size |
mov ecx,ed_pos |
call .del_char |
;;;; |
mov eax,ed_shift_pos |
mov ebx,ed_size |
sub ebx,eax |
mov ed_size,ebx |
pop eax |
; ¯à®¢¥à塞, 室¨âáï «¨ ªãàá®à ¢ ª®æ¥ |
@@: mov ecx,ed_size |
mov edx, ed_max |
cmp ecx,edx |
jae .no_figure |
mov ebx, ed_pos |
cmp ebx,edx |
jl @f ; ¥á«¨ ¬¥ìè¥ ¨«¨ à ¢® |
.no_figure: |
popa |
ret |
.insert: test word ed_flags,ed_insert ;not word ed_insert |
je .insert_1 |
and word ed_flags,ed_insert_cl |
jmp .no_figure |
.insert_1: |
or word ed_flags,ed_insert |
jmp .no_figure |
.ins_v: |
dec dword [ebp+38];ed_size ;processing is insert |
sub esi,ecx |
add esi,ebx |
mov edi,esi |
jmp .In_k |
@@: ; ᤢ¨£ ¥¬ ᨬ¢®«ë ¯®á«¥ ªãàá®à ¢¯à ¢® |
mov ecx,ed_size |
push edi eax |
mov ebp,edi |
mov esi,ed_text ; ª § â¥«ì ¡ãä¥à |
;㤥¬ à ¡®â âì á® áâப®© |
add esi,ecx ;add ed_size ¤®¡ ¢¨¬ max size |
mov edi,esi |
cmp ecx,ebx ; ᫨ ã á ¯®§¨æ¨ï ªãàá®à = ⥪ã饬ã à §¬¥àã ¯¥ç â ëå ᨬ¢®«®¢ â.¥. ªãàá®à á⮨⠢ ª®æ¥ |
je .In_k |
test word [ebp+36],ed_insert ;IF insert is enable â.ª. edi ¨§¬¥¥ ¤à¥á㥬 ç¥à¥§ ebp |
jne .ins_v |
sub ecx,ebx ; ©¤¥¬ ª®«-¢® ᨬ¢®«®¢ ¤«ï ¯¥à¥¤¢¨¦¥¨ï. |
inc edi ;¬¥á⨬ è¨ á¨¬¢®«ë ¢ ¯à ¢® |
std |
inc ecx |
@@: |
; ¯à®¢¥à塞, 室¨âáï «¨ ªãàá®à ¢ ª®æ¥ |
mov bx,ed_max |
cmp bx,ed_pos |
jne @f ; ¥á«¨ ¤ , ¢ ª®¥æ ¯à®æ¥¤ãàë |
;-------- |
lodsb |
stosb |
;-------- |
loop @b |
.In_k: cld |
pop eax |
mov al,ah |
stosb |
pop edi |
; ¢áâ ¢«ï¥¬ ª®¤ ª« ¢¨è¨ â㤠, £¤¥ ªãàá®à |
; 㢥«¨ç¨¢ ¥¬ § 票¥ à §¬¥à ¨ ¯®§¨æ¨¨ |
inc dword ed_size |
inc dword ed_pos |
call .draw_all2 |
jmp .shift;.draw_cursor_text |
.delete: |
mov edx,ed_size |
mov ecx,ed_pos |
cmp edx,ecx |
jg .bac_del |
test word ed_flags,ed_shift_on |
jne .del_bac |
popa |
ret |
@@: |
; ᤢ¨£ ¥¬ ᨬ¢®«ë ¯®á«¥ ªãàá®à ¢¯à ¢® |
mov edx,ed_text |
dec edx |
xor ecx,ecx |
mov cx,ed_size |
cmp cx,ed_pos |
.bac_del: |
call .del_char |
jmp .draw_all |
;--- ¦ â ª« ¢¨è backspace --- |
.backspace: |
; ¯à®¢¥à塞, ªãàá®à ã «¥¢®£® ªà ï ? |
mov edx,ed_size |
mov ecx,ed_pos |
test ecx,ecx |
jnz .del_bac |
test word ed_flags,ed_shift_on |
jne .bac_del |
popa |
ret |
.del_bac: |
cmp edx,ecx ;if ed_pos=ed_size |
je @f |
.mov_right_next: |
mov bh,[edx+ecx] |
mov [edx+ecx+1],bh |
dec cx |
cmp cx,ed_pos |
jne .mov_right_next |
@@: |
dec ecx |
call .del_char |
@@: test word ed_flags,ed_shift_on |
jne .bac_del |
dec dword ed_pos |
.draw_all: |
push .shift;.draw_cursor_text;eax |
; ¢áâ ¢«ï¥¬ ª®¤ ª« ¢¨è¨ â㤠, £¤¥ ªãàá®à |
mov edx,ed_text |
movsx ebx,word ed_pos |
mov [ebx+edx],ah |
test word ed_flags,ed_shift_on |
je @f |
mov eax,ed_shift_pos |
mov ebx,ed_size |
sub ebx,eax |
mov ed_size,ebx |
jmp .draw_all2 |
@@: dec dword ed_size |
.draw_all2: |
and word ed_flags,ed_shift_cl |
call .clear_cursor |
; 㢥«¨ç¨¢ ¥¬ § 票¥ à §¬¥à ¨ ¯®§¨æ¨¨ |
inc word ed_pos |
mov bx,ed_size |
cmp bx,ed_max |
je .draw_bg_cursor_text;.key_end_draw |
inc word ed_size |
;push word ed_offset |
call .check_offset |
;pop ax |
;cmp ax,ed_offset |
;jne .draw_bg_cursor_text |
;;;;;;;;;;;;;;; |
test eax,eax |
jz .draw_bg_cursor_text |
jne @f |
call .draw_bg |
ret |
;;;;;;;;;;;;;;; |
@@: call .get_n |
push eax |
mov ebx,ed_offset |
add eax,ebx ;eax = w_off= ed_offset+width |
mov ebx,ed_size |
call .get_n |
sub ax,ed_pos |
add ax,ed_offset |
inc ax |
shl eax,16 |
mov ax,ed_pos |
sub ax,ed_offset |
dec ax |
ror eax,16 |
call .draw_bg_eax |
cmp eax,ebx |
jb @f |
mov eax,ed_pos |
sub ebx,eax |
mov ecx,ed_offset |
sub eax,ecx |
jmp .nxt |
@@: mov ebx,ed_pos |
push ebx |
sub eax,ebx |
mov ebx,eax ;It is don't optimal |
jmp .draw_cursor_text |
pop eax ;ed_pos |
mov ecx,ed_offset |
sub eax,ecx |
;jmp .draw_cursor_text;.key_end_draw |
.nxt: |
mov ebp,eax ;¯à®¢¥àª ¢ë室 § ªà 訢 ¥¬®© ®¡« á⨠§ ¯à¥¤¥«ë ¤«¨ë |
add ebp,ebx |
pop edx |
cmp ebp,edx |
je @f |
inc ebx |
.delete: |
mov dx,ed_size |
mov cx,ed_pos |
;inc edx |
;add ecx,900 |
;sub ecx,1 |
cmp dx,cx |
jg @f |
popa |
@@: mov edx,ebx |
lea ebx,[eax*2+eax] |
shl ebx,1 |
add ebx,ed_left |
inc ebx |
shl ebx,16 |
lea ecx,[edx*2+edx] |
shl ecx,1 |
mov bx,cx |
mov edx,ed_color |
call .draw_bg_eax |
ret |
; jmp .shift |
;--- ¦ â ª« ¢¨è left --- |
.left: call .sh_enable |
mov ebx,ed_pos |
test ebx,ebx |
jz .nd_k |
call .clear_cursor |
dec dword ed_pos |
jmp .nd_k |
;--- ¦ â ª« ¢¨è right --- |
.right: call .sh_enable |
mov ebx,ed_pos |
cmp ebx,ed_size |
je .nd_k |
call .clear_cursor |
inc dword ed_pos |
jmp .nd_k |
.home: call .sh_enable |
mov ebx,ed_pos |
test ebx,ebx |
jz .nd_k |
call .clear_cursor |
xor eax,eax |
mov ed_pos,eax |
jmp .nd_k |
@@: |
mov edx,ed_text |
;dec edx |
.mov_stop_next: |
mov bh,[edx+ecx+1] |
mov [edx+ecx],bh |
inc cx |
mov bx,ed_size |
;dec bx |
;dec bx |
cmp cx,bx |
jne .mov_stop_next |
.end: call .sh_enable |
mov ebx,ed_pos |
cmp ebx,dword ed_size |
je .nd_k |
call .clear_cursor |
mov eax,ed_size |
mov ed_pos,eax |
.nd_k: call .check_offset |
;test eax,eax |
;jz .draw_bg_cursor_text |
call .draw_cursor |
; 㬥ìè ¥¬ § 票¥ ¯®§¨æ¨¨ ¨ à §¬¥à |
;dec word ed_pos |
dec word ed_size |
;push word ed_offset |
.shift: ;;;;;;;SHIFT |
call .draw_bg ;¥ ®¯â¨¬ «ì® |
test word ed_flags,ed_shift |
je .f_exit |
;;;;;;SHIFT end |
mov eax,dword ed_pos |
mov ebx,dword ed_shift_pos |
cmp eax,ebx |
jae .sh_n |
push eax ;¬¥ì襥 ¢ eax |
push ebx ;¡®«ì襥 |
jmp .sh_n1 |
;¥á«¨ ¨ ç¥ |
.sh_n: push ebx |
push eax |
.sh_n1: |
; jmp .draw_all2 |
;;;;;;;;;;;;;;;;;;;;;;;;; |
;call .clear_cursor |
call .check_offset |
;pop ax |
;cmp ax,ed_offset |
;jne .draw_bg_cursor_text |
test eax,eax |
jz .draw_bg_cursor_text |
call .get_n |
mov edx,eax ;size of ed_box |
; push eax |
mov ecx,ed_offset |
add eax,ecx ;eax = w_off= ed_offset+width |
mov ebp,eax ;save |
pop ebx ;¡®«ì襥 |
pop eax ;¬¥ì襥 |
call .get_n |
sub ax,ed_pos |
add ax,ed_offset |
shl eax,16 |
mov ax,ed_pos |
sub ax,ed_offset |
ror eax,16 |
cmp eax,ecx ;áà ¢¥¨¥ á ¬¥ì襣® á offset. |
jae .f_f ;¥á«¨ ¡®«ìè¥ |
xor eax,eax |
cmp ebp,ebx ;cà ¢¨¬ à §¬¥à w_off á ¡®«ì訬 |
jb @f |
sub ebx,ecx |
jmp .nxt_f |
@@: mov ebx,ebp |
sub ebx,ecx |
jmp .nxt_f |
.f_f: |
sub eax,ecx |
cmp ebp,ebx ;cà ¢¨¬ à §¬¥à w_off á ¡®«ì訬 |
jle @f |
sub ebx,ecx |
sub ebx,eax |
jmp .nxt_f |
@@: |
mov ebx,ebp |
sub ebx,ecx |
sub ebx,eax |
.nxt_f: |
mov edx,ebx |
lea ebx,[eax*2+eax] |
shl ebx,1 |
add ebx,ed_left |
inc ebx |
shl ebx,16 |
lea ecx,[edx*2+edx] |
shl ecx,1 |
mov bx,cx |
mov edx,shift_color |
call .draw_bg_eax |
and word ed_flags,1111111111111011b |
jmp .draw_cursor_text |
;;;;;;;;;;;;;;;;;;;;; |
.f_exit: and word ed_flags,ed_shift_cl |
jmp .draw_cursor_text |
popa |
ret |
;--- ¦ â ª« ¢¨è backspace --- |
.backspace: |
; ¯à®¢¥à塞, ªãàá®à ã «¥¢®£® ªà ï ? |
mov bx,ed_pos |
;cmp bx,0 |
;jne @f; .key_end ; ¥á«¨ ¤ , ¢ ª®¥æ |
test bx,bx |
jnz @f |
popa |
;¯à®¢¥àª á®áâ®ï¨ï shift ¡ë« «¨ ® ¦ â à ìè¥? |
.sh_enable: |
test word ed_flags,ed_shift |
je @f |
test word ed_flags,ed_shift_on |
jne .sh_ext_en |
push dword ed_pos |
pop dword ed_shift_pos |
or word ed_flags,ed_shift_on |
ret |
@@: |
; ᤢ¨£ ¥¬ ᨬ¢®«ë ¯®á«¥ ªãàá®à ¢«¥¢® |
mov edx,ed_text |
dec edx |
movsx ecx,word ed_pos |
@@: and word ed_flags,ed_shift_cl |
.sh_ext_en: ret |
.mov_left_next: |
mov bh,[edx+ecx+1] |
mov [edx+ecx],bh |
inc cx |
mov bx,ed_size |
inc bx |
cmp cx,bx |
jne .mov_left_next |
;- 㤠«¥¨¥ ᨬ¢®« |
;å®¤ë¥ ¤ ë¥ edx=ed_size;ecx=ed_pos |
.del_char: |
mov esi,ed_text |
test word ed_flags,ed_shift_on |
je @f |
mov eax,dword ed_shift_pos |
mov ebx,esi |
cmp eax,ecx |
jae .dh_n |
; 㬥ìè ¥¬ § 票¥ ¯®§¨æ¨¨ ¨ à §¬¥à |
dec word ed_pos |
dec word ed_size |
mov ed_pos,eax ;çâ® ¡ë ¥ ¡ë«® ã¡¥£ ¨ï ªãàá®à |
mov ebp,ecx |
sub ebp,eax |
add ebx,eax ;eax ¬¥ìè¥ |
sub edx,ecx |
add esi,ecx |
;push word ed_offset |
call .check_offset |
;pop ax |
;cmp ax,ed_offset |
;jne .draw_bg_cursor_text |
test eax,eax |
jz .draw_bg_cursor_text |
call .get_n |
sub ax,ed_pos |
add ax,ed_offset |
shl eax,16 |
mov ax,ed_pos |
sub ax,ed_offset |
ror eax,16 |
call .draw_bg_eax |
mov ed_shift_pos,ebp |
jmp .del_ch_sh |
;¥á«¨ ¨ ç¥ |
.dh_n: |
mov ebp,eax |
sub ebp,ecx |
add ebx,ecx |
sub edx,eax |
add esi,eax |
mov ed_shift_pos,ebp |
jmp .del_ch_sh |
jmp .draw_cursor_text |
popa |
ret |
@@: add esi,ecx ;㪠§ ⥫ì + ᬥ饨¥ ª ॠ«ì®¬ã ¡ãää¥àã |
mov ebx,esi |
inc esi |
cld |
;--- ¦ â ª« ¢¨è left --- |
.left: |
mov bx,ed_pos |
;cmp bx,0 |
;je @f |
test bx,bx |
jz @f |
call .clear_cursor |
dec word ed_pos |
call .check_offset |
test eax,eax |
jz .draw_bg_cursor_text |
call .draw_cursor |
@@: |
popa |
ret |
sub edx,ecx |
.del_ch_sh: |
;--- ¦ â ª« ¢¨è right --- |
.right: |
mov bx,ed_pos |
cmp bx,ed_size |
je @f |
call .clear_cursor |
inc word ed_pos |
call .check_offset |
test eax,eax |
jz .draw_bg_cursor_text |
call .draw_cursor |
push edi |
mov edi,ebx |
@@: |
popa |
ret |
lodsb |
stosb |
dec edx |
jns @b |
.home: |
mov bx,ed_pos |
test bx,bx |
jz @f |
call .clear_cursor |
xor eax,eax |
mov ed_pos,ax |
call .check_offset |
test eax,eax |
jz .draw_bg_cursor_text |
call .draw_cursor |
@@: |
popa |
pop edi |
ret |
.end: |
mov bx,ed_pos |
cmp bx,ed_size |
je @f |
call .clear_cursor |
mov ax,ed_size |
mov ed_pos,ax |
call .check_offset |
test eax,eax |
jz .draw_bg_cursor_text |
call .draw_cursor |
@@: |
popa |
ret |
;========================================================== |
;=== ®¡à ¡®âª ¬ëè¨ ======================================= |
;========================================================== |
546,15 → 785,9 |
;---------------------------------------------------------- |
;--- ¯à®¢¥à塞 á®áâ®ï¨¥ ---------------------------------- |
;---------------------------------------------------------- |
bt eax,0 |
jc .mouse_left_button |
bt eax,1 |
jc @f |
btr word ed_flags,2 |
@@: |
popa |
test eax,1 |
jnz .mouse_left_button |
@@: popa |
ret |
.mouse_left_button: |
561,10 → 794,7 |
;---------------------------------------------------------- |
;--- ¯®«ãç ¥¬ ª®®à¤¨ âë ¬ëè¨ ----------------------------- |
;---------------------------------------------------------- |
bts word ed_flags,2 |
jc .mouse_pressed |
mov eax,37 |
;mov ebx,1 |
xor ebx,ebx |
inc ebx |
int 0x40 |
571,7 → 801,7 |
;---------------------------------------------------------- |
;--- ¯à®¢¥à塞, ¯®¯ ¤ ¥â «¨ ªãàá®à ¢ edit box ------------- |
;---------------------------------------------------------- |
mov bx,ed_top |
mov ebx,ed_top |
cmp ax,bx |
jl ._blur;.mouse_end_no_focus |
588,7 → 818,6 |
add bx,ed_width |
cmp ax,bx |
jg ._blur;.mouse_end_no_focus |
;--- ¨§¬¥ï¥¬ ¯®§¨æ¨î ªãàá®à --- |
push eax |
call .clear_cursor |
605,40 → 834,29 |
@@: |
mov ed_pos,ax |
call .check_offset |
test eax,eax |
jz .draw_bg_cursor_text |
call .draw_cursor |
call .focus |
;---------------------------------------------------------- |
;--- ¯à®æ¥¤ãà ãáâ ®¢ª¨ 䮪ãá --------------------------- |
;---------------------------------------------------------- |
bts word ed_flags,1 |
jc .mouse_pressed |
call .draw_cursor |
call .draw_border |
.mouse_pressed: |
popa |
ret |
;.mouse_end_no_focus: |
; call .blur |
;popa |
;ret |
;---------------------------------------------------------- |
;--- ¯à®æ¥¤ãà ãáâ ®¢ª¨ 䮪ãá --------------------------- |
;---------------------------------------------------------- |
.blur: |
pusha |
;.blur: |
;pusha |
._blur: |
bt word ed_flags,14 |
jc @f |
btr word ed_flags,1 |
test word ed_flags,ed_always_focus |
jne @f |
btr word ed_flags,1 ; ¥á«¨ ¥ ¢ 䮪ãá¥, ¢ë室¨¬ |
jnc @f |
call .clear_cursor |
jmp .blur_end |
.focus: |
pusha |
bts word ed_flags,1 |
jc @f |
call .draw_cursor |
.blur_end: |
call .draw_border |
@@: |
popa |
650,7 → 868,7 |
;.blur: |
;pusha |
;._blur: |
;btr word ed_flags,1 |
;btr ed_flags,1 |
;jnc @f |
;call .draw_border |
;call .clear_cursor |
661,7 → 879,9 |
ed_figure_only=1000000000000000b |
ed_always_focus=100000000000000b |
ed_focus=10b |
ed_struc_size=36 |
ed_shift_on=1000b |
ed_shift=100b |
ed_shift_cl=1111111111110011b |
macro draw_edit_boxes start,end |
{ |
mov edi,start |
691,23 → 911,26 |
add edi,ed_struc_size |
loop @b |
} |
ed_struc_size=62 |
struc edit_box width,left,top,color,focus_border_color,\ |
blur_border_color,text_color,max,text,flags,size |
{ |
.width dw width |
.left dw left |
.top dw top |
.width dd width |
.left dd left |
.top dd top |
.color dd color |
.focus_border_color dd focus_border_color |
.blur_border_color dd blur_border_color |
.text_color dd text_color |
.max dd max |
.text dd text |
.flags dw flags+0 |
.max dw max |
.size dw size+0 |
.pos dw 0 |
.offset dw 0 |
.text dd text |
.size dd size+0 |
.pos dd 0 |
.offset dd 0 |
.cl_curs_x dd 0 |
.cl_curs_y dd 0 |
.shift dd 0 |
} |
macro edit_boxes_set_sys_color start,end,color_table |
/programs/media/scrshoot/gp.inc |
---|
1,5 → 1,3 |
macro use_gp |
{ |
;esi - screen size |
;edi - pointer to image |
csi_width equ [esi+2] |
6,6 → 4,8 |
csi_height equ [esi] |
csi_bitspp equ [esi+4] |
csi_bytesps equ [esi+6] |
copy_screen_to_image: |
pusha |
xor edx,edx |
12,6 → 12,9 |
xor ecx,ecx |
xor ebx,ebx |
bt dword [use_rect.flags],1 |
jc copy_area |
cmp csi_bitspp,word 24 |
je .next_str_24 |
60,4 → 63,32 |
jl .next_str_24 |
popa |
ret |
} |
copy_area: |
mov eax,[scr.bytesps] |
mov ebx,eax |
movzx ecx,word [rect.top] |
mul ecx |
movzx ecx,word [rect.width] |
shl ecx,2 |
sub ebx,ecx |
movzx ecx,word [rect.left] |
shl ecx,2 |
add eax,ecx |
movzx ecx,word [rect.height] |
mov edx,eax |
.next_str: |
movzx esi,word [rect.width] |
.next_pixel: |
mov eax,[gs:edx] |
mov [edi],ax |
shr eax,8 |
mov [edi+2],ah |
add edx,4 |
add edi,3 |
dec esi |
jnz .next_pixel |
add edx,ebx |
loop .next_str |
popa |
ret |
/programs/media/scrshoot/macros.inc |
---|
1,7 → 1,7 |
;--- ¤à㣨¥ ¬ ªà®áë --- |
include 'editbox.inc' |
include 'txtbut.inc' |
include 'gp.inc' |
;include 'gp.inc' |
include 'label.inc' |
;include 'checkbox.inc' |
include 'check.inc' |
167,7 → 167,7 |
int 0x40 |
} |
macro get_scin_height |
macro get_skin_height |
{ |
movr eax,48 |
movr ebx,4 |
347,4 → 347,8 |
;--- 梥â --- |
cl_white=0xffffff |
cl_black=0x000000 |
cl_black=0x000000 |
;============================================================================== |
;============== ®áâ âë ===================================================== |
;============================================================================== |
/programs/media/scrshoot/readme.txt |
---|
1,7 → 1,7 |
¢â®à ¤®ªã¬¥â ¨ ¯à®£à ¬¬ë: ¢â¨å®¢ ªá¨¬ (Maxxxx32) |
« £®¤ à®áâ¨: |
à âã ª¨ï®¢ã (Mario79) § ¯®¬®éì, ᮢ¥âë, ªà¨â¨ªã; |
¢á¥¬ ãç á⨪ ¬ ¯à®¥ªâ . |
¢á¥¬ ãç á⨪ ¬ ¯à®¥ªâ KolibriOS. |
Screenshooter - ¯à®£à ¬¬ , ¯à¥¤ § ç¥ ï ¤«ï ä®â®£à ä¨à®¢ ¨ï íªà ¨ |
á®åà ¥¨ï ä®â®£à 䨨 ¢¢¨¤¥ ä ©« BMP. |
/programs/media/scrshoot/scrsavef.inc |
---|
45,6 → 45,21 |
jmp .next |
.str_end: |
; ëç¨á«ï¥¬, ᪮«ìª® ¡ ©â 㦮 ¯à¨¡ ¢«ïâì ª ª ¦¤®© áâப¥, |
; ç⮡ë á«¥¤ãîé ï ¡ë« ¢ëà ¢¥ 4 ¡ ©â . |
; ¥§ã«ìâ â ¯®¬¥é ¥¬ ¢ edi. |
xor edx,edx |
movzx eax,word [scr_buf.width] ; eax = è¨à¨ ª à⨪¨ |
lea eax,[eax*3] ; eax = ¡ ©â áâப㠪 à⨪¨ |
movr ebx,4 ; ebx = 4 |
mov edi,ebx ; edi = 4 |
div ebx ; eax = ¡ ©â áâப㠪 à⨪¨ div 4 edx = ¡ ©â... mod 4 |
sub edi,edx ; edi = ª®«¨ç¥á⢮ ¡ ©â |
test edx,edx |
jnz @f |
xor edi,edi |
@@: |
; ¢ë¤¥«ï¥¬ ¯ ¬ïâì |
mov ecx,[scr_buf.end_ptr] |
mov [sf_buf.bmp_header],ecx |
52,8 → 67,10 |
mov [sf_buf.bmp_area],ecx |
movsx ebx,word [scr_buf.width] |
movsx edx,word [scr_buf.height] |
;imul ebx,edx |
lea ebx,[ebx*3] |
add ebx,edi |
imul ebx,edx |
lea ebx,[ebx*3] |
add ecx,ebx |
mov [sf_buf.end],ecx |
add ecx,4096 |
62,6 → 79,7 |
movr eax,64 |
int 0x40 |
push edi |
; § ¯®«ï¥¬ áâàãªâãàã ¤«ï á®åà ¥¨ï ä ©« |
mov edi,fs_struc |
mov [edi],dword 2 |
82,37 → 100,58 |
add ebx,0x36 |
mov [edi+2],ebx ; à §¬¥à ä ©« |
mov [edi+14],dword 0x28 |
movsx eax,word [scr_buf.width] |
movzx eax,word [scr_buf.width] |
mov [edi+18],eax ; £®à¨§®â «ìë© à §¬¥à |
movsx eax,word [scr_buf.height] |
movzx eax,word [scr_buf.height] |
mov [edi+22],eax ; ¢¥à⨪«ìë© à §¬¥à |
mov [edi+26],word 1 |
mov [edi+28],word 24 |
; ª®¯¨à㥬 ¨ ¯¥à¥¢®à 稢 ¥¬ |
mov esi,[scr_buf.ptr] |
; mov esi,[scr_buf.ptr] |
; mov edi,[sf_buf.bmp_area] |
; mov edx,[sf_buf.end] |
; sub edx,edi |
; movsx ecx,word [scr_buf.height] |
;.next_str: |
;push ecx |
; |
; movsx ecx,word [scr_buf.width] |
; lea ecx,[ecx*3] |
; mov ebx,ecx |
;.next_byte: |
; mov ah,[esi+ebx] |
; mov [edi+edx],ah |
; dec ebx |
; dec edx |
; loop .next_byte |
; movsx ecx,word [scr_buf.width] |
; lea ecx,[ecx*3] |
; add esi,ecx |
;pop ecx |
; loop .next_str |
mov esi,[scr_buf.end_ptr] |
mov edi,[sf_buf.bmp_area] |
mov edx,[sf_buf.end] |
sub edx,edi |
movsx ecx,word [scr_buf.height] |
movzx ecx,word [scr_buf.height] |
movzx ebx,word [scr_buf.width] |
lea ebx,[ebx*3] |
add edi,ebx |
.next_str: |
push ecx |
movsx ecx,word [scr_buf.width] |
lea ecx,[ecx*3] |
mov ebx,ecx |
.next_byte: |
mov ah,[esi+ebx] |
mov [edi+edx],ah |
dec ebx |
mov edx,ebx |
.next_pixel: |
mov ah,[esi] |
mov [edi],ah |
dec esi |
dec edi |
dec edx |
loop .next_byte |
movsx ecx,word [scr_buf.width] |
lea ecx,[ecx*3] |
add esi,ecx |
pop ecx |
jnz .next_pixel |
lea edi,[2*ebx+edi] |
add edi,[esp] |
loop .next_str |
pop edi |
; á®åà 塞 |
draw_status saving |
mov eax,70 |
126,6 → 165,7 |
call draw_number |
draw_status saved_ok |
popa |
ret |
/programs/media/scrshoot/scrshoot.asm |
---|
1,5 → 1,6 |
; ¢â®à ¯à®£à ¬¬ë ¢â¨å®¢ ªá¨¬ (Maxxxx32) |
; â ¯®á«¥¤¥£® ¨§¬¥¥¨ï: 20.07.06 18:05 |
; 01.02.07 - ®¡®¢«ñ editbox |
; 31.01.07 - ¢áñ ⥯¥àì à¨áã¥âáï ®â®á¨â¥«ì® ª«¨¥â᪮© ®¡« á⨠|
macro draw_status text_ptr |
{ |
mov [status.text],dword text_ptr |
7,8 → 8,7 |
} |
title equ 'Maxxxx32 Screenshooter v 0.78' ; £®«®¢®ª ®ª |
include 'lang.inc' |
title equ 'Screenshooter v 0.9' ; £®«®¢®ª ®ª |
include 'macros.inc' ; ¢áâ ¢«ï¥¬ ¬ ªà®áë |
meos_header cmdstr ; ¢áâ ¢«ï¥¬ § £®«®¢®ª ¯à®£à ¬¬ë |
include 'scrwin.inc' ; ¢áâ ¢«ï¥¬ ª®¤ ®ª ¯à¤¯à®á¬®âà |
15,12 → 15,14 |
include 'scrsavef.inc'; ¢áâ ¢«ï¥¬ ¯à®æ¥¤ãàã á®åà ¥¨ï ä ©« |
use_edit_box ; \ |
use_txt_button ; | |
use_label ; | |
use_gp ; |-- GUI ª®¬¯®¥âë ¨ ¥ª®â®àë¥ ¯à®æ¥¤ãàë |
use_label ; |-- GUI ª®¬¯®¥âë ¨ ¥ª®â®àë¥ ¯à®æ¥¤ãàë |
use_check_box ; | |
use_text_work ; / |
include 'gp.inc' |
include 'srectwin.inc' |
;--- ç «® ¯à®£à ¬¬ë --- |
app_start |
;mov al,[gs:1280*4*1024] |
; ãáâ ¢«¨¢ ¥¬ ipc ¡ãää¥à |
push 60 |
pop eax |
106,6 → 108,15 |
p_close: |
btr dword [flags],1 |
bt dword [flags],3 |
jnc @f |
movr eax,18 |
mov ebx,eax |
mov ecx,[set_rect_window_pid] |
int 0x40 |
@@: |
close: |
app_close |
114,29 → 125,19 |
;-------------------------------------------------------------------- |
draw_window: |
start_draw_window ; ç «® ¯¥à¥à¨á®¢ª¨ |
xor eax,eax ; ®¯à¥¤¥«ï¥¬ ®ª® |
; ®¯à¥¤¥«ï¥¬ ®ª® |
get_skin_height |
mov ebx,100*65536+320 |
mov ecx,100*65536+240 |
mov ecx,100*65536+220 |
add cx,ax |
mov edx,[sc.work] |
add edx,0x03000000 |
add edx,0x33000000;0x33000000 |
xor esi,esi |
xor edi,edi |
;xor edi,edi |
mov edi,grab_text |
xor eax,eax |
int 0x40 |
get_scin_height ; ¯®«ãç ¥¬ ¢ëá®âã § £®«®¢ª ®ª ¨ à áç¨âë¢ ¥¬ |
sub ax,4 ; ¯®«®¦¥¨¥ ⥪áâ § £®«®¢ª |
shr ax,1 |
mov bx,10 |
shl ebx,16 |
mov bx,ax |
mov eax,4 ; à¨á㥬 ⥪áâ § £®®«®¢ª |
mov ecx,[sc.grab_text] |
bts ecx,28 |
mov edx,grab_text |
mov esi,grab_text_end-grab_text |
int 0x40 |
movr eax,47 ; ¢ë¢®¤¨¬ ç¨á« ¢ ®ª® |
mov bx,4 |
shl ebx,16 |
193,7 → 194,13 |
mov edi,[scr_buf.ptr] |
call copy_screen_to_image |
bt dword [use_rect.flags],1 |
jc .use_rect |
push dword [scr] |
jmp @f |
.use_rect: |
push dword [rect.height] |
@@: |
pop dword [scr_buf.size] |
bt dword [ch5.flags],1 ; ¢ª«î祮 «¨ ¢â®á®åà ¥¨¥ ? |
220,10 → 227,19 |
@@: |
ret |
;--- ¯®«ãç¨âì ¯ ¬ïâì ¤«ï ᨬª --- |
get_mem_for_shoot: |
mov [scr_buf.ptr],dword __app_end |
movsx ecx, word [scr.width] |
movsx ebx, word [scr.height] |
bt dword [use_rect.flags],1 ; ä®âª âì ®¡« áâì íªà |
jc .use_area |
movzx ecx, word [scr.width] |
movzx ebx, word [scr.height] |
jmp @f |
.use_area: |
call read_rect |
movzx ecx, word [rect.width] |
movzx ebx, word [rect.height] |
@@: |
imul ecx,ebx |
lea ecx,[ecx*3] |
add ecx,__app_end |
263,7 → 279,7 |
call zstr_to_int |
mov [sign_n],al |
movr eax,13 |
mov ebx,140*65536+96 |
mov ebx,150*65536+96 |
mov cx,[label9.top] |
shl ecx,16 |
mov cx,10 |
273,7 → 289,7 |
movsx bx,byte [sign_n] |
shl ebx,16 |
mov ecx,[cur_number] |
mov dx,140 |
mov dx,150 |
shl edx,16 |
mov dx,[label9.top] |
mov esi,[sc.work_text] |
319,14 → 335,14 |
; (¤®«¦ ¢ë§ë¢ âìáï ¯®â®ª®¬ £« ¢®£® ®ª ) |
dr_st: |
movr eax,38 ; ®â१®ª |
mov ebx,5*65536+315 |
mov ecx,222*65536+222 |
mov ebx,0*65536+310 |
mov ecx,198*65536+198 |
mov edx,[sc.work_graph] |
int 0x40 |
movr eax,13 ; ¯®«®áª |
mov bx,310 |
mov ecx,223*65536+12 |
mov ecx,199*65536+15 |
mov edx,[sc.work] |
int 0x40 |
343,22 → 359,24 |
dec ecx |
int 0x40 |
mov edx,[app.pid] |
mov edx,[ebx+30] |
xor ecx,ecx |
@@: |
movr eax,9 |
inc ecx |
int 0x40 |
cmp [app.pid],edx |
cmp [ebx+30],edx |
je @f |
jmp @b |
@@: |
ret |
;--- ¯à®æ¥¤ãà , § ¯ã᪠îé ï ¯®â®ª, ¤¥« î騩 1 ᨬ®ª --- |
one_shoot: |
mov ecx,one_shoot_thread |
mov edx,shoot_esp |
jmp @f |
;--- ¯à®æ¥¤à , § ¯ã᪠îé ï ¯®â®ª, á®åà ïî騩 ᨬ®ª --- |
save_shoot: |
mov ecx,save_shoot_thread |
mov edx,shoot_esp |
376,6 → 394,7 |
.running: |
ret |
;--- ¯®â®ª, ¤¥« î騩 1 ᨬ®ª --- |
one_shoot_thread: |
mov ecx,[slot_n] |
activ_window |
392,6 → 411,8 |
btr dword [flags],2 |
jmp close |
;--- ¯à®æ¥¤ãà , ®â¯à ¢«ïîé ï £« ¢®¬ã ®ªã á®®¡é¥¨¥ ® ¯¥à¥à¨á®¢ª¥ |
; áâப¨ á®áâ®ï¨ï --- |
send_draw_status: |
movr eax,60 |
movr ebx,2 |
401,6 → 422,7 |
int 0x40 |
ret |
;--- ¯®â®ª, á®åà ï ä ©« --- |
save_shoot_thread: |
mov ecx,[slot_n] |
activ_window |
408,6 → 430,40 |
btr dword [flags],2 |
jmp close |
;--- ¯à®æ¥¤ãà , § ¯ã᪠îé ï ¯®â®ª ®ª ãáâ ®¢ª¨ ®¡« á⨠áꥬª¨ --- |
show_set_rect_window: |
bts dword [flags],3 |
jc @f |
movr eax,51 |
xor ebx,ebx |
inc ebx |
mov ecx,set_rect_window |
mov edx,set_rect_window_esp |
int 0x40 |
mov [set_rect_window_pid],eax |
ret |
@@: |
movr eax,18 |
mov ebx,eax |
mov ecx,[set_rect_window_pid] |
int 0x40 |
btr dword [flags],3 |
ret |
;--- ¯®«ã票¥ ¨ä®à¬ 樨 ®¡ ªâ¨¢®¬ ®ª¥ --- |
get_active_window_info: |
movr eax,18 |
movr ebx,7 |
int 0x40 |
mov ecx,eax |
movr eax,9 |
mov ebx,active_app |
int 0x40 |
ret |
;==================================================================== |
;=== ¤ ë¥ ¯à®£à ¬¬ë =============================================== |
;==================================================================== |
418,77 → 474,81 |
grab_text: |
db title |
grab_text_end: |
db title,0 |
labels: |
label1 label 10,30,0,text.1 ; ¢ëá®â íªà |
label2 label 10,40,0,text.2 ; è¨à¨ íªà |
label3 label 10,50,0,text.3 ; ¢¢¥¤¨â¥ ¨¬ï ä ©« |
label4 label 150,30,0,text.4 ; ¡¨â ¯¨ªá¥«ì |
label5 label 150,40,0,text.5 ; ¡ ©â áâபã |
label6 label 120,163,0,text.6 |
label1 label 5,5,0,text.1 ; è¨à¨ íªà |
label2 label 5,15,0,text.2 ; ¢ëá®â íªà |
label3 label 5,25,0,text.3 ; ¢¢¥¤¨â¥ ¨¬ï ä ©« |
label4 label 150,5,0,text.4 ; ¡¨â ¯¨ªá¥«ì |
label5 label 150,15,0,text.5 ; ¡ ©â áâபã |
label6 label 115,138,0,text.6 ; 100 = 1 ᥪ. |
;label7 label 10,190,0,text.7 |
;label8 label 10,225,0,text.8 |
label9 label 10,78,0,text.9 ; ⥪ã騩 |
label10 label 10,210,0,text.10 |
status label 10,226,0,no_shoot |
label9 label 5,52,0,text.9 ; ®¬¥à ⥪ã饣® ᨬª |
label10 label 5,185,0,text.10 |
status label 5,201,0,no_shoot |
labels_end: |
editboxes: |
edit1 edit_box 300,10,60,cl_white,0,0,0,1024,ed_buffer.1,ed_focus |
edit2 edit_box 35,80,159,cl_white,0,0,0,9,ed_buffer.2,ed_figure_only |
edit3 edit_box 35,170,189,cl_white,0,0,0,9,ed_buffer.3,ed_figure_only |
edit4 edit_box 16,170,206,cl_white,0,0,0,1,sign_n_input,ed_figure_only,1 |
edit1 edit_box 300,5,35,cl_white,0,0,0,1024,ed_buffer.1,ed_focus ; ¯ãâì ª ä ©«ã |
edit2 edit_box 35,75,134,cl_white,0,0,0,9,ed_buffer.2,ed_figure_only ; § ¤¥à¦ª |
edit3 edit_box 35,165,164,cl_white,0,0,0,9,ed_buffer.3,ed_figure_only |
edit4 edit_box 16,165,181,cl_white,0,0,0,1,sign_n_input,ed_figure_only,1 |
editboxes_end: |
buttons: |
but1 txt_button 150,10,15,90,2,0,0,but_text.1,one_shoot |
but2 txt_button 145,165,15,90,3,0,0,but_text.2,save_shoot |
but3 txt_button 140,120,12,145,4,0,0,but_text.3,show_scr_window |
but4 txt_button 80,210,15,188,5,0,0,but_text.4,apply_number |
but5 txt_button 150,10,15,110,6,0,0,but_text.5,start_autoshoot |
but6 txt_button 145,165,15,110,7,0,0,but_text.6,stop_autoshoot |
but1 txt_button 150,5,15,65,2,0,0,but_text.1,one_shoot ; ᤥ« âì ᨬ®ª |
but2 txt_button 145,160,15,65,3,0,0,but_text.2,save_shoot ; á®åà ¨âì ᨬ®ª |
but3 txt_button 140,115,12,120,4,0,0,but_text.3,show_scr_window ; ¯®ª § âì ᨬ®ª |
but4 txt_button 80,205,15,163,5,0,0,but_text.4,apply_number ; ¯à¨¬¥¨âì ®¬¥à |
but5 txt_button 150,5,15,85,6,0,0,but_text.5,start_autoshoot ; ç âì ¢â®áêñ¬ªã |
but6 txt_button 145,160,15,85,7,0,0,but_text.6,stop_autoshoot ; ®áâ ®¢¨âì ¢â®áêñ¬ªã |
but7 txt_button 40,205,10,150,8,0,0,but_text.7,show_set_rect_window ; § ¤ âì ®¡« áâì |
buttons_end: |
check_boxes: |
ch1 check_box 10,130,cl_white,0,0,ch_text.1,(ch_text.2-ch_text.1) |
ch2 check_box 10,145,cl_white,0,0,ch_text.2,(ch_text.3-ch_text.2) |
ch3 check_box 150,130,cl_white,0,0,ch_text.3,(ch_text.4-ch_text.3) |
ch4 check_box 10,160,cl_white,0,0,ch_text.4,(ch_text.5-ch_text.4) |
ch5 check_box 10,175,cl_white,0,0,ch_text.5,(ch_text.6-ch_text.5) |
ch6 check_box 10,190,cl_white,0,0,ch_text.6,(ch_text.7-ch_text.6) |
ch1 check_box 5,105,cl_white,0,0,ch_text.1,(ch_text.2-ch_text.1) ; ᢥàãâì ®ª® |
ch2 check_box 5,120,cl_white,0,0,ch_text.2,(ch_text.3-ch_text.2) ; § ⥬ ᤥ« âì ªâ¨¢ë¬ |
ch3 check_box 145,105,cl_white,0,0,ch_text.3,(ch_text.4-ch_text.3) ; ¯®ª § âì ᨬ®ª |
ch4 check_box 5,135,cl_white,0,0,ch_text.4,(ch_text.5-ch_text.4) ; |
ch5 check_box 5,150,cl_white,0,0,ch_text.5,(ch_text.6-ch_text.5) |
ch6 check_box 5,165,cl_white,0,0,ch_text.6,(ch_text.7-ch_text.6) |
use_rect check_box 145,150,cl_white,0,0,ch_text.7,(ch_text.8-ch_text.7) ; ¨á¯. ®¡« áâì |
; ¢â®ã¬¥à æ¨ï |
check_boxes_end: |
if lang eq ru |
text: |
.2: db 'ëá®â íªà :',0 |
.1: db '¨à¨ íªà :',0 |
.3: db '¢¥¤¨â¥ ¯®«ë© ¯ãâì ª ä ©«ã:',0 |
.4: db '¨â ¯¨ªá¥«ì:',0 |
.5: db ' ©â áâபã:',0 |
.6: db '100 = 1 ᥪ㤠',0 |
.2 db 'ëá®â íªà :',0 |
.1 db '¨à¨ íªà :',0 |
.3 db '¢¥¤¨â¥ ¯®«ë© ¯ãâì ª ä ©«ã:',0 |
.4 db '¨â ¯¨ªá¥«ì:',0 |
.5 db ' ©â áâபã:',0 |
.6 db '100 = 1 ᥪ㤠',0 |
;.7: db '¢¥¤¨â¥ ¨¬ï ä ©« :',0 |
;.8: db '¬¥áâ® "*" ¢ ¨¬¥¨ ä ©« ¡ã¤¥â ¢áâ ¢«ïâìáï ®¬¥à.',0 |
.9: db '¥ªã騩 ®¬¥à ᨬª :',0 |
.10: db '®«¨ç¥á⢮ § ª®¢ ¢ ®¬¥à¥:',0 |
.9 db '®¬¥à ⥪ã饣® ᨬª :',0 |
.10 db '®«¨ç¥á⢮ § ª®¢ ¢ ®¬¥à¥:',0 |
but_text: |
.1: db '¤¥« âì ᨬ®ª íªà ',0 |
.2: db '®åà ¨âì ᨬ®ª íªà ',0 |
.3: db '®ª § âì ᨬ®ª ᥩç á',0 |
.4: db 'ਬ¥¨âì',0 |
.5: db ' ç âì ¢â®áꥬªã',0 |
.6: db 'áâ ®¢¨âì ¢â®áꥬªã',0 |
.1 db '¤¥« âì ᨬ®ª íªà ',0 |
.2 db '®åà ¨âì ᨬ®ª íªà ',0 |
.3 db '®ª § âì ᨬ®ª ᥩç á',0 |
.4 db 'ਬ¥¨âì',0 |
.5 db ' ç âì ¢â®áꥬªã',0 |
.6 db 'áâ ®¢¨âì ¢â®áꥬªã',0 |
.7 db '§ ¤ âì',0 |
ch_text: |
.1 db '¢¥àãâì ®ª®';,0 |
.2 db '®ª § âì ᨬ®ª';,0 |
.3 db '§ ⥬ ᤥ« âì ªâ¨¢ë¬';,0 |
.4: db ' ¤¥à¦ª :';,0 |
.5: db '¢â®á®åà ¥¨¥';,0 |
.6: db '¢â®ã¬¥à æ¨ï, ç¨ ï á';,0 |
.7: |
.4 db ' ¤¥à¦ª :';,0 |
.5 db '¢â®á®åà ¥¨¥';,0 |
.6 db '¢â®ã¬¥à æ¨ï, ç¨ ï á';,0 |
.7 db '¡« áâì' |
.8: |
no_shoot db '¨¬®ª ¥ ᤥ« ',0 |
shooting db '®â®£à ä¨à®¢ ¨¥...',0 |
503,6 → 563,7 |
device_er db '訡ª ãáâனá⢠',0 |
not_shooted db '¤¥« ©â¥ ᨬ®ª !!!',0 |
no_file_name db '¢¥¤¨â¥ ¨¬ï ä ©« !!!',0 |
invalid_rect db '¥¤®¯ãáâ¨¬ë¥ à §¬¥àë ®¡« áâ¨',0 |
end if |
sign_n_input: |
538,6 → 599,15 |
.bmp_area dd ? |
.end dd ? |
set_rect_window_pid dd ? |
set_rect_window_slot dd ? |
rect_input_buffer: |
.left rb 6 |
.top rb 6 |
.width rb 6 |
.height rb 6 |
cmdstr rb 257 |
ed_buffer: |
549,7 → 619,17 |
rb 1058 |
scr screen_prop |
rect: |
.left dw ? |
.top dw ? |
.height dw ? |
.width dw ? |
sc sys_color_table |
app procinfo |
shoot_esp rb 512 |
app procinfo ; ¨ä®à¬ æ¨ï ® £« ¢®¬ ®ª¥ |
active_app procinfo ; ¨ä®à¬ æ¨ï ®¡ ªâ¨¢®¬ ®ª¥ |
set_rect_window_procinfo procinfo ; ¨ä®à¬ æ¨ï ®¡ ®ª¥ ®¡« á⨠|
shoot_esp rb 512 ; á⥪ ¯®â®ª ä®âª ìï |
set_rect_window_esp rb 512 ; á⥪ ®ª ®¡« á⨠|
app_end ; ª®¥æ ¯à®£à ¬¬ë |
/programs/media/scrshoot/scrwin.inc |
---|
1,3 → 1,6 |
;==================================================================== |
;===== =========================================== |
;==================================================================== |
scr_window: |
.start: |
.red: |