Rev 1456 | Rev 1458 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1456 | Rev 1457 | ||
---|---|---|---|
1 | ;£à®¬ ï ¡« £®¤ à®áâì Maxxxx32, Diamond, Heavyiron |
1 | ;£à®¬ ï ¡« £®¤ à®áâì Maxxxx32, Diamond, Heavyiron |
2 | ;¨ ¤à㣨¬ ¯à®£à ¬¬¨áâ ¬, â ª¦¥ |
2 | ;¨ ¤à㣨¬ ¯à®£à ¬¬¨áâ ¬, â ª¦¥ |
3 | ;¥¯«®¢ã «¥ªá¥î ( |
3 | ;¥¯«®¢ã «¥ªá¥î ( |
4 | 4 | ||
5 | 5 | ||
6 | use32 |
6 | use32 |
7 | org 0x0 |
7 | org 0x0 |
8 | db 'MENUET01' ;¨¤¥â¨ä. ¨á¯®«ï¥¬®£® ä ©« ¢á¥£¤ 8 ¡ ©â |
8 | db 'MENUET01' ;¨¤¥â¨ä. ¨á¯®«ï¥¬®£® ä ©« ¢á¥£¤ 8 ¡ ©â |
9 | dd 0x01 |
9 | dd 0x01 |
10 | dd start |
10 | dd start |
11 | dd i_end ; à §¬¥à ¯à¨«®¦¥¨ï |
11 | dd i_end ; à §¬¥à ¯à¨«®¦¥¨ï |
12 | dd mem |
12 | dd mem |
13 | dd stacktop |
13 | dd stacktop |
14 | dd file_name ; command line |
14 | dd file_name ; command line |
15 | dd sys_path |
15 | dd sys_path |
16 | 16 | ||
17 | MAX_COLOR_WORD_LEN equ 40 |
17 | MAX_COLOR_WORD_LEN equ 40 |
18 | maxChars equ 100002 ;(...+2) |
18 | maxChars equ 100002 ;(...+2) |
19 | BUF_SIZE equ 1000 ;bufer for copy|paste |
19 | BUF_SIZE equ 1000 ;buffer for copy|paste |
20 | maxColWords equ 10000 |
20 | maxSyntaxFileSize equ 410000 |
21 | 21 | ||
22 | include '../../proc32.inc' |
22 | include '../../proc32.inc' |
23 | include '../../macros.inc' |
23 | include '../../macros.inc' |
24 | include '../../develop/libraries/box_lib/load_lib.mac' |
24 | include '../../develop/libraries/box_lib/load_lib.mac' |
25 | include '../../develop/libraries/box_lib/trunk/box_lib.mac' |
25 | include '../../develop/libraries/box_lib/trunk/box_lib.mac' |
26 | 26 | ||
27 | include 'lang.inc' |
27 | include 'lang.inc' |
28 | include 't_data.inc' |
28 | include 't_data.inc' |
29 | include 'strlen.inc' |
29 | include 'strlen.inc' |
30 | include 't_work.inc' ;text work functions |
- | |
31 | include 't_draw.inc' ;draw main window functions |
30 | include 't_draw.inc' ;draw main window functions |
32 | include 't_button.inc' |
31 | include 't_button.inc' ;text work functions |
33 | 32 | ||
34 | @use_library |
33 | @use_library |
35 | 34 | ||
36 | align 4 |
35 | align 4 |
37 | start: |
36 | start: |
38 | mcall 48,3,sc,sizeof.system_colors |
37 | mcall 48,3,sc,sizeof.system_colors |
- | 38 | ||
39 | 39 | mov eax,[sc.work] |
|
40 | m2m [wScr.bckg_col],[sc.work] |
40 | mov [wScr.bckg_col],eax |
41 | m2m [wScr.frnt_col],[sc.work_button] |
41 | mov [hScr.bckg_col],eax |
42 | m2m [wScr.line_col],[sc.work_button_text] |
- | |
43 | 42 | mov eax,[sc.work_button] |
|
44 | m2m [hScr.bckg_col],[sc.work] |
43 | mov [wScr.frnt_col],eax |
45 | m2m [hScr.frnt_col],[sc.work_button] |
44 | mov [hScr.frnt_col],eax |
46 | m2m [hScr.line_col],[sc.work_button_text] |
- | |
- | 45 | mov eax,[sc.work_button_text] |
|
- | 46 | mov [wScr.line_col],eax |
|
47 | 47 | mov [hScr.line_col],eax |
|
48 | 48 | ||
49 | mcall 68,11 |
49 | mcall 68,11 |
50 | or eax,eax |
50 | or eax,eax |
51 | jz button.exit |
51 | jz button.exit |
52 | 52 | ||
53 | mcall 66,1,1 ;scan code |
53 | mcall 66,1,1 ;scan code |
54 | ;mcall 26,2,1,conv_tabl |
54 | ;mcall 26,2,1,conv_tabl |
55 | mcall 40,0x27 |
55 | mcall 40,0x27 |
56 | 56 | ||
57 | mov esi,file_name |
57 | mov esi,file_name |
58 | call strlen |
58 | call strlen |
59 | mov ecx,eax |
59 | mov ecx,eax |
60 | mov edi,buf_cmd_lin |
60 | mov edi,buf_cmd_lin |
61 | rep movsb ;ª®¯¨à㥬 ¨¬ï ä ©« ¢ ¡ãä¥à edit1 |
61 | rep movsb ;ª®¯¨à㥬 ¨¬ï ä ©« ¢ ¡ãä¥à edit1 |
62 | 62 | ||
63 | load_libraries l_libs_start,load_lib_end |
63 | load_libraries l_libs_start,load_lib_end |
64 | 64 | ||
65 | ;¯à®¢¥àª ᪮«ìª® ã¤ ç® § £ã§¨« áì è «¨¡ |
65 | ;¯à®¢¥àª ᪮«ìª® ã¤ ç® § £ã§¨« áì è «¨¡ |
66 | mov ebp,lib0 |
66 | mov ebp,lib0 |
67 | cmp dword [ebp+ll_struc_size-4],0 |
67 | cmp dword [ebp+ll_struc_size-4],0 |
68 | jz @f |
68 | jz @f |
69 | mcall -1 ;exit not correct |
69 | mcall -1 ;exit not correct |
70 | @@: |
70 | @@: |
71 | mov ebp,lib1 ; |
71 | mov ebp,lib1 ; |
72 | cmp dword [ebp+ll_struc_size-4],0 |
72 | cmp dword [ebp+ll_struc_size-4],0 |
73 | jz @f |
73 | jz @f |
74 | mcall -1 ;exit not correct |
74 | mcall -1 ;exit not correct |
75 | @@: |
75 | @@: |
76 | 76 | ||
77 | ;--------------------------------------------------------------------- |
77 | ;--------------------------------------------------------------------- |
78 | stdcall ted_init, tedit0 |
78 | stdcall [ted_init], tedit0 |
79 | stdcall dword[tl_data_init], tree1 |
79 | stdcall dword[tl_data_init], tree1 |
80 | ;--------------------------------------------------------------------- |
80 | ;--------------------------------------------------------------------- |
81 | 81 | ||
82 | ; init bmp file |
82 | ; init bmp file |
83 | mov ecx,1200*18 |
83 | mov ecx,1200*18 |
84 | call mem_Alloc |
84 | call mem_Alloc |
85 | mov [bmp_icon],eax |
85 | mov [bmp_icon],eax |
86 | 86 | ||
87 | copy_path fn_icon,sys_path,file_name,0x0 |
87 | copy_path fn_icon,sys_path,file_name,0x0 |
88 | 88 | ||
89 | mov eax,70 ;load icon file |
89 | mov eax,70 ;load icon file |
90 | mov [run_file_70.func_n], 0 |
90 | mov [run_file_70.func_n], 0 |
91 | mov [run_file_70.param1], 54 |
91 | mov [run_file_70.param1], 54 |
92 | mov [run_file_70.param2], 0 |
92 | mov [run_file_70.param2], 0 |
93 | mov [run_file_70.param3], 1200*18 |
93 | mov [run_file_70.param3], 1200*18 |
94 | m2m [run_file_70.param4], [bmp_icon] |
94 | m2m [run_file_70.param4], [bmp_icon] |
95 | mov [run_file_70.rezerv], 0 |
95 | mov [run_file_70.rezerv], 0 |
96 | mov [run_file_70.name], file_name |
96 | mov [run_file_70.name], file_name |
97 | mov ebx,run_file_70 |
97 | mov ebx,run_file_70 |
98 | int 0x40 |
98 | int 0x40 |
99 | 99 | ||
100 | cmp ebx,-1 |
100 | cmp ebx,-1 |
101 | mov [err_ini0],1 |
101 | mov [err_ini0],1 |
102 | je @f ;if open file |
102 | je @f ;if open file |
103 | mov [err_ini0],0 |
103 | mov [err_ini0],0 |
104 | @@: |
104 | @@: |
105 | 105 | ||
106 | ;--------------------------------------------------------------------- |
106 | ;--------------------------------------------------------------------- |
107 | ; ç¨â ¥¬ bmp ä ©« á ªãàá®à ¬¨ ¨ «¨¨ï¬¨ |
107 | ; ç¨â ¥¬ bmp ä ©« á ªãàá®à ¬¨ ¨ «¨¨ï¬¨ |
108 | copy_path fn_icon_tl_sys,sys_path,file_name,0x0 |
108 | copy_path fn_icon_tl_sys,sys_path,file_name,0x0 |
109 | 109 | ||
110 | mov ecx,3*256*13 |
110 | mov ecx,3*256*13 |
111 | call mem_Alloc |
111 | call mem_Alloc |
112 | mov dword[tree1.data_img_sys],eax |
112 | mov dword[tree1.data_img_sys],eax |
113 | 113 | ||
114 | ;mov [run_file_70.func_n], 0 |
114 | ;mov [run_file_70.func_n], 0 |
115 | ;mov [run_file_70.param1], 54 |
115 | ;mov [run_file_70.param1], 54 |
116 | ;mov [run_file_70.param2], 0 |
116 | ;mov [run_file_70.param2], 0 |
117 | mov [run_file_70.param3], 3*256*13 |
117 | mov [run_file_70.param3], 3*256*13 |
118 | mov [run_file_70.param4], eax |
118 | mov [run_file_70.param4], eax |
119 | ;mov [run_file_70.rezerv], 0 |
119 | ;mov [run_file_70.rezerv], 0 |
120 | ;mov [run_file_70.name], file_name |
120 | ;mov [run_file_70.name], file_name |
121 | 121 | ||
122 | mov eax,70 ;load icon file |
122 | mov eax,70 ;load icon file |
123 | mov ebx,run_file_70 |
123 | mov ebx,run_file_70 |
124 | int 0x40 |
124 | int 0x40 |
125 | cmp ebx,0 |
125 | cmp ebx,0 |
126 | jg @f |
126 | jg @f |
127 | mov dword[tree1.data_img_sys],0 |
127 | mov dword[tree1.data_img_sys],0 |
128 | @@: |
128 | @@: |
129 | ;--------------------------------------------------------------------- |
129 | ;--------------------------------------------------------------------- |
130 | ; ç¨â ¥¬ bmp ä ©« á ¨ª®ª ¬¨ 㧫®¢ |
130 | ; ç¨â ¥¬ bmp ä ©« á ¨ª®ª ¬¨ 㧫®¢ |
131 | copy_path fn_icon_tl_nod,sys_path,file_name,0x0 |
131 | copy_path fn_icon_tl_nod,sys_path,file_name,0x0 |
132 | 132 | ||
133 | mov ecx,3*256*2 |
133 | mov ecx,3*256*2 |
134 | call mem_Alloc |
134 | call mem_Alloc |
135 | mov dword[tree1.data_img],eax |
135 | mov dword[tree1.data_img],eax |
136 | 136 | ||
137 | ; mov [run_file_70.func_n], 0 |
137 | ; mov [run_file_70.func_n], 0 |
138 | ; mov [run_file_70.param1], 54 |
138 | ; mov [run_file_70.param1], 54 |
139 | ; mov [run_file_70.param2], 0 |
139 | ; mov [run_file_70.param2], 0 |
140 | mov [run_file_70.param3], 3*256*2 |
140 | mov [run_file_70.param3], 3*256*2 |
141 | mov [run_file_70.param4], eax |
141 | mov [run_file_70.param4], eax |
142 | ; mov [run_file_70.rezerv], 0 |
142 | ; mov [run_file_70.rezerv], 0 |
143 | ; mov [run_file_70.name], file_name |
143 | ; mov [run_file_70.name], file_name |
144 | 144 | ||
145 | mov eax,70 ;load icon file |
145 | mov eax,70 ;load icon file |
146 | mov ebx,run_file_70 |
146 | mov ebx,run_file_70 |
147 | int 0x40 |
147 | int 0x40 |
148 | cmp ebx,0 |
148 | cmp ebx,0 |
149 | jg @f |
149 | jg @f |
150 | mov dword[tree1.data_img],0 |
150 | mov dword[tree1.data_img],0 |
151 | @@: |
151 | @@: |
152 | ;------------------------------------------------------------------------------ |
152 | ;------------------------------------------------------------------------------ |
153 | copy_path fn_syntax_dir,sys_path,file_name,0x0 ;¡¥à¥¬ ¯ãâì ª ¯ ¯ª¥ á ä ©« ¬¨ á¨â ªá¨á |
153 | copy_path fn_syntax_dir,sys_path,file_name,0x0 ;¡¥à¥¬ ¯ãâì ª ¯ ¯ª¥ á ä ©« ¬¨ á¨â ªá¨á |
154 | mov eax,70 |
154 | mov eax,70 |
155 | mov ebx,tree_file_struct |
155 | mov ebx,tree_file_struct |
156 | int 0x40 |
156 | int 0x40 |
157 | 157 | ||
158 | cmp ebx,-1 |
158 | cmp ebx,-1 |
159 | je .end_dir_init |
159 | je .end_dir_init |
160 | 160 | ||
161 | mov eax,dir_mem |
161 | mov eax,dir_mem |
162 | add eax,32+4+1+3+4*6+8 |
162 | add eax,32+4+1+3+4*6+8 |
163 | mov ecx,ebx |
163 | mov ecx,ebx |
164 | @@: |
164 | @@: |
165 | cmp byte[eax],'.' ;䨫ìâà㥬 ä ©«ë á ¨¬¥ ¬¨ '.' ¨ '..' |
165 | cmp byte[eax],'.' ;䨫ìâà㥬 ä ©«ë á ¨¬¥ ¬¨ '.' ¨ '..' |
166 | je .filter |
166 | je .filter |
167 | ;0x10000 ;1*2^16 - £¤¥ 1 ®¬¥à ¨ª®ª¨ á ª¨£®© |
167 | ;0x10000 ;1*2^16 - £¤¥ 1 ®¬¥à ¨ª®ª¨ á ª¨£®© |
168 | stdcall dword[tl_node_add], eax,0x10000, tree1 |
168 | stdcall dword[tl_node_add], eax,0x10000, tree1 |
169 | 169 | ||
170 | stdcall dword[tl_cur_next], tree1 |
170 | stdcall dword[tl_cur_next], tree1 |
171 | .filter: |
171 | .filter: |
172 | add eax,304 |
172 | add eax,304 |
173 | loop @b |
173 | loop @b |
174 | .end_dir_init: |
174 | .end_dir_init: |
175 | 175 | ||
176 | ;--- load color option file --- |
176 | ;--- load color option file --- |
- | 177 | mov ebx,dword[fn_col_option] |
|
- | 178 | copy_path ebx,fn_syntax_dir,file_name_rez,0x0 |
|
- | 179 | copy_path file_name_rez,sys_path,file_name,0x0 |
|
177 | stdcall InitColText, tedit0 |
180 | stdcall [ted_init_syntax_file], tedit0,run_file_70,file_name |
178 | 181 | ||
179 | ;--- get cmd line --- |
182 | ;--- get cmd line --- |
180 | cmp byte[buf_cmd_lin+3],0 ;buf_cmd_lin |
183 | cmp byte[buf_cmd_lin+3],0 ;buf_cmd_lin |
181 | je @f ;if file names exist |
184 | je @f ;if file names exist |
182 | mov esi,buf_cmd_lin |
185 | mov esi,buf_cmd_lin |
183 | call strlen ;eax=strlen |
186 | call strlen ;eax=strlen |
184 | mov [edit1.size],eax |
187 | mov [edit1.size],eax |
185 | call but_no_msg_OpenFile |
188 | call but_no_msg_OpenFile |
186 | @@: |
189 | @@: |
187 | 190 | ||
188 | align 4 |
191 | align 4 |
189 | red_win: |
192 | red_win: |
190 | mcall 12,1 |
193 | mcall 12,1 |
191 | 194 | ||
192 | xor eax,eax |
195 | xor eax,eax |
193 | mov ebx,10*65536+485 |
196 | mov ebx,10*65536+485 |
194 | mov ecx,10*65536+280 |
197 | mov ecx,10*65536+280 |
195 | mov edx,[sc.work] |
198 | mov edx,[sc.work] |
196 | or edx,0x73000000 |
199 | or edx,0x73000000 |
197 | mov edi,hed |
200 | mov edi,hed |
198 | int 0x40 |
201 | int 0x40 |
199 | 202 | ||
200 | mov edi,tedit0 |
203 | mov edi,tedit0 |
201 | 204 | ||
202 | mcall 9,procinfo,-1 |
205 | mcall 9,procinfo,-1 |
203 | stdcall EvSize,edi |
206 | stdcall EvSize,edi |
204 | 207 | ||
205 | mov eax,13 ;âåðõíèé ïðÿìîóãîëüíèê, äëÿ î÷èñòêè âåðõíåé ïàíåëè |
208 | mov eax,13 ;¢¥à娩 ¯àאַ㣮«ì¨ª, ¤«ï ®ç¨á⪨ ¢¥à奩 ¯ ¥«¨ |
206 | xor ebx,ebx |
209 | xor ebx,ebx |
207 | mov ecx,ted_wnd_t |
210 | mov ecx,ted_wnd_t |
208 | mov bx,word [procinfo.client_box.width] |
211 | mov bx,word [procinfo.client_box.width] |
209 | inc bx |
212 | inc bx |
210 | int 0x40 |
213 | int 0x40 |
211 | 214 | ||
212 | stdcall [edit_box_draw], dword edit1 |
215 | stdcall [edit_box_draw], dword edit1 |
213 | stdcall [menu_bar_draw], dword menu_data_1 |
216 | stdcall [menu_bar_draw], dword menu_data_1 |
214 | 217 | ||
215 | call draw_but_toolbar |
218 | call draw_but_toolbar |
216 | 219 | ||
217 | cmp [err_ini0],1 |
220 | cmp [err_ini0],1 |
218 | jne @f |
221 | jne @f |
219 | mov eax,4 |
222 | mov eax,4 |
220 | mov ebx,ted_wnd_l |
223 | mov ebx,ted_wnd_l |
221 | add ebx,ted_rec_l |
224 | add ebx,ted_rec_l |
222 | shl ebx,16 |
225 | shl ebx,16 |
223 | add ebx,ted_wnd_t |
226 | add ebx,ted_wnd_t |
224 | add ebx,ted_rec_t |
227 | add ebx,ted_rec_t |
225 | mov ecx,0x80ff0000 |
228 | mov ecx,0x80ff0000 |
226 | mov edx,txtErrIni0 |
229 | mov edx,txtErrIni0 |
227 | int 0x40 |
230 | int 0x40 |
228 | 231 | ||
229 | add ebx,10 ;move <--y--> |
232 | add ebx,10 ;move <--y--> |
230 | mov ecx,0x80ff0080 |
233 | mov ecx,0x80ff0080 |
231 | mov edx,file_name |
234 | mov edx,file_name |
232 | int 0x40 |
235 | int 0x40 |
233 | @@: |
236 | @@: |
234 | 237 | ||
235 | cmp [err_ini0],1 |
238 | cmp [err_ini0],1 |
236 | je @f |
239 | je @f |
237 | stdcall draw_main_win, tedit0 |
240 | stdcall [ted_draw], tedit0 |
238 | @@: |
241 | @@: |
239 | 242 | ||
240 | mcall 12,2 |
243 | mcall 12,2 |
241 | 244 | ||
242 | align 4 |
245 | align 4 |
243 | still: |
246 | still: |
244 | mov eax,10 |
247 | mov eax,10 |
245 | mcall |
248 | mcall |
246 | 249 | ||
247 | cmp al,1 ;¨§¬. ¯®«®¦¥¨¥ ®ª |
250 | cmp al,1 ;¨§¬. ¯®«®¦¥¨¥ ®ª |
248 | jz red_win |
251 | jz red_win |
249 | cmp al,2 |
252 | cmp al,2 |
250 | jz key |
253 | jz key |
251 | cmp al,3 |
254 | cmp al,3 |
252 | jz button |
255 | jz button |
253 | cmp al,6 |
256 | cmp al,6 |
254 | jz mouse |
257 | jz mouse |
255 | 258 | ||
256 | jmp still |
259 | jmp still |
257 | 260 | ||
258 | 261 | ||
259 | align 4 |
262 | align 4 |
260 | mouse: |
263 | mouse: |
261 | stdcall [edit_box_mouse], dword edit1 |
264 | stdcall [edit_box_mouse], dword edit1 |
262 | 265 | ||
263 | test word [edit1.flags],10b;ed_focus ; ¥á«¨ ¥ ¢ 䮪ãá¥, ¢ë室¨¬ |
266 | test word [edit1.flags],10b;ed_focus ; ¥á«¨ ¥ ¢ 䮪ãá¥, ¢ë室¨¬ |
264 | jne still |
267 | jne still |
265 | - | ||
266 | ;----------------------------------------------- |
- | |
267 | cmp [hScr.delta2],0 |
- | |
268 | jne .horizontal |
- | |
269 | .vertical: |
- | |
270 | mov eax,[wScr.max_area] |
- | |
271 | cmp eax,[wScr.cur_area] |
- | |
272 | jbe .horizontal |
- | |
273 | ; mouse event for Vertical ScrollBar |
268 | |
274 | stdcall [scrollbar_ver_mouse], dword wScr |
- | |
275 | mov eax,wScr.redraw |
- | |
276 | xor ebx,ebx |
- | |
277 | cmp [eax],ebx |
- | |
278 | je @f |
- | |
279 | mov [eax],ebx |
- | |
280 | - | ||
281 | stdcall draw_main_win, tedit0 |
- | |
282 | jmp still |
- | |
283 | @@: |
- | |
284 | cmp [wScr.delta2],0 |
- | |
285 | jne still |
- | |
286 | .horizontal: |
- | |
287 | mov eax,[hScr.max_area] |
- | |
288 | cmp eax,[hScr.cur_area] |
- | |
289 | jbe .other |
- | |
290 | ; mouse event for Horizontal ScrollBar |
- | |
291 | push dword hScr |
- | |
292 | call [scrollbar_hor_mouse] |
- | |
293 | mov eax,hScr.redraw |
- | |
294 | xor ebx,ebx |
- | |
295 | cmp [eax],ebx |
- | |
296 | je .other |
- | |
297 | mov [eax],ebx |
- | |
298 | stdcall draw_main_win, tedit0 |
- | |
299 | jmp still |
- | |
300 | .other: |
- | |
301 | cmp [wScr.delta2],0 |
- | |
302 | jne still |
- | |
303 | cmp [hScr.delta2],0 |
- | |
304 | jne still |
- | |
305 | - | ||
306 | stdcall mouse_wnd_main, tedit0 |
269 | stdcall [ted_mouse], tedit0 |
307 | 270 | ||
308 | cmp byte[tedit0.panel_id],TE_PANEL_FIND ;if not panel |
271 | cmp byte[tedit0.panel_id],TED_PANEL_FIND ;if not panel |
309 | jne @f |
272 | jne @f |
310 | stdcall [edit_box_mouse], dword edit2 |
273 | stdcall [edit_box_mouse], dword edit2 |
311 | @@: |
274 | @@: |
312 | cmp byte[tedit0.panel_id],TE_PANEL_SYNTAX ;if not panel |
275 | cmp byte[tedit0.panel_id],TED_PANEL_SYNTAX ;if not panel |
313 | jne .menu_bar_1 ;@f |
276 | jne .menu_bar_1 ;@f |
314 | stdcall [tl_mouse], tree1 |
277 | stdcall [tl_mouse], tree1 |
315 | ;----------------------------------------------- |
278 | ;----------------------------------------------- |
316 | .menu_bar_1: |
279 | .menu_bar_1: |
317 | mov [menu_data_1.get_mouse_flag],1 |
280 | mov [menu_data_1.get_mouse_flag],1 |
318 | ; mouse event for Menu 1 |
281 | ; mouse event for Menu 1 |
319 | push dword menu_data_1 |
282 | push dword menu_data_1 |
320 | call [menu_bar_mouse] |
283 | call [menu_bar_mouse] |
321 | cmp [menu_data_1.click],dword 1 |
284 | cmp [menu_data_1.click],dword 1 |
322 | jne .mnu_1 |
285 | jne .mnu_1 |
323 | cmp [menu_data_1.cursor_out],dword 4 |
286 | cmp [menu_data_1.cursor_out],dword 4 |
324 | je button.exit |
287 | je button.exit |
325 | cmp [menu_data_1.cursor_out],dword 3 |
288 | cmp [menu_data_1.cursor_out],dword 3 |
326 | jne @f |
289 | jne @f |
327 | stdcall but_SaveFile, tedit0 |
290 | stdcall [ted_but_save_file], tedit0,run_file_70,[edit1.text] |
328 | @@: |
291 | @@: |
329 | cmp [menu_data_1.cursor_out],dword 2 |
292 | cmp [menu_data_1.cursor_out],dword 2 |
330 | jne @f |
293 | jne @f |
331 | call but_OpenFile |
294 | call ted_but_open_file |
332 | @@: |
295 | @@: |
333 | cmp [menu_data_1.cursor_out],dword 1 |
296 | cmp [menu_data_1.cursor_out],dword 1 |
334 | jne @f |
297 | jne @f |
335 | call but_NewFile |
298 | call ted_but_new_file |
336 | @@: |
299 | @@: |
337 | ;cmp [menu_data_1.cursor_out],dword 0 |
300 | ;cmp [menu_data_1.cursor_out],dword 0 |
338 | ;jne @f |
301 | ;jne @f |
339 | .mnu_1: |
302 | .mnu_1: |
340 | jmp still |
303 | jmp still |
341 | ;--------------------------------------------------------------------- |
304 | ;--------------------------------------------------------------------- |
342 | 305 | ||
343 | ;output: |
306 | ;output: |
344 | ; ah = symbol |
307 | ; ah = symbol |
345 | align 4 |
308 | align 4 |
346 | proc KeyConvertToASCII, table:dword |
309 | proc KeyConvertToASCII, table:dword |
347 | push ebx |
310 | push ebx |
348 | mov ebx,dword[table] ;convert scan to ascii |
311 | mov ebx,dword[table] ;convert scan to ascii |
349 | ror ax,8 |
312 | ror ax,8 |
350 | xor ah,ah |
313 | xor ah,ah |
351 | add bx,ax |
314 | add bx,ax |
352 | mov ah,byte[ebx] |
315 | mov ah,byte[ebx] |
353 | pop ebx |
316 | pop ebx |
354 | ret |
317 | ret |
355 | endp |
318 | endp |
356 | 319 | ||
357 | align 4 |
320 | align 4 |
358 | key: |
321 | key: |
359 | mcall 66,3 ;66.3 ¯®«ãç¨âì á®áâ®ï¨¥ ã¯à ¢«ïîé¨å ª« ¢¨è |
322 | mcall 66,3 ;66.3 ¯®«ãç¨âì á®áâ®ï¨¥ ã¯à ¢«ïîé¨å ª« ¢¨è |
360 | xor ebx,ebx |
323 | xor esi,esi |
361 | mov ecx,1 |
324 | mov ecx,1 |
362 | test al,0x03 ;[Shift] |
325 | test al,0x03 ;[Shift] |
363 | jz @f |
326 | jz @f |
364 | mov cl,2 |
327 | mov cl,2 |
365 | or ebx,KM_SHIFT |
328 | or esi,KM_SHIFT |
366 | @@: |
329 | @@: |
367 | test al,0x0c ;[Ctrl] |
330 | test al,0x0c ;[Ctrl] |
368 | jz @f |
331 | jz @f |
369 | or ebx,KM_CTRL |
332 | or esi,KM_CTRL |
370 | @@: |
333 | @@: |
371 | test al,0x30 ;[Alt] |
334 | test al,0x30 ;[Alt] |
372 | jz @f |
335 | jz @f |
373 | mov cl,3 |
336 | mov cl,3 |
374 | or ebx,KM_ALT |
337 | or esi,KM_ALT |
375 | @@: |
338 | @@: |
376 | test al,0x80 ;[NumLock] |
339 | test al,0x80 ;[NumLock] |
377 | jz @f |
340 | jz @f |
378 | or ebx,KM_NUMLOCK |
341 | or esi,KM_NUMLOCK |
379 | @@: |
342 | @@: |
- | 343 | ||
380 | mcall 26,2,,conv_tabl ;26.2 ¯®«ãç¨âì à ᪫ ¤ªã ª« ¢¨ âãàë |
344 | mcall 26,2,,conv_tabl ;26.2 ¯®«ãç¨âì à ᪫ ¤ªã ª« ¢¨ âãàë |
381 | mcall 2 ;¯®«ãç ¥¬ ª®¤ ¦ ⮩ ª« ¢¨è¨ |
345 | mcall 2 ;¯®«ãç ¥¬ ª®¤ ¦ ⮩ ª« ¢¨è¨ |
382 | ;stdcall [tl_key], tree1 ;??? |
346 | ;stdcall [tl_key], tree1 |
383 | 347 | ||
384 | test word [edit1.flags],10b;ed_focus ; ¥á«¨ ¥ ¢ 䮪ãá¥, ¢ë室¨¬ |
348 | test word [edit1.flags],10b;ed_focus ; ¥á«¨ ¥ ¢ 䮪ãá¥, ¢ë室¨¬ |
385 | je @f |
349 | je @f |
386 | cmp ah,0x80 ;if key up |
350 | cmp ah,0x80 ;if key up |
387 | ja still |
351 | ja still |
388 | cmp ah,42 ;[Shift] (left) |
352 | cmp ah,42 ;[Shift] (left) |
389 | je still |
353 | je still |
390 | cmp ah,54 ;[Shift] (right) |
354 | cmp ah,54 ;[Shift] (right) |
391 | je still |
355 | je still |
392 | cmp ah,56 ;[Alt] |
356 | cmp ah,56 ;[Alt] |
393 | je still |
357 | je still |
394 | cmp ah,29 ;[Ctrl] |
358 | cmp ah,29 ;[Ctrl] |
395 | je still |
359 | je still |
396 | cmp ah,69 ;[Pause Break] |
360 | cmp ah,69 ;[Pause Break] |
397 | je still |
361 | je still |
398 | 362 | ||
399 | stdcall KeyConvertToASCII, dword conv_tabl |
363 | stdcall KeyConvertToASCII, dword conv_tabl |
400 | stdcall [edit_box_key], dword edit1 |
364 | stdcall [edit_box_key], dword edit1 |
401 | jmp still |
365 | jmp still |
402 | @@: |
366 | @@: |
403 | 367 | ||
404 | test word [edit2.flags],10b;ed_focus ; ¥á«¨ ¥ ¢ 䮪ãá¥, ¢ë室¨¬ |
368 | test word [edit2.flags],10b;ed_focus ; ¥á«¨ ¥ ¢ 䮪ãá¥, ¢ë室¨¬ |
405 | je @f |
369 | je @f |
406 | cmp ah,0x80 ;if key up |
370 | cmp ah,0x80 ;if key up |
407 | ja still |
371 | ja still |
408 | cmp ah,42 ;[Shift] (left) |
372 | cmp ah,42 ;[Shift] (left) |
409 | je still |
373 | je still |
410 | cmp ah,54 ;[Shift] (right) |
374 | cmp ah,54 ;[Shift] (right) |
411 | je still |
375 | je still |
412 | cmp ah,56 ;[Alt] |
376 | cmp ah,56 ;[Alt] |
413 | je still |
377 | je still |
414 | cmp ah,29 ;[Ctrl] |
378 | cmp ah,29 ;[Ctrl] |
415 | je still |
379 | je still |
416 | cmp ah,69 ;[Pause Break] |
380 | cmp ah,69 ;[Pause Break] |
417 | je still |
381 | je still |
418 | 382 | ||
419 | stdcall KeyConvertToASCII, dword conv_tabl |
383 | stdcall KeyConvertToASCII, dword conv_tabl |
420 | stdcall [edit_box_key], dword edit2 |
384 | stdcall [edit_box_key], dword edit2 |
421 | jmp still |
385 | jmp still |
422 | @@: |
386 | @@: |
423 | 387 | ||
424 | stdcall ted_key, tedit0, conv_tabl |
388 | stdcall [ted_key], tedit0, conv_tabl,esi |
- | 389 | jmp still |
|
425 | jmp still |
390 | |
426 | 391 | align 4 |
|
427 | button: |
392 | button: |
428 | ; cmp [menu_active],1 ;¥á«¨ ¦ «¨ ¬¥î, â® á ç « ॠªæ¨ï ¬¥î |
393 | ; cmp [menu_active],1 ;¥á«¨ ¦ «¨ ¬¥î, â® á ç « ॠªæ¨ï ¬¥î |
429 | ; jne @f ;mouse.menu_bar_1 |
394 | ; jne @f ;mouse.menu_bar_1 |
430 | ; mov [menu_active],0 |
395 | ; mov [menu_active],0 |
431 | ; jmp still |
396 | ; jmp still |
432 | ; @@: |
397 | ; @@: |
433 | 398 | ||
434 | mcall 17 ;¯®«ãç¨âì ª®¤ ¦ ⮩ ª®¯ª¨ |
399 | mcall 17 ;¯®«ãç¨âì ª®¤ ¦ ⮩ ª®¯ª¨ |
435 | cmp ah,3 |
400 | cmp ah,3 |
436 | jne @f |
401 | jne @f |
437 | call but_NewFile |
402 | call ted_but_new_file |
438 | @@: |
403 | @@: |
439 | cmp ah,4 |
404 | cmp ah,4 |
440 | jne @f |
405 | jne @f |
441 | call but_OpenFile |
406 | call ted_but_open_file |
442 | @@: |
407 | @@: |
443 | cmp ah,5 |
408 | cmp ah,5 |
444 | jne @f |
409 | jne @f |
445 | stdcall but_SaveFile, tedit0 |
410 | stdcall [ted_but_save_file], tedit0,run_file_70,[edit1.text] |
446 | @@: |
411 | @@: |
447 | cmp ah,6 |
412 | cmp ah,6 |
448 | jne @f |
413 | jne @f |
449 | stdcall ted_but_select_word, tedit0 |
414 | stdcall [ted_but_select_word], tedit0 |
450 | @@: |
415 | @@: |
451 | cmp ah,7 |
416 | cmp ah,7 |
452 | jne @f |
417 | jne @f |
453 | stdcall ted_but_cut, tedit0 |
418 | stdcall [ted_but_cut], tedit0 |
454 | @@: |
419 | @@: |
455 | cmp ah,8 |
420 | cmp ah,8 |
456 | jne @f |
421 | jne @f |
457 | stdcall ted_but_copy, tedit0 |
422 | stdcall [ted_but_copy], tedit0 |
458 | @@: |
423 | @@: |
459 | cmp ah,9 |
424 | cmp ah,9 |
460 | jne @f |
425 | jne @f |
461 | stdcall ted_but_paste, tedit0 |
426 | stdcall [ted_but_paste], tedit0 |
462 | @@: |
427 | @@: |
463 | cmp ah,10 |
428 | cmp ah,10 |
464 | jne @f |
429 | jne @f |
465 | stdcall but_find, tedit0 |
430 | call ted_but_find |
466 | @@: |
431 | @@: |
467 | cmp ah,11 |
432 | cmp ah,11 |
468 | jne @f |
433 | jne @f |
469 | call but_replace |
434 | call but_replace |
470 | @@: |
435 | @@: |
471 | cmp ah,12 |
436 | cmp ah,12 |
472 | jne @f |
437 | jne @f |
473 | call but_find_key_w |
438 | call but_find_key_w |
474 | @@: |
439 | @@: |
475 | cmp ah,13 |
440 | cmp ah,13 |
476 | jne @f |
441 | jne @f |
477 | stdcall but_sumb_upper, tedit0 |
442 | stdcall [ted_but_sumb_upper], tedit0 |
478 | @@: |
443 | @@: |
479 | cmp ah,14 |
444 | cmp ah,14 |
480 | jne @f |
445 | jne @f |
481 | stdcall but_sumb_lover, tedit0 |
446 | stdcall [ted_but_sumb_lover], tedit0 |
482 | @@: |
447 | @@: |
483 | cmp ah,15 |
448 | cmp ah,15 |
484 | jne @f |
449 | jne @f |
485 | stdcall but_reverse, tedit0 |
450 | stdcall [ted_but_reverse], tedit0 |
486 | @@: |
451 | @@: |
487 | cmp ah,16 |
452 | cmp ah,16 |
488 | jne @f |
453 | jne @f |
489 | stdcall ted_but_undo, tedit0 |
454 | stdcall [ted_but_undo], tedit0 |
490 | @@: |
455 | @@: |
491 | cmp ah,17 |
456 | cmp ah,17 |
492 | jne @f |
457 | jne @f |
493 | stdcall ted_but_redo, tedit0 |
458 | stdcall [ted_but_redo], tedit0 |
494 | @@: |
459 | @@: |
495 | cmp ah,18 |
460 | cmp ah,18 |
496 | jne @f |
461 | jne @f |
497 | stdcall but_sumb_invis, tedit0 |
462 | stdcall but_sumb_invis, tedit0 |
498 | @@: |
463 | @@: |
499 | cmp ah,19 |
464 | cmp ah,19 |
500 | jne @f |
465 | jne @f |
501 | stdcall but_k_words_show, tedit0 |
466 | stdcall but_k_words_show, tedit0 |
502 | @@: |
467 | @@: |
503 | cmp ah,20 |
468 | cmp ah,20 |
504 | jne @f |
469 | jne @f |
505 | stdcall but_synt_show, tedit0 |
470 | stdcall but_synt_show, tedit0 |
506 | @@: |
471 | @@: |
507 | 472 | ||
508 | cmp ah,200 |
473 | cmp ah,200 |
509 | jne @f |
474 | jne @f |
510 | stdcall ted_but_open_syntax, tedit0 |
475 | stdcall ted_but_open_syntax, tedit0 |
511 | @@: |
476 | @@: |
512 | cmp ah,201 |
477 | cmp ah,201 |
513 | jne @f |
478 | jne @f |
514 | stdcall but_FindText, tedit0 |
479 | stdcall [ted_but_find_next], tedit0 |
515 | @@: |
480 | @@: |
516 | 481 | ||
517 | cmp ah,1 |
482 | cmp ah,1 |
518 | jne still |
483 | jne still |
519 | .exit: |
484 | .exit: |
520 | stdcall ted_can_save, tedit0 |
485 | stdcall [ted_can_save], tedit0 |
521 | cmp al,1 |
486 | cmp al,1 |
522 | jne @f |
487 | jne @f |
523 | stdcall [mb_create],msgbox_8,thread ;message: save changes in file? |
488 | stdcall [mb_create],msgbox_8,thread ;message: save changes in file? |
524 | jmp still |
489 | jmp still |
525 | @@: |
490 | @@: |
526 | mov ecx,[bmp_icon] |
491 | mov ecx,[bmp_icon] |
527 | call mem_Free |
492 | call mem_Free |
528 | 493 | ||
529 | stdcall ted_delete, tedit0 |
494 | stdcall [ted_delete], tedit0 |
530 | stdcall dword[tl_data_clear], tree1 |
495 | stdcall dword[tl_data_clear], tree1 |
531 | mcall -1 ;¢ë室 ¨§ ¯à®£à ¬¬ë |
496 | mcall -1 ;¢ë室 ¨§ ¯à®£à ¬¬ë |
532 | 497 | ||
533 | 498 | ||
534 | 499 | ||
535 | txtErrIni0 db '¥ ®âªàë«áï ä ©« á ¨ª®ª ¬¨',0 |
500 | txtErrIni0 db '¥ ®âªàë«áï ä ©« á ¨ª®ª ¬¨',0 |
536 | err_ini0 db 0 |
501 | err_ini0 db 0 |
537 | 502 | ||
538 | edit1 edit_box 250, 220, 5, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 300, buf_cmd_lin, mouse_dd, 0 |
503 | edit1 edit_box 250, 220, 5, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 300, buf_cmd_lin, mouse_dd, 0 |
539 | edit2 edit_box TE_PANEL_WIDTH-1, 0, 20, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 300, buf_find, mouse_dd, 0 |
504 | edit2 edit_box TED_PANEL_WIDTH-1, 0, 20, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 300, buf_find, mouse_dd, 0 |
540 | 505 | ||
541 | buf_cmd_lin db 302 dup(0) |
506 | buf_cmd_lin db 302 dup(0) |
542 | buf_find db 302 dup(0) |
507 | buf_find db 302 dup(0) |
543 | 508 | ||
544 | if lang eq ru |
509 | if lang eq ru |
545 | err_message_found_lib0 db '§¢¨¨â¥ ¥ 㤠«®áì ©â¨ ¡¨¡«¨®â¥ªã box_lib.obj',0 |
510 | err_message_found_lib0 db '§¢¨¨â¥ ¥ 㤠«®áì ©â¨ ¡¨¡«¨®â¥ªã box_lib.obj',0 |
546 | head_f_i0: |
511 | head_f_i0: |
547 | head_f_l0 db '¨á⥬ ï ®è¨¡ª ',0 |
512 | head_f_l0 db '¨á⥬ ï ®è¨¡ª ',0 |
548 | err_message_import0 db '訡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ box_lib.obj',0 |
513 | err_message_import0 db '訡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ box_lib.obj',0 |
549 | err_message_found_lib1 db '§¢¨¨â¥ ¥ 㤠«®áì ©â¨ ¡¨¡«¨®â¥ªã msgbox.obj',0 |
514 | err_message_found_lib1 db '§¢¨¨â¥ ¥ 㤠«®áì ©â¨ ¡¨¡«¨®â¥ªã msgbox.obj',0 |
550 | err_message_import1 db '訡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ msgbox.obj',0 |
515 | err_message_import1 db '訡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ msgbox.obj',0 |
551 | else |
516 | else |
552 | err_message_found_lib0 db 'Sorry I cannot found library box_lib.obj',0 |
517 | err_message_found_lib0 db 'Sorry I cannot found library box_lib.obj',0 |
553 | head_f_i0: |
518 | head_f_i0: |
554 | head_f_l0 db 'System error',0 |
519 | head_f_l0 db 'System error',0 |
555 | err_message_import0 db 'Error on load import library box_lib.obj',0 |
520 | err_message_import0 db 'Error on load import library box_lib.obj',0 |
556 | err_message_found_lib1 db 'Sorry I cannot found library msgbox.obj',0 |
521 | err_message_found_lib1 db 'Sorry I cannot found library msgbox.obj',0 |
557 | ;head_f_i1: |
522 | ;head_f_i1: |
558 | ;head_f_l1 db 'System error',0 |
523 | ;head_f_l1 db 'System error',0 |
559 | err_message_import1 db 'Error on load import library msgbox.obj',0 |
524 | err_message_import1 db 'Error on load import library msgbox.obj',0 |
560 | end if |
525 | end if |
561 | 526 | ||
562 | ;library structures |
527 | ;library structures |
563 | l_libs_start: |
528 | l_libs_start: |
564 | lib0 l_libs boxlib_name, sys_path, file_name, system_dir0, err_message_found_lib0, head_f_l0, myimport,err_message_import0, head_f_i0 |
529 | lib0 l_libs boxlib_name, sys_path, file_name, system_dir0, err_message_found_lib0, head_f_l0, myimport,err_message_import0, head_f_i0 |
565 | lib1 l_libs msgbox_name, sys_path, file_name, system_dir1, err_message_found_lib1, head_f_l0, msgbox_lib_import, err_message_import1, head_f_i0 |
530 | lib1 l_libs msgbox_name, sys_path, file_name, system_dir1, err_message_found_lib1, head_f_l0, msgbox_lib_import, err_message_import1, head_f_i0 |
566 | load_lib_end: |
531 | load_lib_end: |
567 | 532 | ||
568 | 533 | ||
569 | i_end: |
534 | i_end: |
570 | align 16 |
535 | align 16 |
571 | procinfo process_information |
536 | procinfo process_information |
572 | thread: |
537 | thread: |
573 | rb 1024 |
538 | rb 1024 |
574 | stacktop: |
539 | stacktop: |
575 | sys_path: |
540 | sys_path: |
576 | rb 4096 |
541 | rb 4096 |
577 | file_name: |
542 | file_name: |
578 | rb 4096 |
543 | rb 4096 |
579 | file_name_rez: |
544 | file_name_rez: |
580 | rb 4096 |
545 | rb 4096 |
581 | file_info: |
546 | file_info: |
582 | rb 40 |
547 | rb 40 |
583 | mem:--y--> |
548 | mem:--y--> |