Rev 451 | Rev 600 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 451 | Rev 493 | ||
---|---|---|---|
Line 2... | Line 2... | ||
2 | ; 31.01.07 - ¨á¯à ¢«¥ ¥ª®à४â ï ®âà¨á®¢ª ¯à¨ ¡®«ì讬 § 票¨ ¢ëá®âë ᪨ |
2 | ; 31.01.07 - ¨á¯à ¢«¥ ¥ª®à४â ï ®âà¨á®¢ª ¯à¨ ¡®«ì讬 § 票¨ ¢ëá®âë ᪨ |
3 | ; ¢ëà ¢¨¢ ¨¥ ᨧ㠮â®á¨â¥«ì® à ¡®ç¥© ®¡« á⨠íªà |
3 | ; ¢ëà ¢¨¢ ¨¥ ᨧ㠮â®á¨â¥«ì® à ¡®ç¥© ®¡« á⨠íªà |
4 | window_y=67 |
4 | window_y=67 |
5 | ;window_x=320 |
5 | ;window_x=320 |
6 | window_x=640 |
6 | window_x=640 |
- | 7 | ;--- ¤à㣨¥ ¬ ªà®áë --- |
|
- | 8 | include '../../../develop/examples/editbox/trunk/editbox.inc' |
|
- | 9 | ;include 'editbox.inc' |
|
- | 10 | include 'txtbut.inc' |
|
- | 11 | include '../../../macros.inc' |
|
7 | include 'macros.inc' |
12 | ;include 'macros.inc' |
- | 13 | include 'run.mac' |
|
8 | include 'lang.inc' |
14 | include 'lang.inc' |
9 | meos_header par |
15 | meos_app_start |
10 | use_edit_box |
16 | use_edit_box procinfo,22,5 |
11 | use_txt_button |
17 | use_txt_button |
12 | app_start |
18 | code |
13 | cmp [par],byte 0 |
19 | cmp [par],byte 0 |
14 | jne read_par |
20 | jne read_par |
15 | set_events_mask evm_mouse+evm_button+evm_key+evm_redraw |
21 | mcall 40,EVM_MOUSE+EVM_BUTTON+EVM_KEY+EVM_REDRAW |
16 | red: |
22 | red: |
17 | get_sys_colors sc |
23 | mcall 48,3,sc,40 |
18 | set_sys_colors_txt_button run_but,sc |
24 | set_sys_colors_txt_button run_but,sc |
19 | push dword [sc.work_graph] |
25 | push dword [sc.work_graph] |
20 | pop [input_fn.focus_border_color] |
26 | pop [input_fn.focus_border_color] |
21 | call draw_window |
27 | call draw_window |
22 | still: |
28 | still: |
- | 29 | mcall 10 |
|
- | 30 | cmp al,0x1 ;¥á«¨ ¨§¬¥¨«®áì ¯®«®¦¥¨¥ ®ª |
|
- | 31 | jz red |
|
- | 32 | cmp al,0x2 ;¥á«¨ ¦ â ª« ¢¨è â® ¯¥à¥©â¨ |
|
- | 33 | jz key |
|
- | 34 | cmp al,0x3 ;¥á«¨ ¦ â ª®¯ª â® ¯¥à¥©â¨ |
|
- | 35 | jz button |
|
23 | wait_event red,key,button,mouse,,still |
36 | mouse_edit_box input_fn |
- | 37 | jmp still ;¥á«¨ ¨ç¥£® ¨§ ¯¥à¥ç¨á«¥®£® ⮠ᮢ ¢ 横« |
|
24 | key: |
38 | key: |
25 | get_key |
39 | mcall 2 |
26 | cmp ah,13 |
40 | cmp ah,13 |
27 | je run |
41 | je run |
28 | key_edit_box input_fn |
42 | key_edit_box input_fn |
29 | jmp still |
43 | jmp still |
30 | button: |
44 | button: |
31 | get_pressed_button |
45 | mcall 17 |
32 | dec ah |
46 | dec ah |
33 | jz close |
47 | jz close |
34 | dec ah |
48 | dec ah |
35 | jz run |
49 | jz run |
36 | jmp still |
50 | jmp still |
37 | mouse: |
- | |
38 | mouse_edit_box input_fn |
- | |
39 | jmp still |
- | |
Line 40... | Line 51... | ||
40 | 51 | ||
41 | read_par: |
52 | read_par: |
42 | mov esi,par |
53 | mov esi,par |
43 | mov edi,fn |
54 | mov edi,fn |
Line 97... | Line 108... | ||
97 | mov [edi],al |
108 | mov [edi],al |
98 | inc esi |
109 | inc esi |
99 | inc edi |
110 | inc edi |
100 | jmp @b |
111 | jmp @b |
101 | .stop: |
112 | .stop: |
102 | - | ||
103 | mov eax,70 |
- | |
104 | mov ebx,file_info |
113 | mcall 70,file_info |
105 | int 0x40 |
- | |
Line 106... | Line 114... | ||
106 | 114 | ||
107 | cmp eax,0 |
115 | cmp eax,0 |
108 | jl error |
116 | jl error |
109 | mov [status],run_ok |
117 | mov [status],run_ok |
110 | call draw_status |
118 | call draw_status |
111 | jmp still |
119 | jmp still |
112 | close: |
120 | close: |
Line 113... | Line 121... | ||
113 | app_close |
121 | mcall -1 |
114 | - | ||
115 | error: |
- | |
116 | - | ||
117 | macro cmp_err code,text_ptr |
- | |
118 | { |
- | |
119 | cmp al,code |
- | |
120 | jne @f |
- | |
121 | mov [status],text_ptr |
- | |
122 | @@: |
122 | |
123 | } |
- | |
124 | neg eax |
123 | error: |
125 | - | ||
126 | cmp_err 3,bad_file_sys |
124 | neg eax |
127 | - | ||
128 | cmp_err 5,file_not_find |
125 | cmp_err 3,bad_file_sys |
129 | - | ||
130 | cmp_err 9,bad_fat_table |
126 | cmp_err 5,file_not_find |
131 | - | ||
132 | cmp_err 10,acces_denyied |
127 | cmp_err 9,bad_fat_table |
133 | - | ||
134 | cmp_err 11,device_error |
128 | cmp_err 10,acces_denyied |
135 | - | ||
136 | cmp_err 30,out_of_memory |
129 | cmp_err 11,device_error |
137 | - | ||
138 | cmp_err 31,file_not_executable |
130 | cmp_err 30,out_of_memory |
Line 139... | Line -... | ||
139 | - | ||
140 | cmp_err 32,many_processes |
131 | cmp_err 31,file_not_executable |
141 | 132 | cmp_err 32,many_processes |
|
Line 142... | Line 133... | ||
142 | 133 | ||
143 | call draw_status |
- | |
144 | jmp still |
- | |
145 | 134 | call draw_status |
|
146 | draw_window: |
- | |
147 | push 48 |
135 | jmp still |
- | 136 | ||
148 | pop eax |
137 | draw_window: |
149 | mov ebx,5 |
138 | mcall 48,5 |
150 | int 0x40 |
139 | mov si,bx |
151 | mov si,bx |
140 | |
152 | start_draw_window |
141 | mcall 12,1 |
153 | get_skin_height |
142 | mcall 48,4 |
154 | mov dx,ax |
143 | mov dx,ax |
155 | get_screen_size |
144 | mcall 14 |
156 | xor ecx,ecx |
145 | xor ecx,ecx |
Line 165... | Line 154... | ||
165 | sub bx,window_x |
154 | sub bx,window_x |
166 | shl ebx,15 |
155 | shl ebx,15 |
167 | mov bx,window_x |
156 | mov bx,window_x |
168 | mov edx,[sc.work] |
157 | mov edx,[sc.work] |
169 | or edx,0x33000000 |
158 | or edx,0x33000000 |
170 | xor eax,eax |
- | |
171 | xor esi,esi |
159 | xor esi,esi |
172 | mov edi,grab_text |
160 | mov edi,grab_text |
173 | int 0x40 |
161 | mcall 0 |
Line 174... | Line 162... | ||
174 | 162 | ||
Line 175... | Line 163... | ||
175 | get_procinfo app |
163 | mcall 9,procinfo,-1 |
176 | 164 | ||
177 | mov eax,[app.width] |
165 | mov eax,[procinfo.box.width] |
178 | sub eax,20 |
166 | sub eax,20 |
Line 179... | Line 167... | ||
179 | mov [input_fn.width],eax |
167 | mov [input_fn.width],eax |
Line 186... | Line 174... | ||
186 | mov cx,45 |
174 | mov cx,45 |
187 | push cx |
175 | push cx |
188 | shl ecx,16 |
176 | shl ecx,16 |
189 | pop cx |
177 | pop cx |
190 | mov edx,[sc.work_graph] |
178 | mov edx,[sc.work_graph] |
191 | mov eax,38 |
179 | mcall 38 |
192 | int 0x40 |
- | |
193 | - | ||
194 | draw_edit_box input_fn |
180 | draw_edit_box input_fn |
195 | draw_txt_button run_but |
181 | draw_txt_button run_but |
Line 196... | Line 182... | ||
196 | 182 | ||
Line 197... | Line 183... | ||
197 | call draw_status_text |
183 | call draw_status_text |
198 | 184 | ||
Line 199... | Line 185... | ||
199 | stop_draw_window |
185 | mcall 12,2 |
200 | ret |
186 | ret |
201 | 187 | ||
202 | draw_status: |
188 | draw_status: |
203 | mov ebx,[app.width] |
189 | mov ebx,[procinfo.box.width] |
204 | sub bx,10 |
190 | sub bx,10 |
205 | mov ecx,(50)*65536+12 |
- | |
206 | mov edx,[sc.work] |
191 | mov ecx,(50)*65536+12 |
207 | mov eax,13 |
192 | mov edx,[sc.work] |
208 | int 0x40 |
193 | mcall 13 |
209 | draw_status_text: |
194 | draw_status_text: |
210 | mov edx,[status] |
195 | mov edx,[status] |
211 | xor esi,esi |
196 | xor esi,esi |
212 | @@: |
197 | @@: |
213 | cmp [edx+esi],byte 0 |
198 | cmp [edx+esi],byte 0 |
214 | je @f |
199 | je @f |
215 | inc esi |
- | |
216 | jmp @b |
200 | inc esi |
217 | @@: |
201 | jmp @b |
218 | mov ebx,5*65536+(50) |
- | |
219 | mov ecx,[sc.work_text] |
202 | @@: |
Line 220... | Line 203... | ||
220 | mov eax,4 |
203 | mov ecx,[sc.work_text] |
221 | int 0x40 |
204 | mcall 4,5*65536+(50) |
222 | ret |
205 | ret |
Line 223... | Line 206... | ||
223 | 206 | ||
224 | run_but txt_button 0,5,15,25,2,0,0,run_but_text, |
207 | run_but txt_button 0,5,15,25,2,0,0,run_but_text, |
225 | input_fn edit_box 0,5,5,0xffffff,0,0xaaaaaa,0,511,fn,ed_focus+\ |
208 | input_fn edit_box 0,5,5,0xffffff,0x6a9480,0,0xaaaaaa,0,511,fn,ed_focus+ed_always_focus |
226 | ed_always_focus |
209 | mouse_flag: dd 0x0 |
Line 250... | Line 233... | ||
250 | many_processes db 'Too many processes',0 ; 32 |
233 | many_processes db 'Too many processes',0 ; 32 |
251 | run_ok db 'The program was started successfully',0 |
234 | run_ok db 'The program was started successfully',0 |
252 | grab_text db 'RUN',0 |
235 | grab_text db 'RUN',0 |
253 | run_but_text db 'RUN',0 |
236 | run_but_text db 'RUN',0 |
254 | end if |
237 | end if |
255 | - | ||
256 | mouse_flag: dd 0x0 |
- | |
257 | - | ||
258 | status dd hello |
238 | status dd hello |
Line 259... | Line 239... | ||
259 | 239 | ||
260 | file_info: |
240 | file_info: |
261 | .mode dd 7 |
241 | .mode dd 7 |
Line 264... | Line 244... | ||
264 | dd 0,0 |
244 | dd 0,0 |
265 | .name rb 512 |
245 | .name rb 512 |
Line 266... | Line 246... | ||
266 | 246 | ||
Line 267... | Line 247... | ||
267 | flags dw ? |
247 | flags dw ? |
268 | - | ||
Line 269... | Line 248... | ||
269 | structure_of_potock: |
248 | |
Line 270... | Line -... | ||
270 | rb 100 |
- | |
271 | - | ||
272 | fn rb 512 |
249 | sc system_colors |
273 | 250 | ||
274 | sc sys_color_table |
- | |
275 | app procinfo |
251 | procinfo process_information |
- | 252 | ||
- | 253 | run_par rb 256 |
|
- | 254 | par rb 256 |