Rev 6687 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
6687 | leency | 1 | window_h=85 |
2 | window_w=430 |
||
493 | Lrz | 3 | ;--- другие макросы --- |
9568 | IgorA | 4 | include '../../../KOSfuncs.inc' |
5 | include '../../../load_lib.mac' |
||
1373 | IgorA | 6 | include '../../../develop/libraries/box_lib/trunk/box_lib.mac' |
493 | Lrz | 7 | include 'txtbut.inc' |
8 | include '../../../macros.inc' |
||
9 | include 'run.mac' |
||
309 | heavyiron | 10 | include 'lang.inc' |
3634 | fedesco | 11 | use32 |
9568 | IgorA | 12 | org 0 |
1069 | Lrz | 13 | db 'MENUET01' |
9568 | IgorA | 14 | dd 1 |
1069 | Lrz | 15 | dd start |
16 | dd i_end |
||
17 | dd mem |
||
18 | dd mem |
||
19 | dd par |
||
20 | dd cur_dir_path |
||
21 | |||
22 | |||
23 | ; meos_app_start |
||
24 | ; use_edit_box |
||
25 | @use_library |
||
1373 | IgorA | 26 | use_txt_button |
1069 | Lrz | 27 | ; code |
28 | ;load system lib |
||
29 | align 4 |
||
30 | start: |
||
9568 | IgorA | 31 | sys_load_library library_name, library_path, system_path, myimport |
1373 | IgorA | 32 | cmp eax,-1 |
33 | jz close |
||
1069 | Lrz | 34 | |
1373 | IgorA | 35 | cmp [par],byte 0 |
36 | jne read_par |
||
9568 | IgorA | 37 | mcall SF_SET_EVENTS_MASK, EVM_MOUSE+EVM_BUTTON+EVM_KEY+EVM_REDRAW+EVM_MOUSE_FILTER |
205 | heavyiron | 38 | red: |
9568 | IgorA | 39 | mcall SF_STYLE_SETTINGS,SSF_GET_COLORS,sc,40 |
1373 | IgorA | 40 | edit_boxes_set_sys_color input_fn,input_fn_end,sc |
41 | set_sys_colors_txt_button run_but,sc |
||
42 | push dword [sc.work_graph] |
||
43 | pop [input_fn.focus_border_color] |
||
44 | call draw_window |
||
3634 | fedesco | 45 | still: ;основной обработчик |
9568 | IgorA | 46 | mcall SF_WAIT_EVENT |
1373 | IgorA | 47 | dec eax |
48 | jz red |
||
49 | dec eax |
||
50 | jz key |
||
51 | dec eax |
||
52 | jz button |
||
3634 | fedesco | 53 | ; mouse_edit_box input_fn |
1373 | IgorA | 54 | push dword input_fn |
55 | call [edit_box_mouse] |
||
1069 | Lrz | 56 | |
1373 | IgorA | 57 | jmp still ;если ничего из перечисленного то снова в цикл |
205 | heavyiron | 58 | key: |
9568 | IgorA | 59 | mcall SF_GET_KEY |
1373 | IgorA | 60 | cmp ah,13 |
61 | je run |
||
1069 | Lrz | 62 | ; key_edit_box input_fn |
1373 | IgorA | 63 | push dword input_fn |
64 | call [edit_box_key] |
||
1069 | Lrz | 65 | |
1373 | IgorA | 66 | jmp still |
205 | heavyiron | 67 | button: |
9568 | IgorA | 68 | mcall SF_GET_BUTTON |
1373 | IgorA | 69 | dec ah |
70 | jz close |
||
71 | dec ah |
||
72 | jz run |
||
73 | jmp still |
||
31 | halyavin | 74 | |
205 | heavyiron | 75 | read_par: |
1373 | IgorA | 76 | mov esi,par |
77 | mov edi,fn |
||
78 | mov ecx,256 |
||
79 | rep movsb |
||
205 | heavyiron | 80 | run: |
1373 | IgorA | 81 | xor eax,eax |
82 | mov edi,file_info.name |
||
83 | mov ecx,512 |
||
84 | rep stosb |
||
85 | mov edi,run_par |
||
86 | mov ecx,256 |
||
87 | rep stosb |
||
31 | halyavin | 88 | |
1373 | IgorA | 89 | mov esi,fn |
90 | mov edi,file_info.name |
||
91 | cmp [esi],byte '"' |
||
92 | je copy_fn_with_spaces |
||
205 | heavyiron | 93 | copy_fn: |
1373 | IgorA | 94 | cmp [esi],byte ' ' |
95 | je .stop |
||
96 | cmp [esi],byte 0 |
||
97 | je .stop |
||
98 | mov al,[esi] |
||
99 | mov [edi],al |
||
100 | inc esi |
||
101 | inc edi |
||
102 | jmp copy_fn |
||
205 | heavyiron | 103 | .stop: |
31 | halyavin | 104 | |
1373 | IgorA | 105 | jmp copy_par |
31 | halyavin | 106 | |
205 | heavyiron | 107 | copy_fn_with_spaces: |
1373 | IgorA | 108 | inc esi |
205 | heavyiron | 109 | @@: |
1373 | IgorA | 110 | cmp [esi],byte '"' |
111 | je .stop |
||
112 | cmp [esi],byte 0 |
||
113 | je .stop |
||
114 | mov al,[esi] |
||
115 | mov [edi],al |
||
116 | inc esi |
||
117 | inc edi |
||
118 | jmp @b |
||
205 | heavyiron | 119 | .stop: |
31 | halyavin | 120 | |
205 | heavyiron | 121 | copy_par: |
122 | @@: |
||
1373 | IgorA | 123 | inc esi |
124 | cmp [esi],byte ' ' |
||
125 | je @b |
||
126 | mov edi,run_par |
||
205 | heavyiron | 127 | @@: |
1373 | IgorA | 128 | cmp [esi],byte 0 |
129 | je .stop |
||
130 | mov al,[esi] |
||
131 | mov [edi],al |
||
132 | inc esi |
||
133 | inc edi |
||
134 | jmp @b |
||
205 | heavyiron | 135 | .stop: |
9568 | IgorA | 136 | mcall SF_FILE,file_info |
31 | halyavin | 137 | |
1373 | IgorA | 138 | cmp eax,0 |
139 | jl error |
||
140 | mov [status],run_ok |
||
141 | call draw_status |
||
142 | jmp still |
||
205 | heavyiron | 143 | close: |
9568 | IgorA | 144 | mcall SF_TERMINATE_PROCESS |
31 | halyavin | 145 | |
205 | heavyiron | 146 | error: |
1373 | IgorA | 147 | neg eax |
148 | cmp_err 3,bad_file_sys |
||
149 | cmp_err 5,file_not_find |
||
150 | cmp_err 9,bad_fat_table |
||
151 | cmp_err 10,acces_denyied |
||
152 | cmp_err 11,device_error |
||
153 | cmp_err 30,out_of_memory |
||
154 | cmp_err 31,file_not_executable |
||
155 | cmp_err 32,many_processes |
||
31 | halyavin | 156 | |
1373 | IgorA | 157 | call draw_status |
158 | jmp still |
||
31 | halyavin | 159 | |
160 | draw_window: |
||
9568 | IgorA | 161 | mcall SF_STYLE_SETTINGS,SSF_GET_SCREEN_AREA |
1373 | IgorA | 162 | mov si,bx |
31 | halyavin | 163 | |
9568 | IgorA | 164 | mcall SF_REDRAW, SSF_BEGIN_DRAW |
165 | mcall SF_STYLE_SETTINGS,SSF_GET_SKIN_HEIGHT |
||
1373 | IgorA | 166 | mov dx,ax |
9568 | IgorA | 167 | mcall SF_GET_SCREEN_SIZE |
1373 | IgorA | 168 | xor ecx,ecx |
6687 | leency | 169 | sub cx,window_h+40 |
1373 | IgorA | 170 | sub cx,dx |
171 | add cx,si |
||
172 | shl ecx,16 |
||
173 | mov cx,dx |
||
6687 | leency | 174 | add cx,window_h |
1373 | IgorA | 175 | shr eax,16 |
176 | mov bx,ax |
||
6687 | leency | 177 | sub bx,window_w |
1373 | IgorA | 178 | shl ebx,15 |
6687 | leency | 179 | mov bx,window_w |
1373 | IgorA | 180 | mov edx,[sc.work] |
181 | or edx,0x33000000 |
||
182 | xor esi,esi |
||
183 | mov edi,grab_text |
||
9568 | IgorA | 184 | mcall SF_CREATE_WINDOW |
31 | halyavin | 185 | |
9568 | IgorA | 186 | mcall SF_THREAD_INFO,procinfo,-1 |
31 | halyavin | 187 | |
1373 | IgorA | 188 | mov eax,[procinfo.box.width] |
189 | sub eax,20 |
||
190 | mov [input_fn.width],eax |
||
191 | mov [run_but.width],ax |
||
31 | halyavin | 192 | |
6687 | leency | 193 | ; ; draw line |
194 | ; xor bx,bx |
||
195 | ; shl ebx,16 |
||
196 | ; mov bx,ax |
||
197 | ; add bx,10 |
||
198 | ; mov cx,58 |
||
199 | ; push cx |
||
200 | ; shl ecx,16 |
||
201 | ; pop cx |
||
202 | ; mov edx,[sc.work_graph] |
||
9568 | IgorA | 203 | ; mcall SF_DRAW_LINE |
6687 | leency | 204 | &nbs |