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
k_sort_directory:
2
k_sort_directory:
3
	test	dword [status],16
3
	test	dword [status],16
4
	jnz	still
4
	jnz	still
5
	or	dword [status],16
5
	or	dword [status],16
Line 6... Line 6...
6
 
6
 
7
	call	get_memory_for_tread_stack
7
	call	get_memory_for_thread_stack
8
	mov	[thread_stack_5],eax
8
	mov	[thread_stack_5],eax
9
	mcall	51, 1, thread5	;, thread_stack_5
9
	mcall	51,1,thread5	; thread_stack_5
10
	jmp	still
10
	jmp	still
11
;---------------------------------------------------------------------
11
;---------------------------------------------------------------------
12
thread5:				; start of bgrd thread
12
thread5:				; 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	[PID5],eax
15
	mov	[PID5],eax
16
	mcall	40, 0x27
16
	mcall	40,0x27
17
	mov	eax,[sort_type]
17
	mov	eax,[sort_type]
18
	cmp	[sort_type],dword 0
18
	cmp	[sort_type],dword 0
-
 
19
	jne	@f
19
	jne	@f
20
	
20
	mov	[option_group2],sort0
21
	mov	[option_group2],sort0
-
 
22
	jmp	.thread5
21
	jmp	.thread5
23
;---------------------------------------------------------------------
22
@@:
24
@@:
23
	cmp	[sort_type],dword 2
25
	cmp	[sort_type],dword 2
-
 
26
	jne	@f
24
	jne	@f
27
	
25
	mov	[option_group2],sort2
28
	mov	[option_group2],sort2
-
 
29
	jmp	.thread5
26
	jmp	.thread5
30
;---------------------------------------------------------------------
27
@@:
31
@@:
28
	cmp	[sort_type],dword 4
32
	cmp	[sort_type],dword 4
-
 
33
	jne	@f
29
	jne	@f
34
	
30
	mov	[option_group2],sort4
35
	mov	[option_group2],sort4
-
 
36
	jmp	.thread5
31
	jmp	.thread5
37
;---------------------------------------------------------------------
32
@@:
-
 
33
;	cmp	[sort_type],dword 6
-
 
34
;	jne	@f
38
@@:
35
	mov	[option_group2],sort6
39
	mov	[option_group2],sort6
36
;	jmp	.thread5
-
 
37
;@@:
40
;-----------------------------------
38
.thread5:
41
.thread5:
39
	mov	[sort_type_old],eax
42
	mov	[sort_type_old],eax
40
	mov	eax,[option_group2]
43
	mov	eax,[option_group2]
41
	mov	[option_group2_old],eax
-
 
-
 
44
	mov	[option_group2_old],eax
42
	
45
;-----------------------------------
43
.red:
46
.red:
44
	call	.draw_window
-
 
-
 
47
	call	.draw_window
45
 
48
;-----------------------------------
46
.still:
-
 
47
 
49
.still:
48
	mov	eax,10 		; wait here for event
-
 
Line 49... Line 50...
49
	mcall
50
	mcall	10	; wait here for event
50
 
51
 
-
 
52
	cmp	eax,1	; redraw request ?
51
	cmp	eax,1			; redraw request ?
53
	je	.red
52
	je	.red
54
 
-
 
55
	cmp	eax,2	; key in buffer ?
53
	cmp	eax,2			; key in buffer ?
56
	je	.key
54
	je	.key
57
 
-
 
58
	cmp	eax,3	; button in buffer ?
55
	cmp	eax,3			; button in buffer ?
59
	je	.button
56
	je	.button
60
 
57
	cmp	eax,6	; mouse in buffer ?
-
 
Line -... Line 61...
-
 
61
	cmp	eax,6	; mouse in buffer ?
-
 
62
	je	.mouse
58
	je	.mouse
63
 
59
	jmp	.still
64
	jmp	.still
60
 
65
;---------------------------------------------------------------------
Line 61... Line 66...
61
.mouse:
66
.mouse:
62
	push	dword option_boxes_sort
67
	push	dword option_boxes_sort
-
 
68
	call	[option_box_mouse]
63
	call	[option_box_mouse]
69
 
64
 
70
	cmp	[option_group2],sort0
-
 
71
	jne	@f
65
	cmp	[option_group2],sort0
72
	
66
	jne	@f
73
	mov	[sort_type],dword 0
67
	mov	[sort_type],dword 0
74
	jmp	.still
-
 
75
;---------------------------------------------------------------------
68
	jmp	.still
76
@@:
69
@@:
77
	cmp	[option_group2],sort2
-
 
78
	jne	@f
70
	cmp	[option_group2],sort2
79
	
71
	jne	@f
80
	mov	 [sort_type],dword 2
72
	mov	 [sort_type],dword 2
81
	jmp	.still
-
 
82
;---------------------------------------------------------------------
73
	jmp	.still
83
@@:
74
@@:
84
	cmp	[option_group2],sort4
-
 
85
	jne	@f
75
	cmp	[option_group2],sort4
86
	
76
	jne	@f
87
	mov	[sort_type],dword 4
77
	mov	[sort_type],dword 4
88
	jmp	.still
-
 
89
;---------------------------------------------------------------------
78
	jmp	.still
90
@@:
79
@@:
91
	cmp	[option_group2],sort6
80
	cmp	[option_group2],sort6
-
 
-
 
92
	jne	@f
81
	jne	@f
93
	
82
	mov	[sort_type],dword 6
94
	mov	[sort_type],dword 6
83
	jmp	.still
95
	jmp	.still
84
 
96
;---------------------------------------------------------------------
-
 
97
.key:
85
.key:
98
	mcall
86
	mcall
99
	cmp	ah,27
-
 
100
	je	.close
87
	cmp	ah,27
101
 
88
	je	.close
102
	cmp	ah,13
-
 
103
	je	.kok
89
	cmp	ah,13
104
 
90
	je	.kok
105
	cmp	ah,177 ;down
-
 
106
	je	.fdn
91
	cmp	ah,177 ;down
107
 
92
	je	.fdn
108
	cmp	ah,178 ;up
Line 93... Line 109...
93
	cmp	ah,178 ;up
109
	jne	.still
94
	jne	.still
110
 
95
	cmp	[sort_type],0
-
 
-
 
111
	cmp	[sort_type],0
96
	je	.still
112
	je	.still
97
	
113
	
98
	sub	[sort_type],2
114
	sub	[sort_type],2
-
 
115
	jmp	.flagcont
99
	jmp	.flagcont
116
;---------------------------------------------------------------------
Line 100... Line 117...
100
 
117
.fdn:
101
.fdn:
118
	cmp	[sort_type],6
102
	cmp	[sort_type],6
119
	je	.still
-
 
120
	
103
	je	.still
121
	add	[sort_type],2
104
	add	[sort_type],2
122
	
105
	
123
.flagcont:
-
 
124
	cmp	[sort_type],dword 0
106
.flagcont:
125
	jne	@f
107
	cmp	[sort_type],dword 0
126
	
108
	jne	@f
127
	mov	[option_group2],sort0
-
 
128
	call	.draw_opt_boxes
109
	mov	[option_group2],sort0
129
	jmp	.still
110
	call	.draw_opt_boxes
130
;---------------------------------------------------------------------
111
	jmp	.still
131
@@:
-
 
132
	cmp	[sort_type],dword 2
112
@@:
133
	jne	@f
113
	cmp	[sort_type],dword 2
134
	
114
	jne	@f
135
	mov	[option_group2],sort2
-
 
136
	call	.draw_opt_boxes
115
	mov	[option_group2],sort2
137
	jmp	.still
116
	call	.draw_opt_boxes
138
;---------------------------------------------------------------------
117
	jmp	.still
139
@@:
-
 
140
	cmp	[sort_type],dword 4
118
@@:
141
	jne	@f
119
	cmp	[sort_type],dword 4
142
	
120
	jne	@f
143
	mov	[option_group2],sort4
-
 
144
	call	.draw_opt_boxes
121
	mov	[option_group2],sort4
145
	jmp	.still
122
	call	.draw_opt_boxes
146
;---------------------------------------------------------------------
123
	jmp	.still
147
@@:
124
@@:
-
 
-
 
148
	cmp	[sort_type],dword 6
125
	cmp	[sort_type],dword 6
149
	jne	.still	;@f
126
	jne	.still	;@f
150
	
127
	mov	[option_group2],sort6
-
 
128
	call	.draw_opt_boxes
-
 
129
	jmp	.still
151
	mov	[option_group2],sort6
130
 
152
	call	.draw_opt_boxes
-
 
153
	jmp	.still
131
.button:			 ; button
154
;---------------------------------------------------------------------
132
	mov	eax,17 		; get id
155
.button:			 ; button
133
	mcall
156
	mcall	17 		; get id
134
 
157
	cmp	ah,1			; button id=1 ?
135
	cmp	ah,1			; button id=1 ?
158
	jne	.noclose
136
	jne	.noclose
159
;-------------------------------
137
.close:
160
.close:
138
	mov	eax,[sort_type_old]
161
	mov	eax,[sort_type_old]
139
	mov	[sort_type],eax
162
	mov	[sort_type],eax
140
	mov	eax,[option_group2_old]
-
 
141
	mov	[option_group2],eax
163
	mov	eax,[option_group2_old]
142
.close_1:
164
	mov	[option_group2],eax
143
	xor	dword [status],16
-
 
-
 
165
.close_1:
144
	xor	eax,eax
166
	xor	dword [status],16
145
	mov	[PID5],eax
167
	xor	eax,eax
146
 
168
	mov	[PID5],eax
147
	mcall	68,13,[thread_stack_5]
169
	mcall	68,13,[thread_stack_5]
148
	mov	eax,-1 		; close this program
170
	mcall	-1 		; close this program
-
 
171
;---------------------------------------------------------------------
149
	mcall
172
.noclose:
150
.noclose:
173
.kok:
151
.kok:
174
	mov	eax,[load_directory_pointer]
152
	mov	eax,[load_directory_pointer]
175
	cmp	[eax+4],dword 0
153
	cmp	[eax+4],dword 0
-
 
-
 
176
	je	.close_1
154
	je	.close_1
177
	
155
	call	load_directory.copy_dir_path
178
	call	load_directory.copy_dir_path
156
	call	load_directory.sort
179
	call	load_directory.sort
157
	mov	[sort_directory_flag],byte 1
-
 
158
	jmp	.close_1
-
 
159
 
180
	mov	[sort_directory_flag],byte 1
160
;	 *********************************************
181
	jmp	.close_1
161
;	 *******	WINDOW DEFINITIONS AND DRAW ********
-
 
162
;	 *********************************************
-
 
163
 
182
;---------------------------------------------------------------------
164
 
-
 
165
.draw_window:
-
 
166
	mcall	12,1
-
 
167
 
-
 
168
					 ; DRAW WINDOW
-
 
169
	xor	eax,eax			 ; function 0 : define and draw window
183
;	 *********************************************
170
	mov	ebx,100*65536+300	 ; [x start] *65536 + [x size]
-
 
171
	mov	ecx,100*65536+110	 ; [y start] *65536 + [y size]
-
 
172
	mov	edx,0x03909090 		 ; color of work area RRGGBB,8->color gl
-
 
173
	mcall
-
 
174
 
-
 
175
	mov	eax,8
-
 
176
	mov	ebx,120*65536+40
-
 
177
	mov	ecx,50*65536+20
184
;	 ******** WINDOW DEFINITIONS AND DRAW ********
178
	mov	edx,4
-
 
179
	mov	esi,0xdddddd
185
;	 *********************************************
180
	mcall
-
 
181
 
-
 
182
					 ; WINDOW LABEL
-
 
183
	mcall	71,1, labelt5
186
.draw_window:
184
	
-
 
185
	mov	eax,4			 ; function 4 : write text to window
-
 
186
	mov	ebx,46*65536+28		 ; [x start] *65536 + [y start]
187
	mcall	12,1
187
	mov	ecx,0xffffff
188
	xor	eax,eax			 ; function 0 : define and draw window
188
	mov	edx, sorttext
-
 
189
	mov	esi, sorttext.size
-
 
190
	mcall
-
 
191
	mov	ebx,135*65536+57
189
	xor	esi,esi
192
	mov	edx, ok_btn
190
	mcall	,<100,300>,<100,110>,0x13909090,,labelt5
193
	mov	esi, ok_btn.size ;2
191
	mcall	8,<120,40>,<50,20>,4,0xdddddd
194
	mov	ecx,0
-
 
195
	mcall
192
	mcall	4,<46,28>,0xffffff,sorttext,sorttext.size
196
 
193
	xor	ecx,ecx
197
	call	.draw_opt_boxes
194
	mcall	,<135,57>,,ok_btn,ok_btn.size
198
;	mcall	47,0x80000,[PID5],<200, 5>,0xffffff
195
	call	.draw_opt_boxes
199
	mcall	12,2
196
;	mcall	47,0x80000,[PID5],<200, 5>,0xffffff
200
 
197
	mcall	12,2
201
	ret
198
	ret
-
 
199
;---------------------------------------------------------------------