Subversion Repositories Kolibri OS

Rev

Rev 1637 | Rev 6358 | 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 panel with user----------------
3
;-------------------------------------------------
4
panel_interraction:
1643 mario79 5
;>>>>>>>>>>>>>>>>>>>>>>>>>>
6
;	mcall	18,14
255 heavyiron 7
 
1643 mario79 8
	and	[Panel_flag],0
9
;collision with text on panel
10
next_columnus_text:
11
	mov	eax,[edi]
12
	mov	ebx,[edi+4]
13
	sub	eax,10
14
	sub	ebx,3
15
	mov	[Icon_text_x],eax
16
	mov	[Icon_text_y],ebx
255 heavyiron 17
 
1643 mario79 18
	mov	esi,[edi+8]
19
	imul	esi,10
20
	mov	[button_menu_size_x],esi
21
	mov	[button_menu_size_y],dword 13
255 heavyiron 22
 
1643 mario79 23
	mov	esi,[edi+8]
24
	add	edi,4*3
25
	add	edi,esi
255 heavyiron 26
 
1643 mario79 27
	mov	ecx,[MouseX]
28
	mov	edx,[MouseY]
255 heavyiron 29
 
1643 mario79 30
	push	edi
31
	mov	edi,[button_menu_size_y]
32
	mov	esi,[button_menu_size_x]
33
	call	columnus
34
	pop	edi
255 heavyiron 35
 
1643 mario79 36
	mov	esi,7
37
	test	eax,eax
38
	jz	no_columnus_text
255 heavyiron 39
 
1643 mario79 40
	mov	esi,1
41
	mov	[Panel_flag],1
42
	call	GetMouseClick
43
	test	eax,eax
44
	jz	no_mouse_pressed
255 heavyiron 45
 
1643 mario79 46
;	mcall	18,14
255 heavyiron 47
 
1643 mario79 48
	jmp	print_panel_menu
255 heavyiron 49
 
1643 mario79 50
no_mouse_pressed:
51
no_columnus_text:
52
	mov	eax,[Icon_text_x]
53
	mov	ebx,[Icon_text_y]
54
	mov	ecx,[button_menu_size_x]
55
	mov	edx,[button_menu_size_y]
56
	call	draw_volume_rectangle
255 heavyiron 57
 
1643 mario79 58
	push	[counter]
59
	push	edi
60
	mov	[counter],7
61
	mov	edi,panel_text
62
	call	print_panel_text
63
	pop	edi
64
	pop	[counter]
255 heavyiron 65
 
1643 mario79 66
	dec	[counter]
67
	jnz	next_columnus_text
255 heavyiron 68
 
1643 mario79 69
	jmp	still
255 heavyiron 70
;---------------------------------------------------------
71
;-----draw panel menu(main engin of panel)----------------
72
;---------------------------------------------------------
73
print_panel_menu:
1643 mario79 74
	push	[counter]
75
;delit main buttons(some time)
76
	mov	[counter],10
255 heavyiron 77
 
1643 mario79 78
next_icon_delit1:
79
	mov	edx,[counter]
80
	add	edx,11100000000000000000000000000000b
81
	mcall	8
82
	inc	[counter]
83
	cmp	[counter],30
84
	jl	next_icon_delit1
255 heavyiron 85
 
1643 mario79 86
	;delit	buttons	of	brushes
87
	mov	[counter],40
255 heavyiron 88
 
1643 mario79 89
next_icon_delit2:
90
	mov	edx,[counter]
91
	add	edx,11100000000000000000000000000000b
92
	mcall	8
93
	inc	[counter]
94
	cmp	[counter],45
95
	jl	next_icon_delit2
255 heavyiron 96
 
1643 mario79 97
	;delit	buttons	of	zoom
98
	mov	[counter],45
255 heavyiron 99
 
1643 mario79 100
next_icon_delit3:
101
	mov	edx,[counter]
102
	add	edx,11100000000000000000000000000000b
103
	mcall	8
104
	inc	[counter]
105
	cmp	[counter],50
106
	jl	next_icon_delit3
255 heavyiron 107
 
1643 mario79 108
;delit buttons of palette
109
	mov	edx,51
110
	add	edx,11100000000000000000000000000000b
111
	mcall	8
255 heavyiron 112
 
1643 mario79 113
;delit buttons of color
114
	mov	edx,52
115
	add	edx,11100000000000000000000000000000b
116
	mcall	8
255 heavyiron 117
 
1643 mario79 118
	pop	[counter]
255 heavyiron 119
 
1643 mario79 120
	push	esi
121
	mov	esi,[counter]
122
	dec	esi
123
	shl	esi,4
255 heavyiron 124
 
1643 mario79 125
	mov	eax,[menu_rectangles+esi]
126
	mov	ebx,[menu_rectangles+esi+4]
127
	mov	ecx,[menu_rectangles+esi+8]
128
	mov	edx,[menu_rectangles+esi+12]
129
	mov	esi,1
130
	mov	[menu_coordinat_x],eax
131
	mov	[menu_size_x],ecx
132
	call	draw_volume_rectangle
133
	pop	esi
255 heavyiron 134
 
1643 mario79 135
calculate_counter_menu:
136
;calculate menu counter
137
	mov	eax,[counter]
138
	dec	eax
139
	shl	eax,2
140
	mov	ebx,[menu_counters+eax]
141
	mov	[counter_menu],ebx
255 heavyiron 142
 
1643 mario79 143
	call	GetMouseCoordinats
255 heavyiron 144
 
1643 mario79 145
	and	[menu_counter],0
255 heavyiron 146
 
1643 mario79 147
	push	esi edi
148
;сглаживание анимации >>>>>>>>>>>>>>>>>>
149
;	mcall	18,4
255 heavyiron 150
 
1643 mario79 151
menu_loop:
152
	mov	eax,[menu_coordinat_x]
153
	mov	ebx,36
154
	mov	ecx,[MouseX]
155
	mov	edx,[MouseY]
156
	mov	esi,[menu_size_x]
157
	mov	edi,18
158
	add	ebx,[menu_counter]
159
	add	eax,2
160
	sub	esi,3
161
	inc	ebx
162
	call	columnus
163
	mov	esi,7
255 heavyiron 164
 
1643 mario79 165
	test	eax,eax
166
	jz	no_columnus_menu_text
255 heavyiron 167
 
1643 mario79 168
	mov	esi,1
255 heavyiron 169
 
1643 mario79 170
no_columnus_menu_text:
171
	mov	eax,[menu_coordinat_x]
172
	mov	ebx,36
173
	mov	ecx,[menu_size_x]
174
	mov	edx,18
175
	add	ebx,[menu_counter]
176
	add	eax,2
177
	sub	ecx,3
178
	inc	ebx
179
	call	draw_volume_rectangle
180
	add	[menu_counter],20
255 heavyiron 181
 
1643 mario79 182
	dec	[counter_menu]
183
	jnz	menu_loop
255 heavyiron 184
 
1643 mario79 185
;print menu text
186
	push	[counter]
187
	mov	esi,[counter]
188
	dec	esi
189
	shl	esi,2
190
	mov	edi,[menu_text_en+esi]
191
	mov	eax,[menu_counters+esi]
192
	mov	[counter],eax
193
	call	print_panel_text
194
	pop	[counter]
195
	pop	edi esi
255 heavyiron 196
 
197
 
1643 mario79 198
menu_still:
199
	mcall	10
200
	mcall	2
201
	mcall	17
202
	call	GetMouseClick
203
	test	eax,eax
204
	jz	calculate_counter_menu
255 heavyiron 205
 
1643 mario79 206
	call	GetMouseCoordinats
207
;calculate menu counter
208
	mov	eax,[counter]
209
	dec	eax
210
	shl	eax,2
211
	mov	ebx,[menu_counters+eax]
212
	mov	[counter_menu],ebx
255 heavyiron 213
 
1643 mario79 214
	and	[menu_counter],0
215
	and	[counter_11],0
255 heavyiron 216
 
1643 mario79 217
	push	esi edi
255 heavyiron 218
 
1643 mario79 219
menu_loop2:
220
	mov	eax,[menu_coordinat_x]
221
	mov	ebx,36
222
	mov	ecx,[MouseX]
223
	mov	edx,[MouseY]
224
	mov	esi,[menu_size_x]
225
	mov	edi,18
226
	add	ebx,[menu_counter]
227
	add	eax,2
228
	sub	esi,3
229
	inc	ebx
230
	call	columnus
255 heavyiron 231
 
1643 mario79 232
	inc	[counter_11]
233
	test	eax,eax
234
	jz	no_columnus_menu_text2
255 heavyiron 235
 
1643 mario79 236
	mov	esi,[counter_11]
237
	mov	[number_menu],esi
255 heavyiron 238
 
1643 mario79 239
no_columnus_menu_text2:
240
	add	[menu_counter],20
241
	dec	[counter_menu]
242
	jnz	menu_loop2
255 heavyiron 243
 
1643 mario79 244
	pop	edi esi
255 heavyiron 245
 
1643 mario79 246
	mcall	5,15
255 heavyiron 247
 
1643 mario79 248
	push	[counter]
249
	pusha
250
	call	drawwin
251
	popa
252
	pop	[counter]
255 heavyiron 253
 
1643 mario79 254
	mov	eax,[counter]
255
	mov	[number_panel],eax
255 heavyiron 256
 
1643 mario79 257
	jmp	TakeInstruments
255 heavyiron 258
 
259
;---------------------------------------------------------
260
;------print mouse position on panel----------------------
261
;---------------------------------------------------------
262
PrintMousePos:
263
	pushad
1643 mario79 264
	mov	eax,[Window_SizeX]
265
	sub	eax,75
266
	mov	ebx,20+15+6
267
	mov	ecx,52
268
	mov	edx,18
269
	mov	esi,4
270
	call	draw_volume_rectangle
255 heavyiron 271
 
1643 mario79 272
	mov	eax,[Window_SizeX]
273
	sub	eax,75
274
	mov	ebx,20+15+6+18+2
275
	mov	ecx,52
276
	mov	edx,18
277
	mov	esi,4
278
	call	draw_volume_rectangle
255 heavyiron 279
 
1643 mario79 280
	mov	eax,[Window_SizeX]
281
	sub	eax,70
282
	mov	ebx,20+15+6+6
283
	and	ecx,0
284
	mov	edx,mouse_pos_x
285
	mov	esi,2
286
	call	print_text
255 heavyiron 287
 
1643 mario79 288
	mov	eax,[Window_SizeX]
289
	sub	eax,70
290
	mov	ebx,20+15+6+6+18+1
291
	and	ecx,0
292
	mov	edx,mouse_pos_y
293
	mov	esi,2
294
	call	print_text
255 heavyiron 295
 
1643 mario79 296
	mov	ecx,[ScreenX]
297
	add	ecx,[PosX]
298
	mov	edx,[Window_SizeX]
299
	sub	edx,55
300
	shl	edx,16
301
	add	edx,20+15+6+6
302
	and	esi,0
303
	mcall	47,<4,0>
255 heavyiron 304
 
1643 mario79 305
	mov	ecx,[ScreenY]
306
	add	ecx,[PosY]
307
	mov	edx,[Window_SizeX]
308
	sub	edx,55
309
	shl	edx,16
310
	add	edx,20+15+6+18+1+6
485 heavyiron 311
	mcall
255 heavyiron 312
 
313
	popad
314
	ret
315
 
316
;----------------------------------------------------------
317
;----------print text on the panel and menu----------------
318
;----------------------------------------------------------
319
print_panel_text:
1643 mario79 320
next_panel_text:
321
	mov	eax,[edi]
322
	mov	ebx,[edi+4]
323
;	xor	ecx,ecx
324
	mov	ecx,0x10000000
325
	mov	edx,edi
326
	add	edx,12
327
	mov	esi,[edi+8]
328
	add	edi,esi
329
	add	edi,3*4
255 heavyiron 330
 
1643 mario79 331
	push	edi
332
	call	print_text
333
	pop	edi
255 heavyiron 334
 
1643 mario79 335
	dec	[counter]
336
	jnz	next_panel_text
255 heavyiron 337
	ret
338
;----------------------------------------------------------
339
;------------draw lines of scoll---------------------------
340
;----------------------------------------------------------
341
draw_scrollers:
1643 mario79 342
	mov	edi,[CounterX]
343
	mov	eax,[Scroll1CoordinatX]
344
	mov	ebx,[Window_SizeY]
345
	sub	ebx,22+10
346
	mov	ecx,[Window_SizeX]
347
	sub	ecx,10+5+20+10+1
348
	mov	edx,14+10
349
	mov	esi,1
350
	mov	[Scroll1CoordinatX],eax
351
	mov	[Scroll1CoordinatY],ebx
352
	mov	[Scroll1MaxSizeY],edx
353
	mov	[Scroll1MaxSizeX],ecx
354
	imul	ecx,edi
355
	push	eax	ebx	edx
356
	mov	eax,ecx
357
	mov	ebx,[Picture_SizeX]
358
	cdq
359
	idiv	ebx
360
	mov	ecx,eax
361
	pop	edx	ebx	eax
362
	mov	[Scroll1SizeX],ecx
363
	mov	edi,[Scroll1MaxSizeX]
364
	sub	edi,ecx
365
	mov	[Scroll1FreeX],edi
366
	call	draw_volume_rectangle
255 heavyiron 367
 
1643 mario79 368
	mov	eax,[Window_SizeX]
369
	sub	eax,22+10
370
	mov	ebx,[Scroll2CoordinatY]
371
	mov	ecx,14+10
372
	mov	edx,[Window_SizeY]
373
	sub	edx,20+15+1+49+10+20+11
374
	mov	esi,1
375
	mov	[Scroll2CoordinatX],eax
376
	mov	[Scroll2CoordinatY],ebx
377
	mov	[Scroll2MaxSizeX],ecx
378
	mov	[Scroll2MaxSizeY],edx
255 heavyiron 379
 
1643 mario79 380
	imul	edx,[CounterY]
381
	push	eax	ebx
382
	mov	eax,edx
383
	mov	ebx,[Picture_SizeY]
384
	cdq
385
	idiv	ebx
386
	mov	edx,eax
387
	pop	ebx	eax
388
	mov	[Scroll2SizeY],edx
389
	mov	edi,[Scroll2MaxSizeY]
390
	sub	edi,edx
391
	mov	[Scroll2FreeY],edi
255 heavyiron 392
 
1643 mario79 393
	call	draw_volume_rectangle
255 heavyiron 394
 
1643 mario79 395
	ret
255 heavyiron 396
 
1643 mario79 397
button_menu_size_x	dd 0
398
button_menu_size_y	dd 0