Subversion Repositories Kolibri OS

Rev

Rev 1792 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
3840 mario79 1
;------------------------------------------------------------------------------
1792 yogev_ezra 2
confirmation_action:
3840 mario79 3
	mov	[work_confirmation],0
4
	mov	[work_confirmation_yes],0
5
	jmp	.red
6
;--------------------------------------
1792 yogev_ezra 7
.red_1:
3840 mario79 8
	call	draw_window
9
;--------------------------------------
1792 yogev_ezra 10
.red:
3840 mario79 11
	call	draw_confirmation_button
12
	call	draw_confirmation_menu
13
;--------------------------------------
1792 yogev_ezra 14
.still:
3840 mario79 15
	mcall	10
16
	cmp	eax,1
17
	je	.red_1
18
 
19
	cmp	eax,2
20
	je	key_menu_confirmation
21
 
22
	cmp	eax,3
23
	jne	.still
24
 
25
	mcall	17
26
	cmp	ah,161
27
	je	.no_del
28
 
29
	cmp	ah,160
30
	je	.del
31
 
32
	cmp	ah,1
33
	jne	.still
34
 
35
	mcall	-1
36
;--------------------------------------
1792 yogev_ezra 37
.del:
3840 mario79 38
	mov	[work_confirmation_yes],1
39
;--------------------------------------
1792 yogev_ezra 40
.no_del:
3840 mario79 41
	call	draw_window
42
;--------------------------------------
1792 yogev_ezra 43
.ret:
3840 mario79 44
	ret
45
;------------------------------------------------------------------------------
1792 yogev_ezra 46
draw_confirmation_button:
3840 mario79 47
	mov	ecx,[window_high]
48
	mov	ebx,[window_width]
49
	shr	ecx,1
50
	shr	ebx,1
51
	sub	ebx,45
52
	shl	ecx,16
53
	shl	ebx,16
54
	mov	cx,15
55
	mov	bx,40
56
	mcall	8,,,0x40000000+160,0xffffff
57
	add	ebx,50 shl 16
58
	inc	edx
59
	mcall
60
	ret
61
;------------------------------------------------------------------------------
1792 yogev_ezra 62
draw_confirmation_menu:
3840 mario79 63
	mov	ecx,[window_high]
64
	mov	ebx,[window_width]
65
	shr	ecx,1
66
	shr	ebx,1
67
	sub	ecx,22
68
	sub	ebx,60
69
	shl	ecx,16
70
	shl	ebx,16
71
	mov	cx,44
72
	mov	bx,120
73
	mcall	13,,,0x6060ff
74
	push	ebx ecx
75
	add	ebx,15 shl 16
76
	add	ecx,22 shl 16
77
	mov	bx,40
78
	mov	cx,15
79
	mov	edx,0
80
	push	ebx ecx
81
	cmp	[work_confirmation],0
82
	jne	@f
83
 
84
	add	ebx,50 shl 16
85
;--------------------------------------
1792 yogev_ezra 86
@@:
3840 mario79 87
	mcall
88
	add	ecx,1 shl 16
89
	add	ebx,1 shl 16
90
	mov	bx,38
91
	mov	cx,13
92
	mcall	,,,0x6060ff
93
	pop	ecx ebx
94
	mov	edx,0xff0000
95
	cmp	[work_confirmation],0
96
	je	@f
97
 
98
	add	ebx,50 shl 16
99
	mov	edx,0xaa00
100
;--------------------------------------
1792 yogev_ezra 101
@@:
3840 mario79 102
	mcall
103
	pop	ecx	ebx
104
	shr	ecx,16
105
	mov	bx,cx
106
	add	ebx,15 shl 16+5
107
	mcall	4,,0x90ffffff,[confirmation_type]
108
	add	ebx,7 shl 16+20
109
	mcall	,,,type_yes
110
	add	ebx,56 shl 16
111
	mcall	,,,type_no
112
	ret
113
;------------------------------------------------------------------------------
1792 yogev_ezra 114
key_menu_confirmation:
3840 mario79 115
	mcall	2
116
	cmp	[extended_key],1
117
	je	.extended_key
118
 
119
	test	al,al
120
	jnz	.end_1
121
 
122
	cmp	ah,0xE0
123
	jne	@f
124
;--------------------------------------
1792 yogev_ezra 125
.end_1:
3840 mario79 126
	jmp	confirmation_action.still
127
;--------------------------------------
1792 yogev_ezra 128
@@:
3840 mario79 129
	cmp	ah,75
130
	je	confirmation_key_75.1
131
 
132
	cmp	ah,77
133
	je	confirmation_key_75.1
134
 
135
	cmp	ah,28
136
	je	confirmation_key_28.1
137
;--------------------------------------
1792 yogev_ezra 138
.end:
3840 mario79 139
	cmp	ah,1
140
	jne	confirmation_action.still
141
 
142
	ret
143
;------------------------------------------------------------------------------
1792 yogev_ezra 144
.extended_key:
3840 mario79 145
	mov	[extended_key],0
146
;------------------------------------------------------------------------------
1792 yogev_ezra 147
confirmation_key_75:
3840 mario79 148
	cmp	ah,75	; arrow left
149
	je	.1
150
 
151
	cmp	ah,77	; arrow right
152
	jne	confirmation_key_28
153
;--------------------------------------
1792 yogev_ezra 154
.1:
3840 mario79 155
	dec	[work_confirmation]
156
	and	[work_confirmation],1
157
	jmp	confirmation_action.red
158
;------------------------------------------------------------------------------
1792 yogev_ezra 159
confirmation_key_28:
3840 mario79 160
	cmp	ah,28	; Enter
161
	jne	confirmation_action.still
162
;--------------------------------------
1792 yogev_ezra 163
.1:
3840 mario79 164
	cmp	[work_confirmation],0
165
	jne	@f
166
 
167
	mov	[work_confirmation_yes],1
168
;--------------------------------------
1792 yogev_ezra 169
@@:
3840 mario79 170
	ret
171
;------------------------------------------------------------------------------