Subversion Repositories Kolibri OS

Rev

Rev 485 | Rev 6355 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
255 heavyiron 1
;---------------------------------------------
2
;-------------interraction MOUSE--------------
3
;---------------------------------------------
4
mouse:
1643 mario79 5
	call	GetMouseCoordinats
6
;panel
7
	mov	edx,[Window_SizeX]
8
	sub	edx,5
255 heavyiron 9
 
1643 mario79 10
	cmp	ebx,20
11
	jle	no_panel
255 heavyiron 12
 
1643 mario79 13
	cmp	ebx,20+15
14
	jae	no_panel
255 heavyiron 15
 
1643 mario79 16
	cmp	eax,5
17
	jle	no_panel
255 heavyiron 18
 
1643 mario79 19
	cmp	eax,edx	;585
20
	jae	no_panel
255 heavyiron 21
 
1643 mario79 22
	call	GetMouseCoordinats
23
	mov	[counter],7
24
	mov	edi,panel_text
25
	jmp	panel_interraction
255 heavyiron 26
 
1643 mario79 27
no_panel:
28
	cmp	[Panel_flag],0
29
	jz	no_redraw_panel
255 heavyiron 30
 
1643 mario79 31
	mov	[counter],7
32
	mov	edi,panel_text
33
	jmp	panel_interraction
255 heavyiron 34
 
1643 mario79 35
no_redraw_panel:
36
	call	GetMouseCoordinats
37
	mov	eax,[MouseX]
38
	mov	ebx,[MouseY]
39
	mov	ecx,[WorkScreen_SizeX]
40
	mov	edx,[WorkScreen_SizeY]
41
	add	ecx,9
42
	add	edx,89
255 heavyiron 43
 
1643 mario79 44
	cmp	eax,ecx
45
	jae	mouse_scroll
255 heavyiron 46
 
1643 mario79 47
	cmp	ebx,edx
48
	jae	mouse_scroll
49
	jmp	no_scrollers
255 heavyiron 50
 
1643 mario79 51
mouse_scroll:
52
	mov	[exit_from_work_arrea],1 ;mouse situated after work arrea
53
;scrollers
54
	call	GetMouseClick
55
	cmp	eax,1
56
	jne	no_click
255 heavyiron 57
 
1643 mario79 58
	call	GetMouseCoordinats
59
;interraction with horizontal scroller
60
	mov	eax,[Scroll1CoordinatX]
61
	mov	ebx,[Scroll1CoordinatY]
62
	mov	ecx,[MouseX]
63
	mov	edx,[MouseY]
64
	mov	esi,[Scroll1MaxSizeX]
65
	mov	edi,[Scroll1MaxSizeY]
66
	call	columnus
67
	test	eax,eax
68
	jz	no_horizontal
255 heavyiron 69
 
1643 mario79 70
	mov	eax,9
71
	mov	ebx,[Scroll1CoordinatY]
72
	mov	ecx,[Scroll1MaxSizeX]
73
	mov	edx,14+10
74
	mov	esi,7
75
	inc	ecx
76
	call	draw_volume_rectangle
255 heavyiron 77
 
1643 mario79 78
	mov	eax,[MouseX]
79
	mov	ebx,[Scroll1SizeX]
80
	shr	ebx,1
81
	sub	eax,ebx
82
	mov	ecx,[MouseX]
83
	add	ecx,ebx
84
	mov	edx,8+1
85
	add	edx,[Scroll1MaxSizeX]
86
	mov	[Scroll1CoordinatX],eax
87
	sub	eax,9
88
	jns	no_min_scroll
255 heavyiron 89
 
1643 mario79 90
	mov	[Scroll1CoordinatX],9
255 heavyiron 91
 
1643 mario79 92
no_min_scroll:
93
	cmp	ecx,edx
94
	jl	no_max_scroll
255 heavyiron 95
 
1643 mario79 96
	sub	edx,ebx
97
	sub	edx,ebx
98
	mov	[Scroll1CoordinatX],edx
255 heavyiron 99
 
1643 mario79 100
no_max_scroll:
101
	mov	eax,[Scroll1CoordinatX]
102
	sub	eax,9
103
	mov	ebx,[Picture_SizeX]
104
	imul	eax,ebx
105
	mov	ebx,[Scroll1MaxSizeX]
255 heavyiron 106
	cdq
1643 mario79 107
	idiv	ebx
108
	mov	[PosX],eax
109
	jmp	no_vertical
255 heavyiron 110
 
1643 mario79 111
no_horizontal:
112
	mov	eax,[Scroll2CoordinatX]
113
	mov	ebx,[Scroll2CoordinatY]
114
	mov	ecx,[MouseX]
115
	mov	edx,[MouseY]
116
	mov	esi,[Scroll2MaxSizeX]
117
	mov	edi,[Scroll2MaxSizeY]
118
	call	columnus
119
	test	eax,eax
120
	jz	no_vertical
255 heavyiron 121
 
1643 mario79 122
	mov	eax,[Scroll2CoordinatX]
123
	mov	ebx,89
124
	mov	ecx,14+10
125
	mov	edx,[Scroll2MaxSizeY]
126
	mov	esi,7
127
	inc	edx
128
	call	draw_volume_rectangle
255 heavyiron 129
 
1643 mario79 130
	mov	eax,[MouseY]
131
	mov	ebx,[Scroll2SizeY]
132
	shr	ebx,1
133
	sub	eax,ebx
134
	mov	ecx,[MouseY]
135
	add	ecx,ebx
136
	mov	edx,89
137
	add	edx,[Scroll2MaxSizeY]
138
	mov	[Scroll2CoordinatY],eax
255 heavyiron 139
 
1643 mario79 140
	sub	eax,89
141
	jns	no_min_scroll2
255 heavyiron 142
 
1643 mario79 143
	mov	[Scroll2CoordinatY],89
255 heavyiron 144
 
1643 mario79 145
no_min_scroll2:
146
	cmp	ecx,edx
147
	jl	no_max_scroll2
255 heavyiron 148
 
1643 mario79 149
	sub	edx,ebx
150
	sub	edx,ebx
151
	mov	[Scroll2CoordinatY],edx
255 heavyiron 152
 
1643 mario79 153
no_max_scroll2:
154
	mov	eax,[Scroll2CoordinatY]
155
	sub	eax,89
156
	mov	ebx,[Picture_SizeY]
157
	imul	eax,ebx
158
	mov	ebx,[Scroll2MaxSizeY]
255 heavyiron 159
	cdq
1643 mario79 160
	idiv	ebx
161
	mov	[PosY],eax
255 heavyiron 162
 
1643 mario79 163
no_vertical:
164
	call	CalculatePositionScreen
165
	call	draw_scrollers
166
	call	MovePictureToWorkScreen
255 heavyiron 167
 
1643 mario79 168
no_click:
169
	jmp	still
255 heavyiron 170
 
1643 mario79 171
no_scrollers:
172
	mov	eax,[MouseX]
173
	mov	ebx,[MouseY]
174
	mov	ecx,[Window_SizeX]
175
	mov	edx,[Window_SizeY]
176
	sub	ecx,36
177
	sub	edx,35
255 heavyiron 178
 
1643 mario79 179
	cmp	eax,9
180
	jle	not_work_arrea
255 heavyiron 181
 
1643 mario79 182
	cmp	eax,ecx
183
	jae	not_work_arrea
255 heavyiron 184
 
1643 mario79 185
	cmp	ebx,20+15+1+50
186
	jle	not_work_arrea
255 heavyiron 187
 
1643 mario79 188
	cmp	ebx,edx
189
	jae	not_work_arrea
190
	jmp	mouse_in_work_arrea
255 heavyiron 191
 
1643 mario79 192
not_work_arrea:
193
	mov	[exit_from_work_arrea],1
194
	jmp	still
255 heavyiron 195
 
1643 mario79 196
mouse_in_work_arrea:
197
	call	GetScreenCordinats
198
	call	PrintMousePos
199
	call	GetMouseClick
200
	test	eax,eax
201
	jz	no_use_instruments
255 heavyiron 202
 
1643 mario79 203
	cmp	[Activate_instrument],0
204
	jnz	no_undo___
205
;------------begin copy for undo-------------
206
	inc	[number_undo]
207
	cmp	[number_undo],1
208
	jne	no_one__
255 heavyiron 209
 
1643 mario79 210
	mov	edi,[PointerToCopyPicture]
255 heavyiron 211
 
1643 mario79 212
no_one__:
213
	cmp	[number_undo],2
214
	jne	no_two__
255 heavyiron 215
 
1643 mario79 216
	mov	edi,[PointerToCopyPicture2]
255 heavyiron 217
 
1643 mario79 218
no_two__:
219
	cmp	[number_undo],3
220
	jne	no_three__
255 heavyiron 221
 
1643 mario79 222
;copy bufer number two to bufer number one
223
	mov	esi,[PointerToCopyPicture2]
224
	mov	edi,[PointerToCopyPicture]
225
	mov	ecx,[Picture_SizeX]
226
	imul	ecx,[Picture_SizeY]
227
	lea	ecx,[ecx+ecx*2]
228
	add	ecx,4
229
	shr	ecx,2
230
	inc	ecx
255 heavyiron 231
	cld
1643 mario79 232
	rep	movsd
233
;end copy
234
	dec	[number_undo]
235
	mov	edi,[PointerToCopyPicture2]
255 heavyiron 236
 
1643 mario79 237
no_three__:
238
	mov	esi,[PointerToPicture]
239
	mov	ecx,[Picture_SizeX]
240
	imul	ecx,[Picture_SizeY]
241
	lea	ecx,[ecx+ecx*2]
242
	add	ecx,4
243
	shr	ecx,2
244
	inc	ecx
255 heavyiron 245
	cld
1643 mario79 246
	rep	movsd
247
;--------------end copy for undo-------------
248
no_undo___:
249
	call	TakeButtonInstruments
255 heavyiron 250
 
1643 mario79 251
no_use_instruments:
252
	mov	eax,[Current_instrument]
253
	and	[Activate_instrument],0
254
	jmp	still
255 heavyiron 255
;-----------------------------------------------
256
;---------get mouse cordinats-------------------
257
;-----------------------------------------------
258
GetMouseCoordinats:
1643 mario79 259
	mcall	37,1
260
	mov	ebx,eax
261
	shr	eax,16
262
	and	ebx,0xffff
263
	mov	[MouseX],eax
264
	mov	[MouseY],ebx
255 heavyiron 265
	ret
266
;------------------------------------------------
267
;-------get mouse attributs----------------------
268
;------------------------------------------------
269
GetMouseClick:
1643 mario79 270
	mcall	37,2
271
	ret