Subversion Repositories Kolibri OS

Rev

Rev 1643 | Rev 6357 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

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