Subversion Repositories Kolibri OS

Rev

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

Rev Author Line No. Line
1951 mario79 1
;---------------------------------------------------------------------
2
k_background:
3
	test	dword [status],8
4
	jnz	still
5
	or	dword [status],8
6
 
2000 mario79 7
	call	get_memory_for_thread_stack
1951 mario79 8
	mov	[thread_stack_4],eax
9
	mcall	51,1,thread4	;, thread_stack_4
10
	jmp	still
11
;---------------------------------------------------------------------
12
thread4:	; start of bgrd thread
13
	mcall	9, procinfo_threads, -1
14
	mov	eax,[ebx+30]
15
	mov	[PID4],eax
16
	mcall	40, 0x27
17
.red:
18
	call	.draw_window
19
.still:
20
	mov	eax,10	; wait here for event
21
	mcall
22
 
23
	cmp	eax,1	; redraw request ?
24
	je	.red
2000 mario79 25
 
1951 mario79 26
	cmp	eax,2	; key in buffer ?
27
	je	.key
2000 mario79 28
 
1951 mario79 29
	cmp	eax,3	; button in buffer ?
30
	je	.button
2000 mario79 31
 
1951 mario79 32
	cmp	eax,6	; mouse in buffer ?
33
	je	.mouse
2000 mario79 34
 
1951 mario79 35
	jmp	.still
2000 mario79 36
;---------------------------------------------------------------------
1951 mario79 37
.mouse:
38
	push	dword option_boxes_bcgr
39
	call	[option_box_mouse]
40
 
41
	cmp	[option_group1],op1
42
	jne	@f
43
	mov	[bgrmode],dword 1
44
	jmp	.still
2000 mario79 45
;---------------------------------------------------------------------
1951 mario79 46
@@:
47
	mov	[bgrmode],dword 2
48
	jmp	.still
2000 mario79 49
;---------------------------------------------------------------------
1951 mario79 50
.key:
51
	mcall
52
	cmp	ah,27
53
	je	.close
2000 mario79 54
 
1951 mario79 55
	cmp	ah,13
56
	je	.kok
2000 mario79 57
 
1951 mario79 58
	cmp	ah,178 ;up
59
	jne	.nofup
2000 mario79 60
 
1951 mario79 61
	cmp	dword [bgrmode],1
62
	je	.fdn
63
.fup:
64
	dec	dword [bgrmode]
65
	jmp	.flagcont
2000 mario79 66
;---------------------------------------------------------------------
1951 mario79 67
.nofup:
68
	cmp	ah,177 ;down
69
	jne	.still
2000 mario79 70
 
71
	cmp	dword [bgrmode],4
1951 mario79 72
	je	.fup
73
.fdn:
74
	inc	dword [bgrmode]
75
.flagcont:
76
	cmp	[bgrmode],dword 1
77
	jne	@f
2000 mario79 78
 
1951 mario79 79
	mov	[option_group1],op1
80
	call	.draw_opt_boxes
81
	jmp	.still
2000 mario79 82
;---------------------------------------------------------------------
1951 mario79 83
@@:
2000 mario79 84
	cmp	[bgrmode],dword 2
85
	jne	@f
86
 
1951 mario79 87
	mov	[option_group1],op2
88
	call	.draw_opt_boxes
89
	jmp	.still
2000 mario79 90
;---------------------------------------------------------------------
91
@@:
92
	cmp	[bgrmode],dword 3
93
	jne	@f
94
 
95
	mov	[option_group1],op3
96
	call	.draw_opt_boxes
97
	jmp	.still
98
;---------------------------------------------------------------------
99
@@:
100
	mov	[option_group1],op4
101
	call	.draw_opt_boxes
102
	jmp	.still
103
;---------------------------------------------------------------------
1951 mario79 104
.button:		; button
105
	mov	eax,17	; get id
106
	mcall
107
 
108
	cmp	ah,1	; button id=1 ?
109
	jne	.noclose
110
.close:
111
	xor	dword [status],8
112
	xor	eax,eax
113
	mov	[PID4],eax
114
 
115
	mcall	68,13,[thread_stack_4]
116
	mov	eax,-1	; close this program
117
	mcall
118
.noclose:
119
.kok:
120
	call	background
121
	jmp	.close
2000 mario79 122
;---------------------------------------------------------------------
1951 mario79 123
;	*********************************************
124
;	*******	WINDOW DEFINITIONS AND DRAW ********
125
;	*********************************************
126
.draw_window:
127
	mcall	12,1
2000 mario79 128
	xor	eax,eax
129
	xor	esi,esi
130
	mcall	,<100,200>,<100,200>,0x13909090,,labelt4
131
	mcall	8,<70,40>,<110,20>,4,0xdddddd
132
	mcall	4,<46,28>,0xffffff,bgrdtext,bgrdtext.size
133
	add	ebx,40*65536+88
134
	xor	ecx,ecx
135
	mcall	,,,ok_btn,ok_btn.size
1951 mario79 136
	call	.draw_opt_boxes
2000 mario79 137
;	mcall	47,0x80000,[PID4],<200, 5>,0xffffff
1951 mario79 138
	mcall	12,2
139
	ret
140
;---------------------------------------------------------------------
141
.draw_opt_boxes:
142
	push	dword option_boxes_bcgr
143
	call	[option_box_draw]
144
	ret