Subversion Repositories Kolibri OS

Rev

Rev 4990 | Rev 7575 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4990 Rev 5911
1
use32
1
use32
2
  org 0x0
2
  org 0x0
3
  db 'MENUET01' ;¨¤¥­â¨ä. ¨á¯®«­ï¥¬®£® ä ©«  ¢á¥£¤  8 ¡ ©â
3
  db 'MENUET01' ;¨¤¥­â¨ä. ¨á¯®«­ï¥¬®£® ä ©«  ¢á¥£¤  8 ¡ ©â
4
  dd 0x01
4
  dd 0x01
5
  dd start
5
  dd start
6
  dd i_end ; à §¬¥à ¯à¨«®¦¥­¨ï
6
  dd i_end ; à §¬¥à ¯à¨«®¦¥­¨ï
7
  dd mem
7
  dd mem
8
  dd stacktop
8
  dd stacktop
9
  dd file_name
9
  dd file_name
10
  dd sys_path
10
  dd sys_path
11
 
11
 
12
MAX_COLOR_WORD_LEN equ 40
12
MAX_COLOR_WORD_LEN equ 40
13
BUF_SIZE equ 4096 ;buffer for copy|paste
13
BUF_SIZE equ 4096 ;buffer for copy|paste
14
maxSyntaxFileSize equ 310000
14
maxSyntaxFileSize equ 310000
15
CAPT_PATH_WIDTH equ 50 ;è¨à¨­  ¯®¤¯¨á¨ ¯¥à¥¤ ⥪áâ®¢ë¬ ¯®«¥¬
15
CAPT_PATH_WIDTH equ 50 ;è¨à¨­  ¯®¤¯¨á¨ ¯¥à¥¤ ⥪áâ®¢ë¬ ¯®«¥¬
16
 
16
 
17
include '../../macros.inc'
17
include '../../macros.inc'
18
include '../../proc32.inc'
18
include '../../proc32.inc'
19
include '../../develop/libraries/box_lib/load_lib.mac'
19
include '../../develop/libraries/box_lib/load_lib.mac'
20
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
20
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
21
include '../../dll.inc'
21
include '../../dll.inc'
22
include 'te_data.inc'
22
include 'te_data.inc'
23
include 'te_work.inc' ;text work functions
23
include 'te_work.inc' ;text work functions
24
 
24
 
25
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
25
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
26
 
26
 
27
;Œ ªà®á ¤«ï § £à㧪¨ ¨§®¡à ¦¥­¨© á ¨á¯®«ì§®¢ ­¨¥¬ ¡¨¡«¨®â¥ª¨ libimg.obj
27
;Œ ªà®á ¤«ï § £à㧪¨ ¨§®¡à ¦¥­¨© á ¨á¯®«ì§®¢ ­¨¥¬ ¡¨¡«¨®â¥ª¨ libimg.obj
28
;¤«ï ¨á¯®«ì§®¢ ­¨ï ¬ ªà®á  ­ã¦­ë ¯¥à¥¬¥­­ë¥:
28
;¤«ï ¨á¯®«ì§®¢ ­¨ï ¬ ªà®á  ­ã¦­ë ¯¥à¥¬¥­­ë¥:
29
; - run_file_70 FileInfoBlock
29
; - run_file_70 FileInfoBlock
30
; - image_data dd 0
30
; - image_data dd 0
31
macro load_image_file path,buf,size
31
macro load_image_file path,buf,size
32
{
32
{
33
	;path - ¬®¦¥â ¡ëâì ¯¥à¥¬¥­­®© ¨«¨ áâப®¢ë¬ ¯ à ¬¥â஬
33
	;path - ¬®¦¥â ¡ëâì ¯¥à¥¬¥­­®© ¨«¨ áâப®¢ë¬ ¯ à ¬¥â஬
34
	if path eqtype '' ;¯à®¢¥à塞 § ¤ ­ «¨ áâப®© ¯ à ¬¥âà path
34
	if path eqtype '' ;¯à®¢¥à塞 § ¤ ­ «¨ áâப®© ¯ à ¬¥âà path
35
		jmp @f
35
		jmp @f
36
			local .path_str
36
			local .path_str
37
			.path_str db path ;ä®à¬¨à㥬 «®ª «ì­ãî ¯¥à¥¬¥­­ãî
37
			.path_str db path ;ä®à¬¨à㥬 «®ª «ì­ãî ¯¥à¥¬¥­­ãî
38
			db 0
38
			db 0
39
		@@:
39
		@@:
40
		;32 - áâ ­¤ àâ­ë©  ¤à¥á ¯® ª®â®à®¬ã ¤®«¦¥­ ¡ëâì ¡ãä¥à á á¨á⥬­ë¬ ¯ã⥬
40
		;32 - áâ ­¤ àâ­ë©  ¤à¥á ¯® ª®â®à®¬ã ¤®«¦¥­ ¡ëâì ¡ãä¥à á á¨á⥬­ë¬ ¯ã⥬
41
		copy_path .path_str,[32],file_name,0x0
41
		copy_path .path_str,[32],file_name,0
42
	else
42
	else
43
		copy_path path,[32],file_name,0x0 ;ä®à¬¨à㥬 ¯®«­ë© ¯ãâì ª ä ©«ã ¨§®¡à ¦¥­¨ï, ¯®¤à §ã¬¥¢ ¥¬ çâ® ®­ ¢ ®¤­®© ¯ ¯ª¥ á ¯à®£à ¬¬®©
43
		copy_path path,[32],file_name,0 ;ä®à¬¨à㥬 ¯®«­ë© ¯ãâì ª ä ©«ã ¨§®¡à ¦¥­¨ï, ¯®¤à §ã¬¥¢ ¥¬ çâ® ®­ ¢ ®¤­®© ¯ ¯ª¥ á ¯à®£à ¬¬®©
44
	end if
44
	end if
45
 
45
 
46
	stdcall mem.Alloc, dword size ;¢ë¤¥«ï¥¬ ¯ ¬ïâì ¤«ï ¨§®¡à ¦¥­¨ï
46
	stdcall mem.Alloc, dword size ;¢ë¤¥«ï¥¬ ¯ ¬ïâì ¤«ï ¨§®¡à ¦¥­¨ï
47
	mov [buf],eax
47
	mov [buf],eax
48
 
-
 
49
	mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
48
 
50
	mov [run_file_70.Function], 0
49
	mov [run_file_70.Function], 0
51
	mov [run_file_70.Position], 0
50
	mov [run_file_70.Position], 0
52
	mov [run_file_70.Flags], 0
51
	mov [run_file_70.Flags], 0
53
	mov [run_file_70.Count], dword size
52
	mov [run_file_70.Count], dword size
54
	m2m [run_file_70.Buffer], [buf]
53
	mov [run_file_70.Buffer], eax
55
	mov byte[run_file_70+20], 0
54
	mov byte[run_file_70+20], 0
56
	mov [run_file_70.FileName], file_name
55
	mov [run_file_70.FileName], file_name
57
	mov ebx,run_file_70
-
 
58
	int 0x40 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
56
	mcall 70,run_file_70 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
59
	cmp ebx,0xffffffff
57
	cmp ebx,0xffffffff
60
	je @f
58
	je @f
61
		;®¯à¥¤¥«ï¥¬ ¢¨¤ ¨§®¡à ¦¥­¨ï ¨ ¯¥à¥¢®¤¨¬ ¥£® ¢® ¢à¥¬¥­­ë© ¡ãä¥à image_data
59
		;®¯à¥¤¥«ï¥¬ ¢¨¤ ¨§®¡à ¦¥­¨ï ¨ ¯¥à¥¢®¤¨¬ ¥£® ¢® ¢à¥¬¥­­ë© ¡ãä¥à image_data
62
		stdcall dword[img_decode], dword[buf],ebx,0
60
		stdcall dword[img_decode], dword[buf],ebx,0
63
		mov dword[image_data],eax
61
		mov dword[image_data],eax
64
		;¯à¥®¡à §ã¥¬ ¨§®¡à ¦¥­¨¥ ª ä®à¬ âã rgb
62
		;¯à¥®¡à §ã¥¬ ¨§®¡à ¦¥­¨¥ ª ä®à¬ âã rgb
65
		stdcall dword[img_to_rgb2], dword[image_data],dword[buf]
63
		stdcall dword[img_to_rgb2], dword[image_data],dword[buf]
66
		;㤠«ï¥¬ ¢à¥¬¥­­ë© ¡ãä¥à image_data
64
		;㤠«ï¥¬ ¢à¥¬¥­­ë© ¡ãä¥à image_data
67
		stdcall dword[img_destroy], dword[image_data]
65
		stdcall dword[img_destroy], dword[image_data]
68
	@@:
66
	@@:
69
}
67
}
70
 
68
 
71
image_data dd 0 ;㪠§ â¥«ì ­  ¢à¥¬¥­­ãî ¯ ¬ïâì. ¤«ï ­ã¦¥­ ¯à¥®¡à §®¢ ­¨ï ¨§®¡à ¦¥­¨ï
69
image_data dd 0 ;㪠§ â¥«ì ­  ¢à¥¬¥­­ãî ¯ ¬ïâì. ¤«ï ­ã¦¥­ ¯à¥®¡à §®¢ ­¨ï ¨§®¡à ¦¥­¨ï
72
icon_tl_sys dd 0 ;㪠§ â¥«ì ­  ¯ ¬ïâì ¤«ï åà ­¥­¨ï á¨á⥬­ëå ¨ª®­®ª
70
icon_tl_sys dd 0 ;㪠§ â¥«ì ­  ¯ ¬ïâì ¤«ï åà ­¥­¨ï á¨á⥬­ëå ¨ª®­®ª
73
 
71
 
74
align 4
72
align 4
75
start:
73
start:
76
	mcall 48,3,sc,sizeof.system_colors
74
	mcall 48,3,sc,sizeof.system_colors
77
 
75
 
78
	mcall 68,11
76
	mcall 68,11
79
	or eax,eax
77
	or eax,eax
80
	jz button.exit
78
	jz button.exit
81
 
79
 
82
	mcall 66,1,1 ;scan code
80
	mcall 66,1,1 ;scan code
83
	mcall 40,0x27
81
	mcall 40,0x27
84
 
82
 
85
;-------------------------------------------------
83
;-------------------------------------------------
86
	mov ecx,maxSyntaxFileSize
84
	mov ecx,maxSyntaxFileSize
87
	stdcall mem.Alloc,ecx
85
	stdcall mem.Alloc,ecx
88
	mov [options_file],eax
86
	mov [options_file],eax
89
	mov [options_file_end],eax
87
	mov [options_file_end],eax
90
	add [options_file_end],ecx
88
	add [options_file_end],ecx
91
 
89
 
92
 
90
 
93
load_libraries l_libs_start,load_lib_end
91
load_libraries l_libs_start,load_lib_end
94
 
92
 
95
;¯à®¢¥àª  ­  ᪮«ìª® 㤠筮 § £ã§¨« áì ­ è  «¨¡ 
-
 
96
	mov	ebp,lib0
93
;¯à®¢¥àª  ­  ᪮«ìª® 㤠筮 § £ã§¨« áì ¡¨¡«¨®â¥ª 
97
	cmp	dword [ebp+ll_struc_size-4],0
94
	cmp dword [lib0+ll_struc_size-4],0
98
	jz	@f
95
	jz @f
99
	mcall	-1	;exit not correct
96
		mcall -1 ;exit not correct
100
@@:
97
	@@:
101
 
98
 
102
;---------------------------------------------------------------------
99
;---------------------------------------------------------------------
103
	stdcall dword[tl_data_init],dword tree1
100
	stdcall dword[tl_data_init],dword tree1
104
 
101
 
105
; ç¨â ¥¬ ä ©« á ªãàá®à ¬¨ ¨ «¨­¨ï¬¨
102
; ç¨â ¥¬ ä ©« á ªãàá®à ¬¨ ¨ «¨­¨ï¬¨
106
	load_image_file 'tl_sys_16.png', icon_tl_sys,54+3*256*13
103
	load_image_file 'tl_sys_16.png', icon_tl_sys,54+3*256*13
107
	mov eax,dword[icon_tl_sys]
104
	mov eax,dword[icon_tl_sys]
108
	mov dword[tree1.data_img_sys],eax
105
	mov dword[tree1.data_img_sys],eax
109
;---------------------------------------------------------------------
106
;---------------------------------------------------------------------
110
; ç¨â ¥¬ bmp ä ©« á ¨ª®­ª ¬¨ 㧫®¢
107
; ç¨â ¥¬ bmp ä ©« á ¨ª®­ª ¬¨ 㧫®¢
111
	load_image_file 'tl_nod_16.png', icon_tl_sys,54+3*256*2
108
	load_image_file 'tl_nod_16.png', icon_tl_sys,54+3*256*2
112
	mov eax,dword[icon_tl_sys]
109
	mov eax,dword[icon_tl_sys]
113
	mov dword[tree1.data_img],eax
110
	mov dword[tree1.data_img],eax
114
;------------------------------------------------------------------------------
111
;------------------------------------------------------------------------------
115
  copy_path fn_syntax_dir,sys_path,file_name,0 ;¡¥à¥¬ ¯ãâì ª ¯ ¯ª¥ á ä ©« ¬¨ ᨭ⠪á¨á 
112
  copy_path fn_syntax_dir,sys_path,file_name,0 ;¡¥à¥¬ ¯ãâì ª ¯ ¯ª¥ á ä ©« ¬¨ ᨭ⠪á¨á 
116
  mov eax,70
113
  mov eax,70
117
  mov ebx,tree_file_struct
114
  mov ebx,tree_file_struct
118
  int 0x40
115
  int 0x40
119
 
116
 
120
cmp ebx,-1
117
cmp ebx,-1
121
je .end_dir_init
118
je .end_dir_init
122
 
119
 
123
  mov eax,dir_mem
120
  mov eax,dir_mem
124
  add eax,32+4+1+3+4*6+8
121
  add eax,32+4+1+3+4*6+8
125
mov ecx,ebx
122
mov ecx,ebx
126
@@:
123
@@:
127
  cmp byte[eax],'.' ;䨫ìâà㥬 ä ©«ë á ¨¬¥­ ¬¨ '.' ¨ '..'
124
  cmp byte[eax],'.' ;䨫ìâà㥬 ä ©«ë á ¨¬¥­ ¬¨ '.' ¨ '..'
128
  je .filter
125
  je .filter
129
    push dword tree1
-
 
130
    push dword 0x10000 ;1*2^16 - £¤¥ 1 ­®¬¥à ¨ª®­ª¨ á ª­¨£®©
126
    stdcall dword[tl_node_add],tree1,0x10000,eax ;1*2^16 - £¤¥ 1 ­®¬¥à ¨ª®­ª¨ á ª­¨£®©
131
    push dword eax
-
 
132
    call dword[tl_node_add]
-
 
133
 
-
 
134
    stdcall dword[tl_cur_next],tree1
127
    stdcall dword[tl_cur_next],tree1
135
  .filter:
128
  .filter:
136
  add eax,304
129
  add eax,304
137
  loop @b
130
  loop @b
138
  stdcall dword[tl_cur_beg],tree1 ;áâ ¢¨¬ ªãàá®à ­  ­ ç «® ᯨ᪠
131
  stdcall dword[tl_cur_beg],tree1 ;áâ ¢¨¬ ªãàá®à ­  ­ ç «® ᯨ᪠
139
.end_dir_init:
132
.end_dir_init:
140
 
133
 
141
;--- load color option file ---
134
;--- load color option file ---
142
stdcall [ted_init], tedit0
135
stdcall [ted_init], tedit0
143
mov byte[file_name],0
136
mov byte[file_name],0
144
 
137
 
145
align 4
138
align 4
146
red_win:
139
red_win:
147
	call draw_window
140
	call draw_window
148
 
141
 
149
align 4
142
align 4
150
still:
143
still:
151
  mcall 10
144
  mcall 10
152
 
145
 
153
  cmp al,1 ;¨§¬. ¯®«®¦¥­¨¥ ®ª­ 
146
  cmp al,1 ;¨§¬. ¯®«®¦¥­¨¥ ®ª­ 
154
  jz red_win
147
  jz red_win
155
  cmp al,2
148
  cmp al,2
156
  jz key
149
  jz key
157
  cmp al,3
150
  cmp al,3
158
  jz button
151
  jz button
159
  cmp al,6
152
  cmp al,6
160
  jz mouse
153
  jz mouse
161
 
154
 
162
  jmp still
155
  jmp still
163
 
156
 
164
 
157
 
165
align 4
158
align 4
166
draw_window:
159
draw_window:
167
	pushad
160
	pushad
168
	mcall 12,1
161
	mcall 12,1
169
 
162
 
170
	mov edx,[sc.work]
163
	mov edx,[sc.work]
171
	or  edx,0x33000000
164
	or  edx,0x33000000
172
	mov edi,hed
165
	mov edi,hed
173
	mcall 0,<10,555>,<10,333>
166
	mcall 0,<10,555>,<10,333>
174
 
167
 
175
	mcall 9,procinfo,-1
168
	mcall 9,procinfo,-1
176
 
169
 
177
	mov eax,8 ;ª­®¯ª 
170
	mov eax,8 ;ª­®¯ª 
178
	mov ebx,5*65536+90
171
	mov ebx,5*65536+90
179
	mov ecx,195*65536+20
172
	mov ecx,195*65536+20
180
	mov edx,200
173
	mov edx,200
181
	mov esi,[sc.work_button];0xd0
174
	mov esi,[sc.work_button];0xd0
182
	mcall
175
	mcall
183
 
176
 
184
	;mov eax,8
177
	;mov eax,8
185
	mov ebx,100*65536+85
178
	mov ebx,100*65536+85
186
	mov ecx,195*65536+20
179
	mov ecx,195*65536+20
187
	mov edx,201
180
	mov edx,201
188
	mov esi,0xd00000
181
	mov esi,0xd00000
189
	mcall
182
	mcall
190
 
183
 
191
	mov eax,4 ;à¨á®¢ ­¨¥ ⥪áâ 
184
	mov eax,4 ;à¨á®¢ ­¨¥ ⥪áâ 
192
	mov ebx,10*65536+200
185
	mov ebx,10*65536+200
193
	mov ecx,[sc.work_button_text]
186
	mov ecx,[sc.work_button_text]
194
	or  ecx,0x80000000
187
	or  ecx,0x80000000
195
	mov edx,txt122
188
	mov edx,txt122
196
	mcall
189
	mcall
197
 
190
 
198
	mov ebx,105*65536+200
191
	mov ebx,105*65536+200
199
	mov ecx,0xffff00
192
	mov ecx,0xffff00
200
	or  ecx,0x80000000
193
	or  ecx,0x80000000
201
	mov edx,txt148
194
	mov edx,txt148
202
	mcall
195
	mcall
203
 
196
 
204
	mov ebx,195*65536+10
197
	mov ebx,195*65536+10
205
	mov ecx,[sc.work_text]
198
	mov ecx,[sc.work_text]
206
	or  ecx,0x80000000
199
	or  ecx,0x80000000
207
	mov edx,txt_inp_file
200
	mov edx,txt_inp_file
208
	int 0x40
201
	int 0x40
209
 
202
 
210
	add ebx,20
203
	add ebx,20
211
	mov edx,txt_out_file
204
	mov edx,txt_out_file
212
	int 0x40
205
	int 0x40
213
 
206
 
214
	push dword PathShow_data_1
207
	push dword PathShow_data_1
215
	call [PathShow_draw]
208
	call [PathShow_draw]
216
	
209
	
217
	stdcall [edit_box_draw],dword edit1
210
	stdcall [edit_box_draw],dword edit1
218
	stdcall [tl_draw],dword tree1
211
	stdcall [tl_draw],dword tree1
219
 
212
 
220
	;scroll 1
213
	;scroll 1
221
	mov [ws_dir_lbox.all_redraw],1
214
	mov [ws_dir_lbox.all_redraw],1
222
	stdcall [scrollbar_ver_draw],dword ws_dir_lbox
215
	stdcall [scrollbar_ver_draw],dword ws_dir_lbox
223
	stdcall [ted_draw], tedit0
216
	stdcall [ted_draw], tedit0
224
 
217
 
225
	mcall 12,2
218
	mcall 12,2
226
	popad
219
	popad
227
	ret
220
	ret
228
 
221
 
229
align 4
222
align 4
230
mouse:
223
mouse:
231
	stdcall [tl_mouse],tree1
224
	stdcall [tl_mouse],tree1
232
	stdcall [edit_box_mouse],edit1
225
	stdcall [edit_box_mouse],edit1
233
	stdcall [ted_mouse], tedit0
226
	stdcall [ted_mouse], tedit0
234
	jmp still
227
	jmp still
235
 
228
 
236
;output:
229
;output:
237
; ah = symbol
230
; ah = symbol
238
align 4
231
align 4
239
proc KeyConvertToASCII, table:dword
232
proc KeyConvertToASCII, table:dword
240
	push ebx
233
	push ebx
241
	mov ebx,dword[table] ;convert scan to ascii
234
	mov ebx,dword[table] ;convert scan to ascii
242
	ror ax,8
235
	ror ax,8
243
	xor ah,ah
236
	xor ah,ah
244
	add bx,ax
237
	add bx,ax
245
	mov ah,byte[ebx]
238
	mov ah,byte[ebx]
246
	pop ebx
239
	pop ebx
247
	ret
240
	ret
248
endp
241
endp
249
 
242
 
250
align 4
243
align 4
251
key:
244
key:
252
	mcall 66,3 ;66.3 ¯®«ãç¨âì á®áâ®ï­¨¥ ã¯à ¢«ïîé¨å ª« ¢¨è
245
	mcall 66,3 ;66.3 ¯®«ãç¨âì á®áâ®ï­¨¥ ã¯à ¢«ïîé¨å ª« ¢¨è
253
	xor esi,esi
246
	xor esi,esi
254
	mov ecx,1
247
	mov ecx,1
255
	test al,0x03 ;[Shift]
248
	test al,0x03 ;[Shift]
256
	jz @f
249
	jz @f
257
		mov cl,2
250
		mov cl,2
258
		or esi,KM_SHIFT
251
		or esi,KM_SHIFT
259
	@@:
252
	@@:
260
	test al,0x0c ;[Ctrl]
253
	test al,0x0c ;[Ctrl]
261
	jz @f
254
	jz @f
262
		or esi,KM_CTRL
255
		or esi,KM_CTRL
263
	@@:
256
	@@:
264
	test al,0x30 ;[Alt]
257
	test al,0x30 ;[Alt]
265
	jz @f
258
	jz @f
266
		mov cl,3
259
		mov cl,3
267
		or esi,KM_ALT
260
		or esi,KM_ALT
268
	@@:
261
	@@:
269
	test al,0x80 ;[NumLock]
262
	test al,0x80 ;[NumLock]
270
	jz @f
263
	jz @f
271
		or esi,KM_NUMLOCK
264
		or esi,KM_NUMLOCK
272
	@@:
265
	@@:
273
 
266
 
274
	mcall 26,2,,conv_tabl ;26.2 ¯®«ãç¨âì à áª« ¤ªã ª« ¢¨ âãàë
267
	mcall 26,2,,conv_tabl ;26.2 ¯®«ãç¨âì à áª« ¤ªã ª« ¢¨ âãàë
275
	mcall 2
268
	mcall 2
276
	stdcall [tl_key],tree1
269
	stdcall [tl_key],tree1
277
 
270
 
278
	test word [edit1.flags],10b;ed_focus ; ¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
271
	test word [edit1.flags],10b;ed_focus ; ¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
279
	je @f
272
	je @f
280
		cmp ah,0x80 ;if key up
273
		cmp ah,0x80 ;if key up
281
		ja still
274
		ja still
282
		cmp ah,42 ;[Shift] (left)
275
		cmp ah,42 ;[Shift] (left)
283
		je still
276
		je still
284
		cmp ah,54 ;[Shift] (right)
277
		cmp ah,54 ;[Shift] (right)
285
		je still
278
		je still
286
		cmp ah,56 ;[Alt]
279
		cmp ah,56 ;[Alt]
287
		je still
280
		je still
288
		cmp ah,29 ;[Ctrl]
281
		cmp ah,29 ;[Ctrl]
289
		je still
282
		je still
290
		cmp ah,69 ;[Pause Break]
283
		cmp ah,69 ;[Pause Break]
291
		je still
284
		je still
292
 
285
 
293
		stdcall KeyConvertToASCII, dword conv_tabl
286
		stdcall KeyConvertToASCII, dword conv_tabl
294
		stdcall [edit_box_key],edit1
287
		stdcall [edit_box_key],edit1
295
		jmp still
288
		jmp still
296
	@@:
289
	@@:
297
 
290
 
298
	stdcall [ted_key], tedit0, conv_tabl,esi
291
	stdcall [ted_key], tedit0, conv_tabl,esi
299
	jmp still
292
	jmp still
300
 
293
 
301
align 4
294
align 4
302
button:
295
button:
303
;  cmp [menu_active],1 ;¥á«¨ ­ ¦ «¨ ¬¥­î, â® á­ ç «  ॠªæ¨ï ­  ¬¥­î
296
;  cmp [menu_active],1 ;¥á«¨ ­ ¦ «¨ ¬¥­î, â® á­ ç «  ॠªæ¨ï ­  ¬¥­î
304
;  jne @f ;mouse.menu_bar_1
297
;  jne @f ;mouse.menu_bar_1
305
;    mov [menu_active],0
298
;    mov [menu_active],0
306
;    jmp still
299
;    jmp still
307
;  @@:
300
;  @@:
308
 
301
 
309
  mcall 17 ;¯®«ãç¨âì ª®¤ ­ ¦ â®© ª­®¯ª¨
302
  mcall 17 ;¯®«ãç¨âì ª®¤ ­ ¦ â®© ª­®¯ª¨
310
 
303
 
311
  cmp ah,200
304
  cmp ah,200
312
  jne @f
305
  jne @f
313
    call but_OpenSyntax
306
    call but_OpenSyntax
314
  @@:
307
  @@:
315
  cmp ah,201
308
  cmp ah,201
316
  jne @f
309
  jne @f
317
    call but_SaveSyntax
310
    call but_SaveSyntax
318
  @@:
311
  @@:
319
 
312
 
320
  cmp ah,1
313
  cmp ah,1
321
  jne still
314
  jne still
322
.exit:
315
.exit:
323
  ;push eax
316
  ;push eax
324
 
317
 
325
  stdcall mem.Free,[options_file]
318
  stdcall mem.Free,[options_file]
326
 
319
 
327
  stdcall [tl_data_clear], tree1
320
  stdcall [tl_data_clear], tree1
328
  stdcall [ted_delete], tedit0
321
  stdcall [ted_delete], tedit0
329
  mcall -1 ;¢ë室 ¨§ ¯à®£à ¬¬ë
322
  mcall -1 ;¢ë室 ¨§ ¯à®£à ¬¬ë
330
 
323
 
331
align 4
324
align 4
332
but_OpenSyntax:
325
but_OpenSyntax:
-
 
326
push eax
333
  stdcall [tl_node_get_data],tree1
327
	stdcall [tl_node_get_data],tree1
334
  pop dword [fn_col_option]
328
	mov [fn_col_option],eax
335
  call InitColText
329
	call InitColText
-
 
330
pop eax
336
  ret
331
	ret
337
 
332
 
338
align 4
333
align 4
339
but_SaveSyntax:
334
but_SaveSyntax:
340
	stdcall [ted_save_file], tedit0,run_file_70,[edit1.text]
335
	stdcall [ted_save_file], tedit0,run_file_70,[edit1.text]
341
	ret
336
	ret
342
 
337
 
343
align 4
338
align 4
344
but_ctrl_o:
339
but_ctrl_o:
345
	push eax
340
	push eax
346
	call get_wnd_in_focus
341
	call get_wnd_in_focus
347
	cmp eax,0
342
	cmp eax,0
348
	je @f
343
	je @f
349
		stdcall [ted_open_file], eax,str_file_70,[edit1.text]
344
		stdcall [ted_open_file], eax,str_file_70,[edit1.text]
350
	@@:
345
	@@:
351
	pop eax
346
	pop eax
352
	ret
347
	ret
353
 
348
 
354
;ᮧ¤ ­¨¥ ­®¢®£® ä ©« 
349
;ᮧ¤ ­¨¥ ­®¢®£® ä ©« 
355
align 4
350
align 4
356
but_ctrl_n:
351
but_ctrl_n:
357
	push eax
352
	push eax
358
	call get_wnd_in_focus
353
	call get_wnd_in_focus
359
	cmp eax,0
354
	cmp eax,0
360
	je @f
355
	je @f
361
		stdcall [ted_clear], eax,1
356
		stdcall [ted_clear], eax,1
362
		stdcall [ted_draw], eax
357
		stdcall [ted_draw], eax
363
	@@:
358
	@@:
364
	pop eax
359
	pop eax
365
	ret
360
	ret
366
 
361
 
367
;®¯à¥¤¥«ï¥¬ ª ª®¥ ¨§ ®ª®­ । ªâ®à  ¢ 䮪ãá¥
362
;®¯à¥¤¥«ï¥¬ ª ª®¥ ¨§ ®ª®­ । ªâ®à  ¢ 䮪ãá¥
368
align 4
363
align 4
369
get_wnd_in_focus:
364
get_wnd_in_focus:
370
	xor eax,eax
365
	xor eax,eax
371
	cmp dword[el_focus],tedit0
366
	cmp dword[el_focus],tedit0
372
	jne @f
367
	jne @f
373
		mov eax,tedit0
368
		mov eax,tedit0
374
	@@:
369
	@@:
375
	;cmp dword[el_focus],tedit1
370
	;cmp dword[el_focus],tedit1
376
	;jne @f
371
	;jne @f
377
	;       mov eax,tedit1
372
	;       mov eax,tedit1
378
	;@@:
373
	;@@:
379
	ret
374
	ret
380
 
375
 
381
hed db 'TextEditor syntax file converter 01.07.14',0 ;¯®¤¯¨áì ®ª­ 
376
hed db 'TextEditor syntax file converter 10.11.15',0 ;¯®¤¯¨áì ®ª­ 
382
conv_tabl rb 128 ; â ¡«¨æ  ¤«ï ª®­¢¥àâ¨à®¢ ­¨ï scan-ª®¤  ¢ ascii-ª®¤
377
conv_tabl rb 128 ; â ¡«¨æ  ¤«ï ª®­¢¥àâ¨à®¢ ­¨ï scan-ª®¤  ¢ ascii-ª®¤
383
 
378
 
384
txt122 db '‡ £à. ä ©«',0
379
txt122 db '‡ £à. ä ©«',0
385
txt148 db '‘®åà. ä ©«',0
380
txt148 db '‘®åà. ä ©«',0
386
txt_inp_file db 'ˆáå. ä ©«:',0
381
txt_inp_file db 'ˆáå. ä ©«:',0
387
txt_out_file db '‚ëå. ä ©«:',0
382
txt_out_file db '‚ëå. ä ©«:',0
388
 
383
 
389
txt_no_kpack db 'Žâªà뢠¥¬ë© ä ©« ᦠâ Kpack-®¬.',13,10,'„«ï à ¡®âë á ä ©«®¬ à á¯ ªã©â¥ ¥£® ¨á¯®«ì§ãï á¨á⥬­ãî ¯à®£à ¬¬ã Kpack.',13,10,' ¡®â  ᮠᦠâ묨 ä ©« ¬¨ ¯®ª  ­¥ ¯®¤¤¥à¦¨¢ ¥âáï.',0
384
txt_no_kpack db 'Žâªà뢠¥¬ë© ä ©« ᦠâ Kpack-®¬.',13,10,'„«ï à ¡®âë á ä ©«®¬ à á¯ ªã©â¥ ¥£® ¨á¯®«ì§ãï á¨á⥬­ãî ¯à®£à ¬¬ã Kpack.',13,10,' ¡®â  ᮠᦠâ묨 ä ©« ¬¨ ¯®ª  ­¥ ¯®¤¤¥à¦¨¢ ¥âáï.',0
390
 
385
 
391
head_f_i:
386
head_f_i:
392
head_f_l db 'System error',0
387
head_f_l db 'System error',0
393
err_message_found_lib_0 db 'Sorry I cannot found library ',39,'box_lib.obj',39,0
388
err_message_found_lib_0 db 'Sorry I cannot found library ',39,'box_lib.obj',39,0
394
err_message_import_0 db 'Error on load import library ',39,'box_lib.obj',39,0
389
err_message_import_0 db 'Error on load import library ',39,'box_lib.obj',39,0
395
err_message_found_lib_1 db 'Sorry I cannot found library ',39,'libimg.obj',39,0
390
err_message_found_lib_1 db 'Sorry I cannot found library ',39,'libimg.obj',39,0
396
err_message_import_1 db 'Error on load import library ',39,'libimg.obj',39,0
391
err_message_import_1 db 'Error on load import library ',39,'libimg.obj',39,0
397
 
392
 
398
;library structures
393
;library structures
399
l_libs_start:
394
l_libs_start:
400
	lib0 l_libs lib_name_0, sys_path, file_name, system_dir_0, err_message_found_lib_0, head_f_l, import_box_lib,err_message_import_0, head_f_i
395
	lib0 l_libs lib_name_0, sys_path, file_name, system_dir_0, err_message_found_lib_0, head_f_l, import_box_lib,err_message_import_0, head_f_i
401
	lib1 l_libs lib_name_1, sys_path, file_name, system_dir_1, err_message_found_lib_1, head_f_l, import_libimg,err_message_import_1, head_f_i
396
	lib1 l_libs lib_name_1, sys_path, file_name, system_dir_1, err_message_found_lib_1, head_f_l, import_libimg,err_message_import_1, head_f_i
402
load_lib_end:
397
load_lib_end:
403
 
398
 
404
 
-
 
405
i_end:
-
 
406
	rb 1024
399
 
-
 
400
align 16
407
	align 16
401
i_end:
-
 
402
	procinfo process_information
408
	procinfo process_information
403
		rb 1024
409
	thread:
404
	thread:
410
		rb 1024
405
		rb 1024
411
stacktop:
406
stacktop:
412
  sys_path:
407
  sys_path:
413
    rb 4096
408
    rb 4096
414
  file_name:
409
  file_name:
415
    rb 4096
410
    rb 4096
416
  file_name_rez:
411
  file_name_rez:
417
    rb 4096
412
    rb 4096
418
mem:
413
mem: