2,9 → 2,7 |
;-------------interraction MOUSE-------------- |
;--------------------------------------------- |
mouse: |
|
call GetMouseCoordinats |
|
;panel |
mov edx,[Window_SizeX] |
sub edx,5 |
22,23 → 20,19 |
jae no_panel |
|
call GetMouseCoordinats |
|
mov [counter],7 |
mov edi,panel_text |
call panel_interraction |
jmp panel_interraction |
|
jmp still |
no_panel: |
|
cmp [Panel_flag],0 |
jz no_redraw_panel |
|
mov [counter],7 |
mov edi,panel_text |
call panel_interraction |
jmp panel_interraction |
|
no_redraw_panel: |
|
call GetMouseCoordinats |
mov eax,[MouseX] |
mov ebx,[MouseY] |
52,16 → 46,12 |
|
cmp ebx,edx |
jae mouse_scroll |
|
jmp no_scrollers |
|
mouse_scroll: |
|
mov [exit_from_work_arrea],1 ;mouse situated after work arrea |
|
;scrollers |
call GetMouseClick |
|
cmp eax,1 |
jne no_click |
|
74,11 → 64,9 |
mov esi,[Scroll1MaxSizeX] |
mov edi,[Scroll1MaxSizeY] |
call columnus |
|
test eax,eax |
jz no_horizontal |
|
|
mov eax,9 |
mov ebx,[Scroll1CoordinatY] |
mov ecx,[Scroll1MaxSizeX] |
96,7 → 84,6 |
mov edx,8+1 |
add edx,[Scroll1MaxSizeX] |
mov [Scroll1CoordinatX],eax |
|
sub eax,9 |
jns no_min_scroll |
|
103,7 → 90,6 |
mov [Scroll1CoordinatX],9 |
|
no_min_scroll: |
|
cmp ecx,edx |
jl no_max_scroll |
|
112,7 → 98,6 |
mov [Scroll1CoordinatX],edx |
|
no_max_scroll: |
; |
mov eax,[Scroll1CoordinatX] |
sub eax,9 |
mov ebx,[Picture_SizeX] |
121,11 → 106,9 |
cdq |
idiv ebx |
mov [PosX],eax |
|
jmp no_vertical |
|
no_horizontal: |
|
mov eax,[Scroll2CoordinatX] |
mov ebx,[Scroll2CoordinatY] |
mov ecx,[MouseX] |
133,7 → 116,6 |
mov esi,[Scroll2MaxSizeX] |
mov edi,[Scroll2MaxSizeY] |
call columnus |
|
test eax,eax |
jz no_vertical |
|
161,7 → 143,6 |
mov [Scroll2CoordinatY],89 |
|
no_min_scroll2: |
|
cmp ecx,edx |
jl no_max_scroll2 |
|
170,7 → 151,6 |
mov [Scroll2CoordinatY],edx |
|
no_max_scroll2: |
; |
mov eax,[Scroll2CoordinatY] |
sub eax,89 |
mov ebx,[Picture_SizeY] |
181,18 → 161,14 |
mov [PosY],eax |
|
no_vertical: |
|
call CalculatePositionScreen |
|
call draw_scrollers |
call MovePictureToWorkScreen |
|
no_click: |
jmp still |
|
jmp still |
no_scrollers: |
|
|
mov eax,[MouseX] |
mov ebx,[MouseY] |
mov ecx,[Window_SizeX] |
211,32 → 187,23 |
|
cmp ebx,edx |
jae not_work_arrea |
|
jmp mouse_in_work_arrea |
|
not_work_arrea: |
|
mov [exit_from_work_arrea],1 |
|
jmp still |
|
mouse_in_work_arrea: |
|
call GetScreenCordinats |
call PrintMousePos |
call GetMouseClick |
|
|
|
test eax,eax |
jz no_use_instruments |
|
cmp [Activate_instrument],0 |
|
jnz no_undo___ |
;------------begin copy for undo------------- |
inc [number_undo] |
|
cmp [number_undo],1 |
jne no_one__ |
|
243,7 → 210,6 |
mov edi,[PointerToCopyPicture] |
|
no_one__: |
|
cmp [number_undo],2 |
jne no_two__ |
|
250,7 → 216,6 |
mov edi,[PointerToCopyPicture2] |
|
no_two__: |
|
cmp [number_undo],3 |
jne no_three__ |
|
270,7 → 235,6 |
mov edi,[PointerToCopyPicture2] |
|
no_three__: |
|
mov esi,[PointerToPicture] |
mov ecx,[Picture_SizeX] |
imul ecx,[Picture_SizeY] |
282,37 → 246,26 |
rep movsd |
;--------------end copy for undo------------- |
no_undo___: |
call TakeButtonInstruments |
|
call TakeButtonInstruments |
no_use_instruments: |
|
mov eax,[Current_instrument] |
and [Activate_instrument],0 |
|
jmp still |
;----------------------------------------------- |
;---------get mouse cordinats------------------- |
;----------------------------------------------- |
GetMouseCoordinats: |
|
mov eax,37 |
mov ebx,1 |
mcall |
|
mcall 37,1 |
mov ebx,eax |
shr eax,16 |
and ebx,0xffff |
|
mov [MouseX],eax |
mov [MouseY],ebx |
|
ret |
;------------------------------------------------ |
;-------get mouse attributs---------------------- |
;------------------------------------------------ |
GetMouseClick: |
mov eax,37 |
mov ebx,2 |
mcall |
|
mcall 37,2 |
ret |