Subversion Repositories Kolibri OS

Rev

Rev 1951 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1951 Rev 2000
Line 2... Line 2...
2
  kabout:
2
kabout:
3
	test dword [status],4
3
	test	dword [status],4
4
	jnz	 still
4
	jnz	still
5
	or	 dword [status],4
5
	or	dword [status],4
Line 6... Line 6...
6
 
6
 
7
	call	get_memory_for_tread_stack
7
	call	get_memory_for_thread_stack
8
	mov	[thread_stack_3],eax
8
	mov	[thread_stack_3],eax
9
	mcall	51,1,thread3	;,thread_stack_3
9
	mcall	51,1,thread3	;thread_stack_3
10
	jmp	still
10
	jmp	still
11
;---------------------------------------------------------------------
11
;---------------------------------------------------------------------
12
thread3:			  ; start of bgrd thread
12
thread3:	  ; start of bgrd thread
13
    mcall 9, procinfo_threads, -1
13
	mcall	9, procinfo_threads, -1
14
    mov   eax,[ebx+30]
14
	mov	eax,[ebx+30]
15
    mov   [PID3],eax
15
	mov	[PID3],eax
-
 
16
	mcall	40,0x7
16
	mcall 40, 0x7
17
;------------------------------
17
.red:
18
.red:
18
     call .draw_window
-
 
-
 
19
	call	.draw_window
19
 
20
;------------------------------
20
.still:
-
 
21
 
21
.still:
22
    mov  eax,10 		; wait here for event
-
 
23
    mcall
-
 
24
 
22
	mcall	10 	; wait here for event
25
    cmp  eax,1			; redraw request ?
23
	cmp	eax,1	; redraw request ?
-
 
24
	je	.red
26
    je	 .red
25
 
27
    cmp  eax,2			; key in buffer ?
26
	cmp	eax,2	; key in buffer ?
-
 
27
	je	.close   ;.key
28
    je	 .close   ;.key
28
 
29
    cmp  eax,3			; button in buffer ?
29
	cmp	eax,3	; button in buffer ?
Line 30... Line 30...
30
    je	 .button
30
	je	.button
31
 
-
 
-
 
31
 
32
    jmp  .still
32
	jmp	.still
33
 
33
;---------------------------------------------------------------------
34
;  .key:
34
;.key:
35
;    mcall
35
;	mcall
36
;    cmp  ah,27
36
;	cmp	ah,27
37
;    je	 .close
-
 
38
;    jmp  .still
-
 
-
 
37
;	je	.close
39
 
38
;	jmp	.still
40
 
39
;---------------------------------------------------------------------
41
.button:			 ; button
-
 
42
    mov  eax,17 		; get id
-
 
43
    mcall
40
.button:			 ; button
44
 
41
	mcall	17 		; get id
-
 
42
	cmp	ah,1			; button id=1 ?
45
    cmp  ah,1			; button id=1 ?
43
	je	.close
46
	je   .close
44
	
-
 
45
	cmp	ah,2
47
	cmp  ah,2
46
	jne	.still   ;noclose3
48
    jne  .still   ;noclose3
-
 
49
.close:
-
 
50
;    btr dword [status],3
47
    
51
;    bts dword [status],2
48
.close:
52
	xor  dword [status],4
49
	xor	dword [status],4
53
	xor   eax,eax
50
	xor	eax,eax
54
	mov   [PID3],eax
51
	mov	[PID3],eax
55
	mcall	68,13,[thread_stack_3]
-
 
56
	mov  eax,-1 	; close this program
-
 
57
	mcall
52
	mcall	68,13,[thread_stack_3]
58
;  .noclose:
-
 
59
;     jmp  still3
-
 
60
 
-
 
61
 
-
 
62
 
53
	mcall	-1 	; close this program
63
 
54
;---------------------------------------------------------------------
64
;   *********************************************
55
;   *********************************************
65
;   *******  WINDOW DEFINITIONS AND DRAW ********
-
 
66
;   *********************************************
-
 
67
 
56
;   *******  WINDOW DEFINITIONS AND DRAW ********
68
 
-
 
69
.draw_window:
-
 
70
 
-
 
71
 
-
 
72
    mov  eax,12 		   ; function 12:tell os about windowdraw
57
;   *********************************************
73
    mov  ebx,1			   ; 1, start of draw
-
 
74
    mcall
-
 
75
 
58
.draw_window:
76
				   ; DRAW WINDOW
59
	mcall	12,1
77
    xor  eax,eax		   ; function 0 : define and draw window
60
	xor	eax,eax		   ; function 0 : define and draw window
78
    mov  ebx,100*65536+300	   ; [x start] *65536 + [x size]
61
	xor	esi,esi
79
    mov  ecx,100*65536+240	   ; [y start] *65536 + [y size]
-
 
80
    mov  edx,0x03eeeeee 	   ; color of work area RRGGBB,8->color gl
-
 
81
    mcall
62
	mcall	,<100,300>,<100,240>,0x13eeeeee,,labelt3
82
 
63
	mcall	8,<120,40>,<210,20>,2,0xdddddd
83
    mov  ebx,120*65536+40
64
	add	ebx,15 shl 16
84
    mov  ecx,210*65536+20
65
	shr	ecx,16
85
    mov  edx,2
66
	mov	bx,cx
86
    mov  esi,0xdddddd
-
 
87
    mcall 8
67
	add	ebx,6
88
	
68
	xor	ecx,ecx
89
	pusha
69
	mcall	4,,,ok_btn,ok_btn.size
90
    mcall 4,<20,30>,0x80000000,Authors_text.1
-
 
91
	mcall  ,<30,45>, ,Authors_text.2
70
	mcall	,<20,30>,0x80000000,Authors_text.1
92
 
71
	mcall	,<30,45>, ,Authors_text.2
93
	mcall  ,<30,60>, ,Authors_text.3
72
	mcall	,<30,60>, ,Authors_text.3
94
	mcall  ,<60,70>, ,Authors_text.4
73
	mcall	,<60,70>, ,Authors_text.4
95
	mcall  ,<60,80>, ,Authors_text.5
74
	mcall	,<60,80>, ,Authors_text.5
96
	mcall  ,<60,90>, ,Authors_text.6
-
 
97
	mcall  ,<60,100>, ,Authors_text.7
75
	mcall	,<60,90>, ,Authors_text.6
98
 
76
	mcall	,<60,100>, ,Authors_text.7
99
	mcall  ,<30,115>, ,Authors_text.8
77
	mcall	,<30,115>, ,Authors_text.8
100
	mcall  ,<60,125>, ,Authors_text.9
-
 
101
	mcall  ,<60,135>, ,Authors_text.10
78
	mcall	,<60,125>, ,Authors_text.9
102
 
79
	mcall	,<60,135>, ,Authors_text.10
103
	mcall  ,<30,150>, ,Authors_text.11
-
 
104
	mcall  ,<60,160>, ,Authors_text.12
80
	mcall	,<30,150>, ,Authors_text.11
105
 
81
	mcall	,<60,160>, ,Authors_text.12
106
	mcall  ,<30,175>, ,Authors_text.13
-
 
107
	mcall  ,<60,185>, ,Authors_text.14
-
 
108
	popa
-
 
109
	
-
 
110
    add  ebx,15 shl 16
-
 
111
	shr  ecx,16
-
 
112
	mov  bx,cx
-
 
113
	add  ebx,6
-
 
114
	
-
 
115
	mov  ecx,0
-
 
116
    mov  edx, ok_btn
-
 
117
    mov  esi, ok_btn.size ;2
-
 
118
    mcall 4
-
 
119
	
-
 
120
				   ; WINDOW LABEL
82
	mcall	,<30,175>, ,Authors_text.13
121
    mcall 71,1, labelt3
-
 
122
;    mcall 47,0x80000,[PID3],<200, 5>,0xffffff
-
 
123
    mov  eax,12 		   ; function 12:tell os about windowdraw
83
	mcall	,<60,185>, ,Authors_text.14
124
    mov  ebx,2			   ; 2, end of draw
-
 
125
    mcall
84
;	mcall	47,0x80000,[PID3],<200, 5>,0xffffff
126
 
85
	mcall	12,2
127
    ret
86
	ret