Subversion Repositories Kolibri OS

Rev

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

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