Subversion Repositories Kolibri OS

Rev

Rev 8255 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8255 Rev 8852
1
;Ž£à®¬­ ï ¡« £®¤ à­®áâì ¢á¥¬, ªâ® ¯®¬®£ «: ª®¤®¬/ᮢ¥â®¬/¤¨§ ©­®¬ ...
1
;Ž£à®¬­ ï ¡« £®¤ à­®áâì ¢á¥¬, ªâ® ¯®¬®£ «: ª®¤®¬/ᮢ¥â®¬/¤¨§ ©­®¬ ...
2
 
2
 
3
use32
3
use32
4
  org 0
4
  org 0
5
  db 'MENUET01' ;¨¤¥­â¨ä. ¨á¯®«­ï¥¬®£® ä ©«  ¢á¥£¤  8 ¡ ©â
5
  db 'MENUET01' ;¨¤¥­â¨ä. ¨á¯®«­ï¥¬®£® ä ©«  ¢á¥£¤  8 ¡ ©â
6
  dd 1, start, i_end, mem, stacktop, file_name, sys_path
6
  dd 1, start, i_end, mem, stacktop, file_name, sys_path
7
 
7
 
8
MAX_COLOR_WORD_LEN equ 40
8
MAX_COLOR_WORD_LEN equ 40
9
maxChars equ 100002 ;(ª®««¨ç¥á⢮ ᨬ¢®«®¢ ¢ ­®¢®¬ ¤®ªã¬¥­â¥ + 2)
9
maxChars equ 100002 ;(ª®««¨ç¥á⢮ ᨬ¢®«®¢ ¢ ­®¢®¬ ¤®ªã¬¥­â¥ + 2)
10
BUF_SIZE equ 4096 ;buffer for copy|paste
10
BUF_SIZE equ 4096 ;buffer for copy|paste
11
maxSyntaxFileSize equ 410000
11
maxSyntaxFileSize equ 410000
12
TOOLBAR_ICONS_SIZE equ 1200*21
12
TOOLBAR_ICONS_SIZE equ 1200*21
13
 
13
 
14
include '../../proc32.inc'
14
include '../../proc32.inc'
15
include '../../macros.inc'
15
include '../../macros.inc'
16
include '../../KOSfuncs.inc'
16
include '../../KOSfuncs.inc'
17
include '../../load_img.inc'
17
include '../../load_img.inc'
18
include '../../load_lib.mac'
18
include '../../load_lib.mac'
19
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
19
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
20
include '../../system/skincfg/trunk/kglobals.inc'
20
include '../../system/skincfg/trunk/kglobals.inc'
21
include '../../system/skincfg/trunk/unpacker.inc'
21
include '../../system/skincfg/trunk/unpacker.inc'
22
include 'lang.inc'
22
include 'lang.inc'
23
 
23
 
24
include 't_data.inc'
24
include 't_data.inc'
25
include 't_button.inc'
25
include 't_button.inc'
26
include 't_menu.inc'
26
include 't_menu.inc'
27
include 'strlen.inc'
27
include 'strlen.inc'
28
include 't_draw.inc' ;draw main window functions
28
include 't_draw.inc' ;draw main window functions
29
include 'wnd_k_words.inc'
29
include 'wnd_k_words.inc'
30
 
30
 
31
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
31
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
32
 
32
 
33
align 4
33
align 4
34
icon_tl_sys dd 0 ;㪠§ â¥«ì ­  ¯ ¬ïâì ¤«ï åà ­¥­¨ï á¨á⥬­ëå ¨ª®­®ª
34
icon_tl_sys dd 0 ;㪠§ â¥«ì ­  ¯ ¬ïâì ¤«ï åà ­¥­¨ï á¨á⥬­ëå ¨ª®­®ª
35
run_file_70 FileInfoBlock
35
run_file_70 FileInfoBlock
36
 
36
 
37
align 4
37
align 4
38
start:
38
start:
39
	mcall SF_STYLE_SETTINGS,SSF_GET_COLORS,sc,sizeof.system_colors
39
	mcall SF_STYLE_SETTINGS,SSF_GET_COLORS,sc,sizeof.system_colors
40
 
40
 
41
	mcall SF_SYS_MISC,SSF_HEAP_INIT
41
	mcall SF_SYS_MISC,SSF_HEAP_INIT
42
	or eax,eax
42
	or eax,eax
43
	jnz @f
43
	jnz @f
44
		call ted_Exit
44
		call ted_Exit
45
	@@:
45
	@@:
46
 
46
 
47
	mcall SF_KEYBOARD,SSF_SET_INPUT_MODE,1 ;scan code
47
	mcall SF_KEYBOARD,SSF_SET_INPUT_MODE,1 ;scan code
48
	mcall SF_SET_EVENTS_MASK,0xC0000027
48
	mcall SF_SET_EVENTS_MASK,0xC0000027
49
 
49
 
50
	mov esi,file_name
50
	mov esi,file_name
51
	stdcall str_len,esi
51
	stdcall str_len,esi
52
	mov ecx,eax
52
	mov ecx,eax
53
	mov edi,openfile_path
53
	mov edi,openfile_path
54
	cld
54
	cld
55
	rep movsb ;ª®¯¨à㥬 ¨¬ï ä ©«  ¢ ¡ãä¥à openfile_path
55
	rep movsb ;ª®¯¨à㥬 ¨¬ï ä ©«  ¢ ¡ãä¥à openfile_path
56
 
56
 
57
load_libraries l_libs_start,load_lib_end
57
load_libraries l_libs_start,load_lib_end
58
 
58
 
59
;¯à®¢¥àª  ­  ᪮«ìª® 㤠筮 § £ã§¨«¨áì ¡¨¡«¨®â¥ª¨
59
;¯à®¢¥àª  ­  ᪮«ìª® 㤠筮 § £ã§¨«¨áì ¡¨¡«¨®â¥ª¨
60
mov	ebp,lib0
60
mov	ebp,lib0
61
.test_lib_open:
61
.test_lib_open:
62
	cmp	dword [ebp+ll_struc_size-4],0
62
	cmp	dword [ebp+ll_struc_size-4],0
63
	jz	@f
63
	jz	@f
64
	mcall SF_TERMINATE_PROCESS ;exit not correct
64
	mcall SF_TERMINATE_PROCESS ;exit not correct
65
@@:
65
@@:
66
	add ebp,ll_struc_size
66
	add ebp,ll_struc_size
67
	cmp ebp,load_lib_end
67
	cmp ebp,load_lib_end
68
	jl .test_lib_open
68
	jl .test_lib_open
69
 
69
 
70
;---------------------------------------------------------------------
70
;---------------------------------------------------------------------
71
	stdcall [ted_init], tedit0
71
	stdcall [ted_init], tedit0
72
	stdcall [tl_data_init], tree1
72
	stdcall [tl_data_init], tree1
73
	option_boxes_set_sys_color sc,opt_grlist1
73
	option_boxes_set_sys_color sc,opt_grlist1
74
	init_checkboxes2 check_boxes,check_boxes_end
74
	init_checkboxes2 check_boxes,check_boxes_end
75
	check_boxes_set_sys_color2 check_boxes,check_boxes_end,sc
75
	check_boxes_set_sys_color2 check_boxes,check_boxes_end,sc
76
 
76
 
77
; OpenDialog initialisation
77
; OpenDialog initialisation
78
	stdcall [OpenDialog_Init],OpenDialog_data
78
	stdcall [OpenDialog_Init],OpenDialog_data
79
 
79
 
80
; kmenu initialisation
80
; kmenu initialisation
81
	call tedit_menu_init
81
	call tedit_menu_init
82
 
82
 
83
; init toolbar file
83
; init toolbar file
84
	include_image_file 'te_icon.png', bmp_icon,,,6 ;6 ¤«ï á¥àëå ª­®¯®ª
84
	include_image_file 'te_icon.png', bmp_icon,,,6 ;6 ¤«ï á¥àëå ª­®¯®ª
85
	mov eax,[bmp_icon]
85
	mov eax,[bmp_icon]
86
	add eax,TOOLBAR_ICONS_SIZE
86
	add eax,TOOLBAR_ICONS_SIZE
87
	stdcall img_to_gray, [bmp_icon],eax,(TOOLBAR_ICONS_SIZE)/3
87
	stdcall img_to_gray, [bmp_icon],eax,(TOOLBAR_ICONS_SIZE)/3
88
;---------------------------------------------------------------------
88
;---------------------------------------------------------------------
89
; ¢­¥¤à塞 ä ©« á ªãàá®à ¬¨ ¨ «¨­¨ï¬¨
89
; ¢­¥¤à塞 ä ©« á ªãàá®à ¬¨ ¨ «¨­¨ï¬¨
90
	include_image_file '..\..\media\log_el\trunk\tl_sys_16.png', icon_tl_sys
90
	include_image_file '..\..\media\log_el\trunk\tl_sys_16.png', icon_tl_sys
91
	mov eax,dword[icon_tl_sys]
91
	mov eax,dword[icon_tl_sys]
92
	mov dword[tree1.data_img_sys],eax
92
	mov dword[tree1.data_img_sys],eax
93
; ¢­¥¤à塞 ä ©« á ¨ª®­ª ¬¨ 㧫®¢
93
; ¢­¥¤à塞 ä ©« á ¨ª®­ª ¬¨ 㧫®¢
94
	include_image_file 'tl_nod_16.png', icon_tl_sys
94
	include_image_file 'tl_nod_16.png', icon_tl_sys
95
	mov eax,dword[icon_tl_sys]
95
	mov eax,dword[icon_tl_sys]
96
	mov dword[tree1.data_img],eax
96
	mov dword[tree1.data_img],eax
97
;------------------------------------------------------------------------------
97
;------------------------------------------------------------------------------
98
	copy_path fn_syntax_dir,sys_path,file_name,0 ;¡¥à¥¬ ¯ãâì ª ¯ ¯ª¥ á ä ©« ¬¨ ᨭ⠪á¨á 
98
	copy_path fn_syntax_dir,sys_path,file_name,0 ;¡¥à¥¬ ¯ãâì ª ¯ ¯ª¥ á ä ©« ¬¨ ᨭ⠪á¨á 
-
 
99
	xor eax,eax
-
 
100
	mov ecx,4096
-
 
101
	mov edi,file_name
-
 
102
	repnz scasb
-
 
103
	mov byte[edi-2],al ;㡨ࠥ¬ '/' ¢ ª®­æ¥ ¨¬¥­¨ ¯ ¯ª¨ (­ã¦­® ¤«ï ç⥭¨ï á CD)
99
	mcall SF_FILE,tree_file_struct
104
	mcall SF_FILE,tree_file_struct
100
 
105
 
101
	cmp ebx,0
106
	or ebx,ebx
102
	jle .end_dir_init
107
	jz .end_dir_init
103
		mov eax,dir_mem+32+40
108
		mov eax,dir_mem+32+40
104
		mov ecx,ebx
109
		mov ecx,ebx
105
		@@:
110
		@@:
106
			cmp byte[eax],'.' ;䨫ìâà㥬 ä ©«ë á ¨¬¥­ ¬¨ '.' ¨ '..'
111
			cmp byte[eax],'.' ;䨫ìâà㥬 ä ©«ë á ¨¬¥­ ¬¨ '.' ¨ '..'
107
			je .filter
112
			je .filter
108
			;0x10000 ;1*2^16 - £¤¥ 1 ­®¬¥à ¨ª®­ª¨ á ª­¨£®©
113
			;0x10000 ;1*2^16 - £¤¥ 1 ­®¬¥à ¨ª®­ª¨ á ª­¨£®©
109
			stdcall [tl_node_add], tree1,0x10000,eax 
114
			stdcall [tl_node_add], tree1,0x10000,eax 
110
			stdcall [tl_cur_next], tree1
115
			stdcall [tl_cur_next], tree1
111
			.filter:
116
			.filter:
112
			add eax,304
117
			add eax,304
113
			loop @b
118
			loop @b
114
		stdcall [tl_cur_beg],tree1 ;áâ ¢¨¬ ªãàá®à ­  ­ ç «® ᯨ᪠
119
		stdcall [tl_cur_beg],tree1 ;áâ ¢¨¬ ªãàá®à ­  ­ ç «® ᯨ᪠
115
		or dword[tree1.style], tl_cursor_pos_limited ;®£à ­¨ç¨¢ ¥¬ ¤¢¨¦¥­¨¥ ªãàá®à  ¢ ¯à¥¤¥« å ᯨ᪠
120
		or dword[tree1.style], tl_cursor_pos_limited ;®£à ­¨ç¨¢ ¥¬ ¤¢¨¦¥­¨¥ ªãàá®à  ¢ ¯à¥¤¥« å ᯨ᪠
116
	.end_dir_init:
121
	.end_dir_init:
117
 
122
 
118
;--- load ini file ---
123
;--- load ini file ---
119
	copy_path ini_name,sys_path,file_name,0
124
	copy_path ini_name,sys_path,file_name,0
120
	;window startup pozition
125
	;window startup pozition
121
	stdcall [ini_get_int],file_name,ini_sec_window,key_window_l,ini_def_window_l
126
	stdcall [ini_get_int],file_name,ini_sec_window,key_window_l,ini_def_window_l
122
	mov word[wnd_s_pos+2],ax
127
	mov word[wnd_s_pos+2],ax
123
	stdcall [ini_get_int],file_name,ini_sec_window,key_window_w,ini_def_window_w
128
	stdcall [ini_get_int],file_name,ini_sec_window,key_window_w,ini_def_window_w
124
	mov word[wnd_s_pos],ax
129
	mov word[wnd_s_pos],ax
125
	stdcall [ini_get_int],file_name,ini_sec_window,key_window_t,ini_def_window_t
130
	stdcall [ini_get_int],file_name,ini_sec_window,key_window_t,ini_def_window_t
126
	mov word[wnd_s_pos+6],ax
131
	mov word[wnd_s_pos+6],ax
127
	stdcall [ini_get_int],file_name,ini_sec_window,key_window_h,ini_def_window_h
132
	stdcall [ini_get_int],file_name,ini_sec_window,key_window_h,ini_def_window_h
128
	mov word[wnd_s_pos+4],ax
133
	mov word[wnd_s_pos+4],ax
129
	;scrool type
134
	;scrool type
130
	stdcall [ini_get_int],file_name,ini_sec_window,key_scroll_type,ini_def_scroll_type
135
	stdcall [ini_get_int],file_name,ini_sec_window,key_scroll_type,ini_def_scroll_type
131
	mov [wScr.type],eax
136
	mov [wScr.type],eax
132
	mov [hScr.type],eax
137
	mov [hScr.type],eax
133
	mov [ws_dir_lbox.type],eax
138
	mov [ws_dir_lbox.type],eax
134
    mov [w_scr_t3.type],eax
139
    mov [w_scr_t3.type],eax
135
	;symbol size
140
	;symbol size
136
	stdcall [ini_get_int],file_name,ini_sec_window,key_symbol_w,ini_def_symbol_w
141
	stdcall [ini_get_int],file_name,ini_sec_window,key_symbol_w,ini_def_symbol_w
137
	mov dword[tedit0.rec.width],eax
142
	mov dword[tedit0.rec.width],eax
138
	stdcall [ini_get_int],file_name,ini_sec_window,key_symbol_h,ini_def_symbol_h
143
	stdcall [ini_get_int],file_name,ini_sec_window,key_symbol_h,ini_def_symbol_h
139
	mov dword[tedit0.rec.height],eax
144
	mov dword[tedit0.rec.height],eax
140
	;lea eax,[eax+eax*2]
145
	;lea eax,[eax+eax*2]
141
	;mov dword[tedit0.rec.top],eax
146
	;mov dword[tedit0.rec.top],eax
142
	;font size
147
	;font size
143
	stdcall [ini_get_int],file_name,ini_sec_window,key_font_s,ini_def_font_s
148
	stdcall [ini_get_int],file_name,ini_sec_window,key_font_s,ini_def_font_s
144
	shl eax,24
149
	shl eax,24
145
	mov dword[tedit0.font_size],eax
150
	mov dword[tedit0.font_size],eax
146
	;ª­®¯ª¨ ­  ¯ ­¥«¨
151
	;ª­®¯ª¨ ­  ¯ ­¥«¨
147
	ini_panel key_but_new,	  ID_BUT_NEW
152
	ini_panel key_but_new,	  ID_BUT_NEW
148
	ini_panel key_but_open,   ID_BUT_OPEN
153
	ini_panel key_but_open,   ID_BUT_OPEN
149
	ini_panel key_but_save,   ID_BUT_SAVE
154
	ini_panel key_but_save,   ID_BUT_SAVE
150
	ini_panel key_but_save_as,ID_BUT_SAVE_AS
155
	ini_panel key_but_save_as,ID_BUT_SAVE_AS
151
	ini_panel key_but_select, ID_BUT_SELECT
156
	ini_panel key_but_select, ID_BUT_SELECT
152
	ini_panel key_but_cut,	  ID_BUT_CUT
157
	ini_panel key_but_cut,	  ID_BUT_CUT
153
	ini_panel key_but_copy,   ID_BUT_COPY
158
	ini_panel key_but_copy,   ID_BUT_COPY
154
	ini_panel key_but_paste,  ID_BUT_PASTE
159
	ini_panel key_but_paste,  ID_BUT_PASTE
155
	ini_panel key_but_find,   ID_BUT_FIND
160
	ini_panel key_but_find,   ID_BUT_FIND
156
	ini_panel key_but_replace,ID_BUT_REPLACE
161
	ini_panel key_but_replace,ID_BUT_REPLACE
157
	ini_panel key_but_key_words,ID_BUT_KEY_WORDS
162
	ini_panel key_but_key_words,ID_BUT_KEY_WORDS
158
	ini_panel key_but_upper,  ID_BUT_UPPER
163
	ini_panel key_but_upper,  ID_BUT_UPPER
159
	ini_panel key_but_lower,  ID_BUT_LOWER
164
	ini_panel key_but_lower,  ID_BUT_LOWER
160
	ini_panel key_but_reverse,ID_BUT_REVERSE
165
	ini_panel key_but_reverse,ID_BUT_REVERSE
161
	ini_panel key_but_undo,   ID_BUT_UNDO
166
	ini_panel key_but_undo,   ID_BUT_UNDO
162
	ini_panel key_but_redo,   ID_BUT_REDO
167
	ini_panel key_but_redo,   ID_BUT_REDO
163
	ini_panel key_but_invisible,ID_BUT_INVISIBLE
168
	ini_panel key_but_invisible,ID_BUT_INVISIBLE
164
	ini_panel key_but_syntax_list,ID_BUT_SYNTAX_LIST
169
	ini_panel key_but_syntax_list,ID_BUT_SYNTAX_LIST
165
	ini_panel key_but_syntax_mode,ID_BUT_SYNTAX_MODE
170
	ini_panel key_but_syntax_mode,ID_BUT_SYNTAX_MODE
166
	ini_panel key_but_convert_1251_866,ID_BUT_CONVERT_1251_866
171
	ini_panel key_but_convert_1251_866,ID_BUT_CONVERT_1251_866
167
	ini_panel key_but_convert_866_1251,ID_BUT_CONVERT_866_1251
172
	ini_panel key_but_convert_866_1251,ID_BUT_CONVERT_866_1251
168
	;ä ©«®¢ë¥ à áè¨à¥­¨ï
173
	;ä ©«®¢ë¥ à áè¨à¥­¨ï
169
	xor edx,edx
174
	xor edx,edx
170
	mov ebx,synt_auto_open
175
	mov ebx,synt_auto_open
171
	@@:
176
	@@:
172
		;¡¥à¥¬ ¨¬ï ä ©« 
177
		;¡¥à¥¬ ¨¬ï ä ©« 
173
		stdcall [ini_get_str],file_name,ini_sec_options,key_synt_file,ebx,32,ini_def_synt_f
178
		stdcall [ini_get_str],file_name,ini_sec_options,key_synt_file,ebx,32,ini_def_synt_f
174
		cmp byte[ebx],0
179
		cmp byte[ebx],0
175
		je @f
180
		je @f
176
		inc byte[key_synt_file.numb]
181
		inc byte[key_synt_file.numb]
177
		add ebx,32
182
		add ebx,32
178
		;¡¥à¥¬ à áè¨à¥­¨ï
183
		;¡¥à¥¬ à áè¨à¥­¨ï
179
		stdcall [ini_get_str],file_name,ini_sec_options,key_synt_ext,ebx,32,ini_def_synt_f
184
		stdcall [ini_get_str],file_name,ini_sec_options,key_synt_ext,ebx,32,ini_def_synt_f
180
		inc byte[key_synt_ext.numb]
185
		inc byte[key_synt_ext.numb]
181
		add ebx,32
186
		add ebx,32
182
		inc edx
187
		inc edx
183
		cmp edx,max_synt_auto_open
188
		cmp edx,max_synt_auto_open
184
		jl @b
189
		jl @b
185
	@@:
190
	@@:
186
 
191
 
187
;--- load color option file ---
192
;--- load color option file ---
188
	stdcall open_unpac_synt_file,[fn_col_option]
193
	stdcall open_unpac_synt_file,[fn_col_option]
189
 
194
 
190
;--- get cmd line ---
195
;--- get cmd line ---
191
	cmp byte[openfile_path+3],0 ;openfile_path
196
	cmp byte[openfile_path+3],0 ;openfile_path
192
	je @f ;if file names exist
197
	je @f ;if file names exist
193
		mov esi,openfile_path
198
		mov esi,openfile_path
194
		stdcall auto_open_syntax,esi
199
		stdcall auto_open_syntax,esi
195
		call but_no_msg_OpenFile
200
		call but_no_msg_OpenFile
196
	@@:
201
	@@:
197
 
202
 
198
 
203
 
199
 
204
 
200
align 16
205
align 16
201
red_win:
206
red_win:
202
	call draw_window
207
	call draw_window
203
 
208
 
204
align 16
209
align 16
205
still:
210
still:
206
	mcall SF_WAIT_EVENT
211
	mcall SF_WAIT_EVENT
207
	cmp dword[exit_code],1
212
	cmp dword[exit_code],1
208
	jne @f
213
	jne @f
209
		call ted_Exit
214
		call ted_Exit
210
		jmp still
215
		jmp still
211
	@@:
216
	@@:
212
 
217
 
213
	cmp al,1 ;¨§¬¥­¨«®áì ¯®«®¦¥­¨¥ ®ª­ 
218
	cmp al,1 ;¨§¬¥­¨«®áì ¯®«®¦¥­¨¥ ®ª­ 
214
	jz red_win
219
	jz red_win
215
	cmp al,2
220
	cmp al,2
216
	jz key
221
	jz key
217
	cmp al,3
222
	cmp al,3
218
	jz button
223
	jz button
219
	cmp al,6 ;¬ëèì
224
	cmp al,6 ;¬ëèì
220
	jne @f
225
	jne @f
221
		call mouse
226
		call mouse
222
	@@:
227
	@@:
223
	jmp still
228
	jmp still
224
 
229
 
225
align 16
230
align 16
226
mouse:
231
mouse:
227
	stdcall [kmainmenu_dispatch_cursorevent], [main_menu]
232
	stdcall [kmainmenu_dispatch_cursorevent], [main_menu]
228
 
233
 
229
	mcall SF_MOUSE_GET,SSF_WINDOW_POSITION
234
	mcall SF_MOUSE_GET,SSF_WINDOW_POSITION
230
	cmp word[tedit0.wnd.top],ax
235
	cmp word[tedit0.wnd.top],ax
231
	jg .no_edit
236
	jg .no_edit
232
	shr eax,16
237
	shr eax,16
233
	cmp word[tedit0.wnd.left],ax
238
	cmp word[tedit0.wnd.left],ax
234
	jg .no_edit
239
	jg .no_edit
235
	mcall SF_MOUSE_GET,SSF_BUTTON_EXT
240
	mcall SF_MOUSE_GET,SSF_BUTTON_EXT
236
	bt eax,24 ;¤¢®©­®© 饫çñª «¥¢®© ª­®¯ª®©
241
	bt eax,24 ;¤¢®©­®© 饫çñª «¥¢®© ª­®¯ª®©
237
	jnc @f
242
	jnc @f
238
		stdcall [ted_but_select_word], tedit0
243
		stdcall [ted_but_select_word], tedit0
239
		ret
244
		ret
240
	@@:
245
	@@:
241
		stdcall [ted_mouse], tedit0
246
		stdcall [ted_mouse], tedit0
242
	.no_edit:
247
	.no_edit:
243
 
248
 
244
	;¯à®¢¥àª  ¡®ª®¢ëå ¯ ­¥«¥©
249
	;¯à®¢¥àª  ¡®ª®¢ëå ¯ ­¥«¥©
245
	cmp byte[tedit0.panel_id],TED_PANEL_FIND
250
	cmp byte[tedit0.panel_id],TED_PANEL_FIND
246
	jne @f
251
	jne @f
247
		stdcall [edit_box_mouse], edit_find
252
		stdcall [edit_box_mouse], edit_find
248
		stdcall [option_box_mouse], opt_grlist1
253
		stdcall [option_box_mouse], opt_grlist1
249
		stdcall [check_box_mouse], ch1
254
		stdcall [check_box_mouse], ch1
250
	@@:
255
	@@:
251
	cmp byte[tedit0.panel_id],TED_PANEL_REPLACE
256
	cmp byte[tedit0.panel_id],TED_PANEL_REPLACE
252
	jne @f
257
	jne @f
253
		stdcall [edit_box_mouse], edit_find
258
		stdcall [edit_box_mouse], edit_find
254
		stdcall [edit_box_mouse], edit_replace
259
		stdcall [edit_box_mouse], edit_replace
255
		stdcall [option_box_mouse], opt_grlist1
260
		stdcall [option_box_mouse], opt_grlist1
256
	@@:
261
	@@:
257
	cmp byte[tedit0.panel_id],TED_PANEL_SYNTAX
262
	cmp byte[tedit0.panel_id],TED_PANEL_SYNTAX
258
	jne @f
263
	jne @f
259
		stdcall [tl_mouse], tree1
264
		stdcall [tl_mouse], tree1
260
	@@:
265
	@@:
261
	cmp byte[tedit0.panel_id],TED_PANEL_GOTO
266
	cmp byte[tedit0.panel_id],TED_PANEL_GOTO
262
	jne @f
267
	jne @f
263
		stdcall [edit_box_mouse], edit_goto
268
		stdcall [edit_box_mouse], edit_goto
264
	@@:
269
	@@:
265
	ret
270
	ret
266
;---------------------------------------------------------------------
271
;---------------------------------------------------------------------
267
 
272
 
268
;output:
273
;output:
269
; ah = symbol
274
; ah = symbol
270
align 16
275
align 16
271
proc KeyConvertToASCII uses ebx, table:dword
276
proc KeyConvertToASCII uses ebx, table:dword
272
	mov ebx,dword[table] ;convert scan to ascii
277
	mov ebx,dword[table] ;convert scan to ascii
273
	shr ax,8
278
	shr ax,8
274
	add bx,ax
279
	add bx,ax
275
	mov ah,byte[ebx]
280
	mov ah,byte[ebx]
276
	ret
281
	ret
277
endp
282
endp
278
 
283
 
279
align 16
284
align 16
280
key:
285
key:
281
	mcall SF_KEYBOARD,SSF_GET_CONTROL_KEYS ;66.3 ¯®«ãç¨âì á®áâ®ï­¨¥ ã¯à ¢«ïîé¨å ª« ¢¨è
286
	mcall SF_KEYBOARD,SSF_GET_CONTROL_KEYS ;66.3 ¯®«ãç¨âì á®áâ®ï­¨¥ ã¯à ¢«ïîé¨å ª« ¢¨è
282
	xor esi,esi
287
	xor esi,esi
283
	mov ecx,1
288
	mov ecx,1
284
	test al,3 ;[Shift]
289
	test al,3 ;[Shift]
285
	jz @f
290
	jz @f
286
		mov cl,2
291
		mov cl,2
287
		or esi,KM_SHIFT
292
		or esi,KM_SHIFT
288
	@@:
293
	@@:
289
	test al,0x0c ;[Ctrl]
294
	test al,0x0c ;[Ctrl]
290
	jz @f
295
	jz @f
291
		or esi,KM_CTRL
296
		or esi,KM_CTRL
292
	@@:
297
	@@:
293
	test al,0x30 ;[Alt]
298
	test al,0x30 ;[Alt]
294
	jz @f
299
	jz @f
295
		mov cl,3
300
		mov cl,3
296
		or esi,KM_ALT
301
		or esi,KM_ALT
297
	@@:
302
	@@:
298
	test al,0x80 ;[NumLock]
303
	test al,0x80 ;[NumLock]
299
	jz @f
304
	jz @f
300
		or esi,KM_NUMLOCK
305
		or esi,KM_NUMLOCK
301
	@@:
306
	@@:
302
 
307
 
303
	mcall SF_SYSTEM_GET,SSF_KEYBOARD_LAYOUT,,conv_tabl ;26.2 ¯®«ãç¨âì à áª« ¤ªã ª« ¢¨ âãàë
308
	mcall SF_SYSTEM_GET,SSF_KEYBOARD_LAYOUT,,conv_tabl ;26.2 ¯®«ãç¨âì à áª« ¤ªã ª« ¢¨ âãàë
304
	mcall SF_GET_KEY
309
	mcall SF_GET_KEY
305
	stdcall [tl_key], tree1
310
	stdcall [tl_key], tree1
306
 
311
 
307
	test word[edit_replace.flags],ed_focus ;¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
312
	test word[edit_replace.flags],ed_focus ;¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
308
	je @f
313
	je @f
309
		cmp ah,0x80 ;if key up
314
		cmp ah,0x80 ;if key up
310
		ja still
315
		ja still
311
		cmp ah,42 ;[Shift] (left)
316
		cmp ah,42 ;[Shift] (left)
312
		je still
317
		je still
313
		cmp ah,54 ;[Shift] (right)
318
		cmp ah,54 ;[Shift] (right)
314
		je still
319
		je still
315
		cmp ah,56 ;[Alt]
320
		cmp ah,56 ;[Alt]
316
		je still
321
		je still
317
		cmp ah,29 ;[Ctrl]
322
		cmp ah,29 ;[Ctrl]
318
		je still
323
		je still
319
		cmp ah,69 ;[Pause Break]
324
		cmp ah,69 ;[Pause Break]
320
		je still
325
		je still
321
 
326
 
322
		stdcall KeyConvertToASCII, conv_tabl
327
		stdcall KeyConvertToASCII, conv_tabl
323
		stdcall [edit_box_key], edit_replace
328
		stdcall [edit_box_key], edit_replace
324
		jmp still
329
		jmp still
325
	@@:
330
	@@:
326
	test word[edit_find.flags],ed_focus ;¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
331
	test word[edit_find.flags],ed_focus ;¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
327
	je @f
332
	je @f
328
		cmp ah,0x80 ;if key up
333
		cmp ah,0x80 ;if key up
329
		ja still
334
		ja still
330
		cmp ah,42 ;[Shift] (left)
335
		cmp ah,42 ;[Shift] (left)
331
		je still
336
		je still
332
		cmp ah,54 ;[Shift] (right)
337
		cmp ah,54 ;[Shift] (right)
333
		je still
338
		je still
334
		cmp ah,56 ;[Alt]
339
		cmp ah,56 ;[Alt]
335
		je still
340
		je still
336
		cmp ah,29 ;[Ctrl]
341
		cmp ah,29 ;[Ctrl]
337
		je still
342
		je still
338
		cmp ah,69 ;[Pause Break]
343
		cmp ah,69 ;[Pause Break]
339
		je still
344
		je still
340
 
345
 
341
		stdcall KeyConvertToASCII, conv_tabl
346
		stdcall KeyConvertToASCII, conv_tabl
342
		stdcall [edit_box_key], edit_find
347
		stdcall [edit_box_key], edit_find
343
		jmp still
348
		jmp still
344
	@@:
349
	@@:
345
	test word[edit_goto.flags],ed_focus ;¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
350
	test word[edit_goto.flags],ed_focus ;¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
346
	je @f
351
	je @f
347
		cmp ah,0x80 ;if key up
352
		cmp ah,0x80 ;if key up
348
		ja still
353
		ja still
349
		cmp ah,42 ;[Shift] (left)
354
		cmp ah,42 ;[Shift] (left)
350
		je still
355
		je still
351
		cmp ah,54 ;[Shift] (right)
356
		cmp ah,54 ;[Shift] (right)
352
		je still
357
		je still
353
		cmp ah,56 ;[Alt]
358
		cmp ah,56 ;[Alt]
354
		je still
359
		je still
355
		cmp ah,29 ;[Ctrl]
360
		cmp ah,29 ;[Ctrl]
356
		je still
361
		je still
357
		cmp ah,69 ;[Pause Break]
362
		cmp ah,69 ;[Pause Break]
358
		je still
363
		je still
359
 
364
 
360
		stdcall KeyConvertToASCII, conv_tabl
365
		stdcall KeyConvertToASCII, conv_tabl
361
		stdcall [edit_box_key], edit_goto
366
		stdcall [edit_box_key], edit_goto
362
		jmp still
367
		jmp still
363
	@@:
368
	@@:
364
 
369
 
365
	stdcall [ted_key], tedit0, conv_tabl,esi
370
	stdcall [ted_key], tedit0, conv_tabl,esi
366
	jmp still
371
	jmp still
367
 
372
 
368
align 4
373
align 4
369
edit_replace edit_box TED_PANEL_WIDTH-1, 0, 20, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 300, buf_replace, mouse_dd, 0
374
edit_replace edit_box TED_PANEL_WIDTH-1, 0, 20, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 300, buf_replace, mouse_dd, 0
370
edit_find edit_box TED_PANEL_WIDTH-1, 0, 20, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 300, buf_find, mouse_dd, 0
375
edit_find edit_box TED_PANEL_WIDTH-1, 0, 20, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 300, buf_find, mouse_dd, 0
371
edit_goto edit_box TED_PANEL_WIDTH-1, 0, 20, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 10, buf_goto, mouse_dd, 0
376
edit_goto edit_box TED_PANEL_WIDTH-1, 0, 20, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 10, buf_goto, mouse_dd, 0
372
 
377
 
373
unpac_mem dd 0
378
unpac_mem dd 0
374
 
379
 
375
;library structures
380
;library structures
376
l_libs_start:
381
l_libs_start:
377
	lib0 l_libs lib_name_0, file_name, system_dir_0, import_box_lib
382
	lib0 l_libs lib_name_0, file_name, system_dir_0, import_box_lib
378
	lib1 l_libs lib_name_1, file_name, system_dir_1, import_msgbox_lib
383
	lib1 l_libs lib_name_1, file_name, system_dir_1, import_msgbox_lib
379
	lib2 l_libs lib_name_2, file_name, system_dir_2, import_proclib
384
	lib2 l_libs lib_name_2, file_name, system_dir_2, import_proclib
380
	lib3 l_libs lib_name_3, file_name, system_dir_3, import_libimg
385
	lib3 l_libs lib_name_3, file_name, system_dir_3, import_libimg
381
	lib4 l_libs lib_name_4, file_name, system_dir_4, import_libini
386
	lib4 l_libs lib_name_4, file_name, system_dir_4, import_libini
382
	lib5 l_libs lib_name_5, file_name, system_dir_5, import_libkmenu
387
	lib5 l_libs lib_name_5, file_name, system_dir_5, import_libkmenu
383
load_lib_end:
388
load_lib_end:
384
 
389
 
385
IncludeIGlobals
390
IncludeIGlobals
386
hed db 'TextEdit '
391
hed db 'TextEdit '
387
i_end:
392
i_end:
388
	openfile_path: ;¯®«­ë© ¯ãâì ª ä ©«ã á ª®â®àë¬ ¨¤¥â à ¡®â 
393
	openfile_path: ;¯®«­ë© ¯ãâì ª ä ©«ã á ª®â®àë¬ ¨¤¥â à ¡®â 
389
		rb 4096
394
		rb 4096
390
	dir_mem rb 32+304*count_of_dir_list_files
395
	dir_mem rb 32+304*count_of_dir_list_files
391
	wnd_s_pos: ;¬¥áâ® ¤«ï ­ áâ஥ª áâ à⮢®© ¯®§¨æ¨¨ ®ª­ 
396
	wnd_s_pos: ;¬¥áâ® ¤«ï ­ áâ஥ª áâ à⮢®© ¯®§¨æ¨¨ ®ª­ 
392
		rq 1
397
		rq 1
393
	last_open_synt_file rb 32 ;¨¬ï ¯®á«¥¤­¥£® ¯®¤ª«î祭­®£® ä ©«  ᨭ⠪á¨á 
398
	last_open_synt_file rb 32 ;¨¬ï ¯®á«¥¤­¥£® ¯®¤ª«î祭­®£® ä ©«  ᨭ⠪á¨á 
394
	buf rb BUF_SIZE ;¡ãä¥à ¤«ï ª®¯¨à®¢ ­¨ï ¨ ¢áâ ¢ª¨
399
	buf rb BUF_SIZE ;¡ãä¥à ¤«ï ª®¯¨à®¢ ­¨ï ¨ ¢áâ ¢ª¨
395
	buf_find rb 302 ;¡ãä¥à ¤«ï ¯®¨áª  ⥪áâ 
400
	buf_find rb 302 ;¡ãä¥à ¤«ï ¯®¨áª  ⥪áâ 
396
	buf_replace rb 302 ;¡ãä¥à ¤«ï § ¬¥­ë ⥪áâ 
401
	buf_replace rb 302 ;¡ãä¥à ¤«ï § ¬¥­ë ⥪áâ 
397
	buf_goto rb 12 ;¡ãä¥à ¤«ï ¯¥à室  ­  áâபã
402
	buf_goto rb 12 ;¡ãä¥à ¤«ï ¯¥à室  ­  áâபã
398
	sc system_colors
403
	sc system_colors
399
IncludeUGlobals
404
IncludeUGlobals
400
	align 16
405
	align 16
401
	procinfo process_information
406
	procinfo process_information
402
		rb 1024
407
		rb 1024
403
	thread:
408
	thread:
404
		rb 4096
409
		rb 4096
405
align 16
410
align 16
406
    thread_coords:
411
    thread_coords:
407
	rb 4096
412
	rb 4096
408
align 16
413
align 16
409
stacktop:
414
stacktop:
410
	sys_path: ;¯ãâì ®âªã¤  § ¯ãá⨫áï ¨á¯®«­ï¥¬ë© ä ©«
415
	sys_path: ;¯ãâì ®âªã¤  § ¯ãá⨫áï ¨á¯®«­ï¥¬ë© ä ©«
411
		rb 4096
416
		rb 4096
412
	file_name: ;¯ à ¬¥âàë § ¯ã᪠
417
	file_name: ;¯ à ¬¥âàë § ¯ã᪠
413
		rb 4096
418
		rb 4096
414
	syntax_path: ;¨¬ï ¯®¤ª«îç ¥¬®£® ä ©«  ᨭ⠪á¨á 
419
	syntax_path: ;¨¬ï ¯®¤ª«îç ¥¬®£® ä ©«  ᨭ⠪á¨á 
415
		rb 4096
420
		rb 4096
416
	plugin_path:
421
	plugin_path:
417
		rb 4096
422
		rb 4096
418
	text_work_area: ;¯ãâì ª ä ©«ã, ª®â®àë© ¯®ª §ë¢ ¥âáï ¢ ®ª­¥
423
	text_work_area: ;¯ãâì ª ä ©«ã, ª®â®àë© ¯®ª §ë¢ ¥âáï ¢ ®ª­¥
419
		rb 4096
424
		rb 4096
420
	filename_area: ;¨¬ï ä ©«  ¤«ï ¤¨ «®£  ®âªàëâ¨ï/§ ªàëâ¨ï
425
	filename_area: ;¨¬ï ä ©«  ¤«ï ¤¨ «®£  ®âªàëâ¨ï/§ ªàëâ¨ï
421
		rb 256
426
		rb 256
422
	file_info:
427
	file_info:
423
		rb 40
428
		rb 40
424
mem:
429
mem: