Subversion Repositories Kolibri OS

Rev

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

Rev 1637 Rev 1643
Line 1... Line 1...
1
;-------------------------------------------------
1
;-------------------------------------------------
2
;-----interraction panel with user----------------
2
;-----interraction panel with user----------------
3
;-------------------------------------------------
3
;-------------------------------------------------
4
panel_interraction:
4
panel_interraction:
5
	;>>>>>>>>>>>>>>>>>>>>>>>>>>
5
;>>>>>>>>>>>>>>>>>>>>>>>>>>
6
	mov eax,18
-
 
7
	mov ebx,14
6
;	mcall	18,14
8
	;mcall
-
 
Line 9... Line 7...
9
 
7
 
10
	and [Panel_flag],0
8
	and	[Panel_flag],0
11
	;collision with text on panel
9
;collision with text on panel
12
      next_columnus_text:
-
 
13
 
10
next_columnus_text:
14
	mov eax,[edi]
11
	mov	eax,[edi]
15
	mov ebx,[edi+4]
12
	mov	ebx,[edi+4]
16
	sub eax,10
13
	sub	eax,10
17
	sub ebx,3
14
	sub	ebx,3
Line 32... Line 29...
32
 
29
 
33
	push edi
30
	push	edi
34
	mov edi,[button_menu_size_y]
31
	mov	edi,[button_menu_size_y]
35
	mov esi,[button_menu_size_x]
32
	mov	esi,[button_menu_size_x]
36
	call columnus
-
 
37
 
33
	call	columnus
38
	pop edi
-
 
Line -... Line 34...
-
 
34
	pop	edi
39
	mov esi,7
35
 
40
 
36
	mov	esi,7
Line 41... Line 37...
41
	test eax,eax
37
	test	eax,eax
42
	jz no_columnus_text
38
	jz	no_columnus_text
43
 
39
 
44
	mov esi,1
-
 
45
	mov [Panel_flag],1
40
	mov	esi,1
46
	call GetMouseClick
41
	mov	[Panel_flag],1
Line 47... Line -...
47
 
-
 
48
	test eax,eax
42
	call	GetMouseClick
49
	jz no_mouse_pressed
-
 
Line 50... Line 43...
50
 
43
	test	eax,eax
Line 51... Line 44...
51
	mov eax,18
44
	jz	no_mouse_pressed
52
	mov ebx,14
-
 
53
	;mcall
45
 
54
 
-
 
55
	call print_panel_menu
46
;	mcall	18,14
56
 
47
 
57
	no_mouse_pressed:
48
	jmp	print_panel_menu
58
 
49
 
59
	no_columnus_text:
50
no_mouse_pressed:
Line 60... Line 51...
60
 
51
no_columnus_text:
61
	mov eax,[Icon_text_x]
52
	mov	eax,[Icon_text_x]
62
	mov ebx,[Icon_text_y]
53
	mov	ebx,[Icon_text_y]
63
	mov ecx,[button_menu_size_x]		;-------------------------
54
	mov	ecx,[button_menu_size_x]
64
	mov edx,[button_menu_size_y]
55
	mov	edx,[button_menu_size_y]
65
	call draw_volume_rectangle
-
 
66
 
56
	call	draw_volume_rectangle
67
	push [counter]
57
 
-
 
58
	push	[counter]
68
	push edi
59
	push	edi
69
	mov [counter],7
60
	mov	[counter],7
Line 70... Line 61...
70
	mov edi,panel_text
61
	mov	edi,panel_text
71
	call print_panel_text
62
	call	print_panel_text
72
 
63
	pop	edi
73
	pop edi
64
	pop	[counter]
74
	pop [counter]
65
 
75
	dec [counter]
-
 
76
	jnz next_columnus_text
-
 
77
 
66
	dec	[counter]
78
	ret
67
	jnz	next_columnus_text
79
;---------------------------------------------------------
-
 
80
;-----draw panel menu(main engin of panel)----------------
68
 
Line 81... Line 69...
81
;---------------------------------------------------------
69
	jmp	still
82
print_panel_menu:
-
 
83
 
-
 
84
 
70
;---------------------------------------------------------
85
	push [counter]
71
;-----draw panel menu(main engin of panel)----------------
86
	;delit main buttons(some time)
72
;---------------------------------------------------------
87
 
73
print_panel_menu:
88
	mov [counter],10
-
 
89
 
74
	push	[counter]
90
	next_icon_delit1:
75
;delit main buttons(some time)
Line 91... Line 76...
91
 
76
	mov	[counter],10
92
	mov eax,8
77
 
Line 93... Line 78...
93
	mov edx,[counter]
78
next_icon_delit1:
94
	add edx,11100000000000000000000000000000b
-
 
95
	mcall
-
 
96
	inc [counter]
79
	mov	edx,[counter]
97
 
80
	add	edx,11100000000000000000000000000000b
98
	cmp [counter],30
81
	mcall	8
99
	jl next_icon_delit1
82
	inc	[counter]
100
 
-
 
101
	;delit buttons of brushes
83
	cmp	[counter],30
102
	mov [counter],40
84
	jl	next_icon_delit1
Line 103... Line 85...
103
 
85
 
104
	next_icon_delit2:
86
	;delit	buttons	of	brushes
Line 105... Line 87...
105
 
87
	mov	[counter],40
106
	mov eax,8
-
 
107
	mov edx,[counter]
-
 
108
	add edx,11100000000000000000000000000000b
88
 
109
	mcall
89
next_icon_delit2:
110
	inc [counter]
90
	mov	edx,[counter]
111
 
91
	add	edx,11100000000000000000000000000000b
112
	cmp [counter],45
-
 
113
	jl next_icon_delit2
92
	mcall	8
114
 
93
	inc	[counter]
Line 115... Line 94...
115
	;delit buttons of zoom
94
	cmp	[counter],45
116
	mov [counter],45
-
 
117
 
95
	jl	next_icon_delit2
118
	next_icon_delit3:
96
 
119
 
97
	;delit	buttons	of	zoom
120
	mov eax,8
-
 
Line 121... Line 98...
121
	mov edx,[counter]
98
	mov	[counter],45
122
	add edx,11100000000000000000000000000000b
-
 
123
	mcall
99
 
124
	inc [counter]
100
next_icon_delit3:
125
 
101
	mov	edx,[counter]
Line 126... Line 102...
126
	cmp [counter],50
102
	add	edx,11100000000000000000000000000000b
Line 127... Line 103...
127
	jl next_icon_delit3
103
	mcall	8
128
 
104
	inc	[counter]
Line 155... Line 131...
155
	mov [menu_size_x],ecx
131
	mov	[menu_size_x],ecx
156
	call draw_volume_rectangle
132
	call	draw_volume_rectangle
157
	pop esi
133
	pop	esi
Line 158... Line 134...
158
 
134
 
159
    calculate_counter_menu:
-
 
160
 
-
 
161
 
135
calculate_counter_menu:
162
	;calculate menu counter
136
;calculate menu counter
163
	mov eax,[counter]
137
	mov	eax,[counter]
164
	dec eax
138
	dec	eax
165
	shl eax,2
139
	shl	eax,2
166
	mov ebx,[menu_counters+eax]
140
	mov	ebx,[menu_counters+eax]
Line 167... Line 141...
167
	mov [counter_menu],ebx
141
	mov	[counter_menu],ebx
Line 168... Line 142...
168
 
142
 
169
	call GetMouseCoordinats
143
	call	GetMouseCoordinats
170
 
144
 
171
	and [menu_counter],0
145
	and	[menu_counter],0
172
	push esi
-
 
173
	push edi
-
 
174
	;ᣫ ¦¨¢ ­¨¥  ­¨¬ æ¨¨ >>>>>>>>>>>>>>>>>>
146
 
Line 175... Line 147...
175
	mov eax,18
147
	push	esi edi
176
	mov ebx,14
-
 
177
	;mcall
148
;ᣫ ¦¨¢ ­¨¥  ­¨¬ æ¨¨ >>>>>>>>>>>>>>>>>>
178
 
149
;	mcall	18,4
179
    menu_loop:
150
 
180
 
151
menu_loop:
181
	mov eax,[menu_coordinat_x]
152
	mov	eax,[menu_coordinat_x]
Line 195... Line 166...
195
	jz no_columnus_menu_text
166
	jz	no_columnus_menu_text
Line 196... Line 167...
196
 
167
 
Line 197... Line 168...
197
	mov esi,1
168
	mov	esi,1
198
 
-
 
199
	no_columnus_menu_text:
169
 
200
 
170
no_columnus_menu_text:
201
	mov eax,[menu_coordinat_x]
171
	mov	eax,[menu_coordinat_x]
202
	mov ebx,36
172
	mov	ebx,36
203
	mov ecx,[menu_size_x]
173
	mov	ecx,[menu_size_x]
Line 207... Line 177...
207
	sub ecx,3
177
	sub	ecx,3
208
	inc ebx
178
	inc	ebx
209
	call draw_volume_rectangle
179
	call	draw_volume_rectangle
210
	add [menu_counter],20
180
	add	[menu_counter],20
Line 211... Line -...
211
 
-
 
212
 
181
 
213
	dec [counter_menu]
182
	dec	[counter_menu]
Line 214... Line -...
214
	jnz menu_loop
-
 
215
 
183
	jnz	menu_loop
216
 
184
 
217
	;print menu text
185
;print menu text
218
	push [counter]
186
	push	[counter]
219
	mov esi,[counter]
187
	mov	esi,[counter]
220
	dec esi
188
	dec	esi
221
	shl esi,2
189
	shl	esi,2
222
	mov edi,[menu_text_en+esi]
190
	mov	edi,[menu_text_en+esi]
223
	mov eax,[menu_counters+esi]
191
	mov	eax,[menu_counters+esi]
224
	mov [counter],eax
192
	mov	[counter],eax
225
	call print_panel_text
-
 
226
	pop [counter]
193
	call	print_panel_text
Line 227... Line 194...
227
	pop edi
194
	pop	[counter]
228
	pop esi
-
 
229
 
-
 
230
 
195
	pop	edi esi
231
	menu_still:
-
 
232
 
196
 
233
	mov eax,10
-
 
234
	mcall
197
 
235
	mov eax,2
-
 
236
	mcall
198
menu_still:
237
	mov eax,17
-
 
238
	mcall
199
	mcall	10
239
 
200
	mcall	2
Line 240... Line 201...
240
	call GetMouseClick
201
	mcall	17
241
 
-
 
242
	test eax,eax
202
	call	GetMouseClick
243
	jz calculate_counter_menu
203
	test	eax,eax
244
 
204
	jz	calculate_counter_menu
245
	call GetMouseCoordinats
205
 
246
 
206
	call	GetMouseCoordinats
247
	;calculate menu counter
207
;calculate menu counter
Line 248... Line 208...
248
	mov eax,[counter]
208
	mov	eax,[counter]
249
	dec eax
209
	dec	eax
Line 250... Line -...
250
	shl eax,2
-
 
251
	mov ebx,[menu_counters+eax]
210
	shl	eax,2
Line 252... Line 211...
252
	mov [counter_menu],ebx
211
	mov	ebx,[menu_counters+eax]
253
 
-
 
254
	and [menu_counter],0
-
 
255
	and [counter_11],0
212
	mov	[counter_menu],ebx
256
 
213
 
257
	push esi
214
	and	[menu_counter],0
258
	push edi
215
	and	[counter_11],0
259
 
216
 
Line 271... Line 228...
271
	sub esi,3
228
	sub	esi,3
272
	inc ebx
229
	inc	ebx
273
	call columnus
230
	call	columnus
Line 274... Line 231...
274
 
231
 
275
	inc [counter_11]
-
 
276
 
232
	inc	[counter_11]
277
	test eax,eax
233
	test	eax,eax
Line 278... Line 234...
278
	jz no_columnus_menu_text2
234
	jz	no_columnus_menu_text2
279
 
235
 
Line 280... Line 236...
280
	mov esi,[counter_11]
236
	mov	esi,[counter_11]
281
	mov [number_menu],esi
-
 
282
 
237
	mov	[number_menu],esi
283
	no_columnus_menu_text2:
-
 
284
 
238
 
285
	add [menu_counter],20
239
no_columnus_menu_text2:
Line 286... Line -...
286
 
-
 
287
	dec [counter_menu]
240
	add	[menu_counter],20
Line 288... Line -...
288
	jnz menu_loop2
-
 
289
 
241
	dec	[counter_menu]
290
	pop edi
-
 
Line 291... Line 242...
291
	pop esi
242
	jnz	menu_loop2
292
 
243
 
293
	mov eax,5
-
 
294
	mov ebx,15
244
	pop	edi esi
295
	mcall
-
 
296
 
245
 
297
	push [counter]
246
	mcall	5,15
Line 298... Line 247...
298
	pushad
247
 
299
 
248
	push	[counter]
Line 300... Line 249...
300
	call drawwin
249
	pusha
301
 
-
 
Line 302... Line 250...
302
	popad
250
	call	drawwin
303
	pop [counter]
251
	popa
304
 
252
	pop	[counter]
305
	mov eax,[counter]
253
 
306
	mov [number_panel],eax
-
 
307
 
254
	mov	eax,[counter]
308
	call TakeInstruments
-
 
309
	jmp still
255
	mov	[number_panel],eax
310
 
256
 
311
;---------------------------------------------------------
257
	jmp	TakeInstruments
312
;------print mouse position on panel----------------------
258
 
313
;---------------------------------------------------------
259
;---------------------------------------------------------
Line 345... Line 291...
345
	and ecx,0
291
	and	ecx,0
346
	mov edx,mouse_pos_y
292
	mov	edx,mouse_pos_y
347
	mov esi,2
293
	mov	esi,2
348
	call print_text
294
	call	print_text
Line 349... Line -...
349
 
-
 
350
	mov eax,47
-
 
351
	mov ebx,4*65536
295
 
352
	mov ecx,[ScreenX]
296
	mov	ecx,[ScreenX]
353
	add ecx,[PosX]
297
	add	ecx,[PosX]
354
	mov edx,[Window_SizeX]
298
	mov	edx,[Window_SizeX]
355
	sub edx,55
299
	sub	edx,55
356
	shl edx,16
300
	shl	edx,16
357
	add edx,20+15+6+6
301
	add	edx,20+15+6+6
358
	and esi,0
302
	and	esi,0
Line 359... Line -...
359
	mcall
-
 
360
 
-
 
361
	mov eax,47
303
	mcall	47,<4,0>
362
	mov ebx,4*65536
304
 
363
	mov ecx,[ScreenY]
305
	mov	ecx,[ScreenY]
364
	add ecx,[PosY]
306
	add	ecx,[PosY]
365
	mov edx,[Window_SizeX]
307
	mov	edx,[Window_SizeX]
366
	sub edx,55
308
	sub	edx,55
367
	shl edx,16
-
 
368
	add edx,20+15+6+18+1+6
309
	shl	edx,16
Line 369... Line 310...
369
	and esi,0
310
	add	edx,20+15+6+18+1+6
370
	mcall
311
	mcall
371
 
-
 
372
	popad
-
 
373
	ret
-
 
374
;----------------------------------------------------------
-
 
375
;---------------draw panel in window of program------------
-
 
376
;----------------------------------------------------------
-
 
377
draw_panel:
-
 
378
 
-
 
379
	mov eax,5
-
 
380
	mov ebx,20
-
 
381
	mov ecx,[Window_SizeX]
-
 
382
	mov edx,15
-
 
383
	mov esi,6
-
 
384
	sub ecx,10
-
 
385
	call draw_volume_rectangle ; top menu - file and etc.
-
 
386
 
-
 
387
	;mov eax,5
-
 
388
	;mov ebx,20
-
 
389
	;mov ecx,[Window_SizeX]
-
 
390
	;mov edx,15
-
 
391
	;mov esi,6
-
 
392
	;sub ecx,10
-
 
393
	;call draw_volume_rectangle
-
 
394
 
-
 
395
	mov eax,5
-
 
396
	mov ebx,20+15+1
-
 
397
	mov ecx,[Window_SizeX]
-
 
398
	mov edx,50
-
 
399
	mov esi,1
-
 
400
	sub ecx,10
-
 
401
	call draw_volume_rectangle ; tools panel
-
 
402
 
-
 
403
	mov eax,5
-
 
404
	mov ebx,20+15+1+50+1
-
 
405
	mov ecx,[Window_SizeX]
-
 
406
	mov edx,[Window_SizeY]
-
 
407
	mov esi,1
-
 
408
	sub ecx,10+20
-
 
409
	sub edx,20+15+1+50+1+5+20
-
 
410
	call draw_volume_rectangle	; picure area
-
 
411
 
-
 
412
	mov eax,5
-
 
413
	mov ebx,[Window_SizeY]
-
 
414
	mov ecx,[Window_SizeX]
-
 
415
	mov edx,20+10
-
 
416
	mov esi,3
-
 
417
	sub ecx,30
-
 
418
	sub ebx,25+10
-
 
419
	call draw_volume_rectangle	; horizontal scrollbar
-
 
420
 
-
 
421
	mov eax,[Window_SizeX]
-
 
422
	mov ebx,20+15+1+49+2
-
 
423
	mov ecx,20+10
-
 
424
	mov edx,[Window_SizeY]
-
 
425
	mov esi,3
-
 
426
	sub eax,25+10
-
 
427
	sub edx,20+15+1+49+5+20
-
 
428
	call draw_volume_rectangle	; vertical scrollbar
-
 
429
 
-
 
430
	mov eax,[Window_SizeX]
-
 
431
	mov ebx,[Window_SizeY]
-
 
432
	mov ecx,20+10
-
 
433
	mov edx,20+10
-
 
434
	mov esi,6
-
 
435
	sub eax,25+10
-
 
436
	sub ebx,25+10
-
 
437
	call draw_volume_rectangle	; down and right small area
-
 
438
 
-
 
439
	;mov eax,445
-
 
440
	;mov ebx,20+15+6
-
 
441
	;mov ecx,37
-
 
442
	;mov edx,37
-
 
443
	;mov esi,4
-
 
444
	;call draw_volume_rectangle
-
 
Line 445... Line 312...
445
 
312
 
446
	ret
313
	popad
447
 
314
	ret
448
 
315
 
449
;----------------------------------------------------------
316
;----------------------------------------------------------
450
;----------print text on the panel and menu----------------
-
 
451
;----------------------------------------------------------
317
;----------print text on the panel and menu----------------
452
print_panel_text:
318
;----------------------------------------------------------
453
       next_panel_text:
319
print_panel_text:
454
 
320
next_panel_text:
455
	mov eax,[edi]
321
	mov	eax,[edi]
Line 471... Line 337...
471
	ret
337
	ret
472
;----------------------------------------------------------
338
;----------------------------------------------------------
473
;------------draw lines of scoll---------------------------
339
;------------draw lines of scoll---------------------------
474
;----------------------------------------------------------
340
;----------------------------------------------------------
475
draw_scrollers:
341
draw_scrollers:
476
 
-
 
477
	 mov edi,[CounterX]
342
	mov	edi,[CounterX]
478
	 mov eax,[Scroll1CoordinatX]
343
	mov	eax,[Scroll1CoordinatX]
479
	 mov ebx,[Window_SizeY]
344
	mov	ebx,[Window_SizeY]
480
	 sub ebx,22+10
345
	sub	ebx,22+10
481
	 mov ecx,[Window_SizeX]
346
	mov	ecx,[Window_SizeX]
Line 485... Line 350...
485
	 mov [Scroll1CoordinatX],eax
350
	mov	[Scroll1CoordinatX],eax
486
	 mov [Scroll1CoordinatY],ebx
351
	mov	[Scroll1CoordinatY],ebx
487
	 mov [Scroll1MaxSizeY],edx
352
	mov	[Scroll1MaxSizeY],edx
488
	 mov [Scroll1MaxSizeX],ecx
353
	mov	[Scroll1MaxSizeX],ecx
489
	 imul ecx,edi
354
	imul	ecx,edi
490
	 push eax
-
 
491
	 push ebx
-
 
492
	 push edx
355
	push	eax	ebx	edx
493
	 mov eax,ecx
356
	mov	eax,ecx
494
	 mov ebx,[Picture_SizeX]
357
	mov	ebx,[Picture_SizeX]
495
	 cdq
358
	cdq
496
	 idiv ebx
359
	idiv	ebx
497
	 mov ecx,eax
360
	mov	ecx,eax
498
	 pop edx
-
 
499
	 pop ebx
-
 
500
	 pop eax
361
	pop	edx	ebx	eax
501
	 mov [Scroll1SizeX],ecx
362
	mov	[Scroll1SizeX],ecx
502
	 mov edi,[Scroll1MaxSizeX]
363
	mov	edi,[Scroll1MaxSizeX]
503
	 sub edi,ecx
364
	sub	edi,ecx
504
	 mov [Scroll1FreeX],edi
365
	mov	[Scroll1FreeX],edi
505
	 call draw_volume_rectangle
366
	call	draw_volume_rectangle
Line 515... Line 376...
515
	 mov [Scroll2CoordinatY],ebx
376
	mov	[Scroll2CoordinatY],ebx
516
	 mov [Scroll2MaxSizeX],ecx
377
	mov	[Scroll2MaxSizeX],ecx
517
	 mov [Scroll2MaxSizeY],edx
378
	mov	[Scroll2MaxSizeY],edx
Line 518... Line 379...
518
 
379
 
519
	 imul edx,[CounterY]
-
 
520
	 push eax
380
	imul	edx,[CounterY]
521
	 push ebx
381
	push	eax	ebx
522
	 mov eax,edx
382
	mov	eax,edx
523
	 mov ebx,[Picture_SizeY]
383
	mov	ebx,[Picture_SizeY]
524
	 cdq
384
	cdq
525
	 idiv ebx
385
	idiv	ebx
526
	 mov edx,eax
-
 
527
	 pop ebx
386
	mov	edx,eax
528
	 pop eax
387
	pop	ebx	eax
529
	 mov [Scroll2SizeY],edx
388
	mov	[Scroll2SizeY],edx
530
	 mov edi,[Scroll2MaxSizeY]
389
	mov	edi,[Scroll2MaxSizeY]
531
	 sub edi,edx
390
	sub	edi,edx
Line 532... Line 391...
532
	 mov [Scroll2FreeY],edi
391
	mov	[Scroll2FreeY],edi
Line 533... Line 392...
533
 
392
 
534
	 call draw_volume_rectangle
-
 
Line 535... Line 393...
535
 
393
	call	draw_volume_rectangle
536
	 ret
394
 
537
	 ret
395
	ret