Subversion Repositories Kolibri OS

Rev

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