Subversion Repositories Kolibri OS

Rev

Rev 297 | Rev 1480 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 297 Rev 617
Line 1... Line 1...
1
func check_mouse_in_edit_area
1
proc check_mouse_in_edit_area
2
	mcall	37,1
2
	mcall	37,1
3
	mov	ebx,eax
3
	mov	ebx,eax
4
	and	ebx,0x0000FFFF
4
	and	ebx,0x0000FFFF
5
	shr	eax,16
5
	shr	eax,16
6
	mov	ecx,[cur_editor.Bounds.Top]
6
	mov	ecx,[cur_editor.Bounds.Top]
Line 14... Line 14...
14
	dec	ecx
14
	dec	ecx
15
	add	[__rc+0xC],ecx
15
	add	[__rc+0xC],ecx
16
	mov	ecx,__rc
16
	mov	ecx,__rc
17
	call	pt_in_rect
17
	call	pt_in_rect
18
	ret
18
	ret
19
endf
19
endp
Line 20... Line 20...
20
 
20
 
21
func get_mouse_event
21
proc get_mouse_event
22
	mcall	37,2
22
	mcall	37,2
23
	and	al,3
23
	and	al,3
24
	mov	bl,[ecx]
24
	mov	bl,[ecx]
25
	cmp	[ecx],al
25
	cmp	[ecx],al
26
	mov	[ecx],al
26
	mov	[ecx],al
-
 
27
	jne	@f
-
 
28
	mcall	37,7
-
 
29
	or	eax,eax
-
 
30
	jz	.mv
-
 
31
	add	[ecx+6],ax
-
 
32
	shr	eax,16
27
	jne	@f
33
	add	[ecx+4],ax
-
 
34
	mov	eax,MEV_WHEEL
-
 
35
	ret
28
	mov	eax,MEV_MOVE
36
  .mv:	mov	eax,MEV_MOVE
29
	ret
37
	ret
30
    @@: mov	bh,al
38
    @@: mov	bh,al
31
	and	ebx,0x0101
39
	and	ebx,0x0101
32
	cmp	bl,bh
40
	cmp	bl,bh
Line 41... Line 49...
41
	jz	@f
49
	jz	@f
42
	mov	eax,MEV_RDOWN
50
	mov	eax,MEV_RDOWN
43
	ret
51
	ret
44
    @@: mov	eax,MEV_RUP
52
    @@: mov	eax,MEV_RUP
45
	ret
53
	ret
46
endf
54
endp
Line 47... Line 55...
47
 
55
 
Line 48... Line 56...
48
mouse_ev dd mouse.l_down,mouse.l_up,mouse.r_down,mouse.r_up,mouse.move
56
mouse_ev dd mouse.l_down,mouse.l_up,mouse.r_down,mouse.r_up,mouse.wheel,mouse.move
49
 
57
 
50
mouse:
58
mouse:
51
	mov	ecx,mst
59
	mov	ecx,mst
Line 74... Line 82...
74
;!!!        cmp     al,MEV_LUP
82
;!!!        cmp     al,MEV_LUP
75
;!!!        jne     still.skip_write
83
;!!!        jne     still.skip_write
76
    @@: mov	[mev],al
84
    @@: mov	[mev],al
77
	jmp	[mouse_ev+eax*4-4]
85
	jmp	[mouse_ev+eax*4-4]
Line -... Line 86...
-
 
86
 
-
 
87
  .wheel:
-
 
88
	movsx	eax,word[mst+4]
-
 
89
	lea	eax,[eax*3]
-
 
90
	add	[cur_editor.TopLeft.X],eax
-
 
91
	movsx	eax,word[mst+6]
-
 
92
	lea	eax,[eax*3]
-
 
93
	add	[cur_editor.TopLeft.Y],eax
-
 
94
	xor	eax,eax
-
 
95
	mov	[mst+4],eax
-
 
96
	call	check_bottom_right
-
 
97
	call	draw_editor
-
 
98
	jmp	still.skip_write
78
 
99
 
79
  .move:
100
  .move:
80
	mcall	37,1
101
	mcall	37,1
81
	movsx	ebx,ax
102
	movsx	ebx,ax
82
	sar	eax,16
103
	sar	eax,16