Subversion Repositories Kolibri OS

Rev

Rev 1456 | Rev 1458 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1456 Rev 1457
Line -... Line 1...
-
 
1
struct f70
-
 
2
  func_n dd ?
-
 
3
  param1 dd ?
-
 
4
  param2 dd ?
-
 
5
  param3 dd ?
-
 
6
  param4 dd ?
-
 
7
  rezerv db ?
-
 
8
  name dd ?
-
 
9
ends
-
 
10
 
-
 
11
struct TexColViv
-
 
12
  Text rb MAX_COLOR_WORD_LEN ; á«®¢® ¤«ï ¯®¤á¢¥âª¨
-
 
13
  f1 dd 0 ; á¯à ¢ª  ¯® á«®¢ã
-
 
14
  wwo db ? ; whole words only
-
 
15
  endc db ? ; ᨬ¢®« ª®­æ  ¢ë¤¥«¥­¨ï (wwo&4)
-
 
16
  color db ? ; ­®¬¥à 梥â 
-
 
17
ends
-
 
18
 
-
 
19
struct symbol
-
 
20
  c db ?    ;  +0 ᨬ¢®«
-
 
21
  col db ?  ;  +1 梥â
-
 
22
  perv dd ? ;  +2
-
 
23
  next dd ? ;  +6 㪠§ â¥«¨
-
 
24
  tc dd ?   ; +10 ¢à¥¬. ᮧ¤ ­¨ï
-
 
25
  td dd ?   ; +14 ¢à¥¬. 㤠«¥­¨ï
-
 
26
ends
-
 
27
 
-
 
28
 
-
 
29
hed db 'TextEditor 29.04.10',0 ;¯®¤¯¨áì ®ª­ 
-
 
30
sc system_colors
-
 
31
 
-
 
32
fn_icon db 'te_icon.bmp',0
-
 
33
bmp_icon dd 0
-
 
34
run_file_70 f70 	  
-
 
35
 
-
 
36
 
-
 
37
;input:
-
 
38
; al = ª®¤ ®è¨¡ª¨
-
 
39
align 4
-
 
40
ted_on_init_synt_err:
-
 
41
	mov byte[msgbox_3.err],al
-
 
42
	stdcall [mb_create],msgbox_3,thread ;message: Can-t open color options file!
-
 
43
	ret
-
 
44
 
-
 
45
 
-
 
46
;-----------------------------------------------------------------------------
-
 
47
;äã­ªæ¨ï ¤«ï ¢ë¤¥«¥­¨ï ¯ ¬ïâ¨
-
 
48
;input:
-
 
49
; ecx = size data
-
 
50
;otput:
-
 
51
; eax = pointer to memory
-
 
52
align 4
-
 
53
mem_Alloc:
-
 
54
  push ebx
-
 
55
  mov eax,68
-
 
56
  mov ebx,12
-
 
57
  int 0x40
-
 
58
  pop ebx
-
 
59
  ret
-
 
60
;-----------------------------------------------------------------------------
-
 
61
;äã­ªæ¨ï ¤«ï ®á¢®¡®¦¤¥­¨ï ¯ ¬ïâ¨
-
 
62
;input:
-
 
63
; ecx = pointer to memory
-
 
64
align 4
-
 
65
mem_Free:
-
 
66
  push eax ebx
-
 
67
  cmp ecx,0
-
 
68
  jz @f
-
 
69
    mov eax,68
-
 
70
    mov ebx,13
-
 
71
    int 0x40
-
 
72
  @@:
-
 
73
  pop ebx eax
-
 
74
  ret
-
 
75
 
-
 
76
  
1
align 4
77
align 4
2
but_NewFile:
78
ted_but_new_file:
3
  push eax ebx
79
  push eax ebx
4
  stdcall ted_can_save, tedit0
80
  stdcall [ted_can_save], tedit0
5
  cmp al,1
81
  cmp al,1
6
  jne @f
82
  jne @f
7
    stdcall [mb_create],msgbox_2,thread ;message: save changes in file?
83
    stdcall [mb_create],msgbox_2,thread ;message: save changes in file?
8
    ;mov eax,5
84
    ;mov eax,5
9
    ;mov ebx,50
85
    ;mov ebx,50
Line 16... Line 92...
16
  pop ebx eax
92
  pop ebx eax
17
  ret
93
  ret
Line 18... Line 94...
18
 
94
 
19
align 4
95
align 4
20
On_NewFile:
96
On_NewFile:
21
  stdcall ted_clear, tedit0,1
97
  stdcall [ted_clear], tedit0,1
22
  call draw_but_toolbar
98
  call draw_but_toolbar
23
  stdcall draw_main_win, tedit0
99
  stdcall [ted_draw], tedit0
Line 24... Line 100...
24
  ret
100
  ret
25
 
101
 
26
align 4
102
align 4
27
On_SaveAndNewFile:
103
On_SaveAndNewFile:
Line 28... Line 104...
28
  push edi
104
  push edi
29
  mov edi, tedit0
105
  mov edi, tedit0
30
 
106
 
31
  stdcall but_SaveFile,edi
107
  stdcall [ted_but_save_file],edi,run_file_70,[edit1.text]
32
  cmp ted_err_save,0
108
  cmp ted_err_save,0
33
  jne @f
109
  jne @f
34
    call On_NewFile
110
    call On_NewFile
Line -... Line 111...
-
 
111
  @@:
-
 
112
  pop edi
35
  @@:
113
  ret
36
  pop edi
-
 
37
  ret
-
 
38
 
-
 
39
align 4
-
 
40
but_no_msg_OpenFile: ;äã­ªæ¨ï ®âªàëâ¨ï ä ©«  ç¥à¥§ ¡¥§ ®ª®­  á®®¡é¥­¨ï
-
 
41
  stdcall ted_on_open_file, tedit0
-
 
42
  ret
-
 
43
 
114
 
44
 
115
;description:
45
;äã­ªæ¨ï ®âªàëâ¨ï ä ©«  á ¢®§¬®¦­ë¬ ®ª­®¬ á®®¡é¥­¨ï (® ¢®§¬®¦­®á⨠®â¬¥­¨âì ®âªàë⨥)
116
; äã­ªæ¨ï ®âªàëâ¨ï ä ©«  ¡¥§ ®ª®­  á®®¡é¥­¨ï
46
align 4
-
 
47
but_OpenFile:
-
 
48
  push eax
-
 
49
  stdcall ted_can_save, tedit0
-
 
50
  cmp al,1
-
 
51
  jne @f
-
 
52
    stdcall [mb_create],msgbox_5,thread ;message: save changes in file?
117
align 4
53
    stdcall [mb_setfunctions],msgbox_5_funct
-
 
54
    jmp .ret_f
118
but_no_msg_OpenFile:
55
  @@:
119
	push eax ebx
Line -... Line 120...
-
 
120
	stdcall [ted_open_file], tedit0,run_file_70,[edit1.text]
-
 
121
	call ted_messages_after_open_file
56
  stdcall ted_on_open_file, tedit0
122
	pop ebx eax
57
  .ret_f:
-
 
58
  pop eax
-
 
59
  ret
123
	ret
60
 
-
 
61
align 4
124
 
62
proc ted_on_open_file, edit:dword ;äã­ªæ¨ï ®âªàëâ¨ï ä ©« 
-
 
63
  push eax ebx edi
-
 
64
  mov edi,dword[edit]
-
 
65
 
-
 
66
  mov eax,70
125
;description:
67
  mov [run_file_70.func_n], 0
-
 
68
  mov [run_file_70.param1], 0
-
 
69
  mov [run_file_70.param2], 0
-
 
70
  mov [run_file_70.param3], maxChars-2 ;sizeof.symbol
-
 
71
  m2m [run_file_70.param4], ted_tex
-
 
72
  mov [run_file_70.rezerv], 0
-
 
73
  push dword[edit1.text]
-
 
74
  pop dword[run_file_70.name]
-
 
75
  mov ebx,run_file_70
126
; äã­ªæ¨ï ®âªàëâ¨ï ä ©«  á ¢®§¬®¦­ë¬ ®ª­®¬ á®®¡é¥­¨ï (® ¢®§¬®¦­®á⨠®â¬¥­¨âì ®âªàë⨥)
76
  int 0x40
127
align 4
77
 
-
 
78
  cmp eax,0
-
 
79
  je @f
-
 
80
  cmp eax,6
-
 
81
  je @f
-
 
82
    cmp ax,10
-
 
83
    jl .zifra_0_9
-
 
84
      mov al,'?'
-
 
85
      sub ax,48
128
ted_but_open_file:
-
 
129
	push eax ebx
86
    .zifra_0_9:
130
	stdcall [ted_can_save], tedit0
87
    add ax,48
131
	cmp al,1
88
 
-
 
89
    mov byte[msgbox_4.err],al
-
 
90
    stdcall [mb_create],msgbox_4,thread ;message: Can-t open text file!
-
 
91
    jmp .ret_f
132
	jne @f
92
  @@:
-
 
93
  cmp ebx,-1
-
 
94
  je .ret_f
133
		stdcall [mb_create],msgbox_5,thread ;message: save changes in file?
95
    ;if open file
134
		stdcall [mb_setfunctions],msgbox_5_funct
96
    call OpenFile
135
		jmp .ret_f
97
    cmp ebx,maxChars-2
136
	@@:
98
    jl .ret_f
-
 
99
    stdcall [mb_create],msgbox_1,thread
-
 
Line -... Line 137...
-
 
137
	stdcall [ted_open_file], tedit0,run_file_70,[edit1.text]
-
 
138
	call ted_messages_after_open_file
-
 
139
	.ret_f:
-
 
140
	pop ebx eax
100
  .ret_f:
141
	ret
101
  pop edi ebx eax
-
 
102
  ret
-
 
103
endp
-
 
104
 
142
 
105
 
-
 
106
align 4
-
 
107
proc but_SaveFile, edit:dword
-
 
108
  pushad
-
 
109
 
-
 
110
  stdcall ted_can_save,edi
-
 
111
  cmp al,0
-
 
112
  je .no_save
143
;input:
113
 
-
 
114
  mov edi,dword[edit]
-
 
115
 
-
 
116
  mov ecx,maxChars
-
 
117
  call mem_Alloc
-
 
118
  push eax
-
 
119
 
-
 
120
  mov edx,ted_tex
-
 
121
  xor ecx,ecx
-
 
122
  @@:
-
 
123
    call IteratNext
-
 
124
    cmp edx,ted_tex_1
-
 
125
    jle @f ;edx = ted_tex or edx = ted_tex+sizeof.symbol
-
 
126
    mov bl,[edx]
-
 
127
    mov byte[eax],bl
144
; eax = ª®¤ ®è¨¡ª¨
128
    inc eax
145
; ebx = ª®««¨ç¥á⢮ ¯à®ç¨â ­­ëå ¡ ©â
129
    inc ecx
-
 
130
    jmp @b
-
 
131
  @@:
-
 
132
 
-
 
133
  cmp ecx,0
-
 
134
  je @f
-
 
135
    pop eax
-
 
136
    mov [run_file_70.param4],eax
-
 
137
    push eax
-
 
138
    mov eax,70
-
 
139
    mov [run_file_70.func_n], 2
-
 
140
    mov [run_file_70.param1], 0
-
 
141
    mov [run_file_70.param2], 0
-
 
142
    mov [run_file_70.param3], ecx
-
 
143
    mov [run_file_70.rezerv], 0
-
 
144
    push [edit1.text]
-
 
145
    pop [run_file_70.name]
-
 
146
    mov ebx,run_file_70
-
 
147
    int 0x40
146
; edi = pointer to tedit struct
148
 
147
align 4
149
    mov ted_err_save,ax
148
ted_messages_after_open_file:
150
 
149
	push ecx
151
    cmp eax,0
150
	cmp eax,0
152
    je .no_msg
151
	je @f
153
;    cmp eax,6
152
	cmp eax,6
154
;    je @f
153
	je @f
155
      cmp ax,10
154
		cmp ax,10
156
      jl .zifra_0_9
155
		jl .zifra_0_9
157
	mov al,'?'
156
			mov al,'?'
158
	sub ax,48
157
			sub ax,48
159
      .zifra_0_9:
-
 
160
      add ax,48
-
 
161
 
158
		.zifra_0_9:
162
      mov byte[msgbox_6.err],al
159
		add ax,48
163
      stdcall [mb_create],msgbox_6,thread ;message: Can-t save text file!
160
 
164
      jmp @f
161
		mov byte[msgbox_4.err],al
-
 
162
		stdcall [mb_create],msgbox_4,thread ;message: Can-t open text file!
-
 
163
		jmp .ret_f
165
    .no_msg:
164
	@@:
166
    m2m ted_tim_ls,ted_tim_ch
165
	cmp ebx,-1
-
 
166
	je .ret_f
167
  @@:
167
		;if open file
168
 
168
		mov ecx,ted_max_chars
169
  pop ecx
169
		sub ecx,2 ;ecx = ¬ ªá¨¬ «ì­®¥ ç¨á«® ¡ ©â, ¤«ï ª®â®àëå ¡ë«  ¢ë¤¥«¥­  ¯ ¬ïâì
Line 170... Line 170...
170
  call mem_Free
170
		cmp ebx,ecx
171
  .no_save:
-
 
172
  popad
-
 
173
  ret
-
 
174
endp
-
 
175
 
171
		jl .ret_f
176
 
172
			stdcall [mb_create],msgbox_1,thread
177
align 4
-
 
178
proc but_FindText, edit:dword
-
 
179
  pushad
-
 
180
    mov edi,dword[edit]
-
 
181
 
-
 
182
    call GetPos
-
 
183
    mov eax,[edit2.text]
-
 
184
    mov bl,byte[eax]
-
 
185
    @@:
-
 
186
      call GetFindRezult
-
 
187
      cmp bh,1
-
 
188
      je @f ; find
-
 
189
 
-
 
190
      call IteratNext
-
 
191
      cmp edx,ted_tex_1
-
 
192
      jle @f
-
 
193
      jmp @b
-
 
194
    @@:
-
 
195
    cmp bh,0
-
 
196
    je @f
-
 
197
      call GetTexCoords
-
 
198
      inc ebx ;move cursor right
-
 
199
      mov ted_sel_x1,ebx
-
 
200
      mov ted_sel_y1,eax
-
 
201
      mov edx,eax
-
 
202
      mov ecx,ebx
-
 
203
      call GoToPos
-
 
204
      mov edx,esi ;esi ¡ë«® ãáâ ­®¢«¥® ¢ GetFindRezult
173
	.ret_f:
205
      call GetTexCoords
-
 
206
      mov ted_sel_x0,ebx
-
 
207
      mov ted_sel_y0,eax
-
 
208
      stdcall draw_main_win,edi
-
 
209
      jmp .end_find
-
 
210
    @@:
-
 
211
      stdcall [mb_create],msgbox_7,thread ;message: Can not find text
-
 
212
    .end_find:
-
 
213
  popad
-
 
214
  ret
-
 
215
endp
-
 
216
 
-
 
217
;input:
-
 
218
; eax - text need find
-
 
219
; bl - first symbol to find
-
 
220
; edx - first symbol pointer
-
 
221
; edi - pointer to tedit struct
-
 
222
;output:
-
 
223
; bh - rezult
-
 
224
; edx - last text position (if find sucess)
-
 
225
; esi - first symbol pointer
-
 
226
;description:
-
 
227
; ”ã­ªæ¨ï ¯à®¢¥àï¥â ᮢ¯ ¤ ¥â «¨ ⥪áâ ¢ ¡ãä¥à¥ eax
-
 
228
; á ⥪á⮬ । ªâ®à  ¯® 㪠§ â¥«î edx.
-
 
229
; ‘â ­¤ àâ­ë¥ ä㭪樨 (­ ¯à. strcmp) âãâ ­¥ ¯®¤®©¤ãâ, ¯®â®¬ã çâ®
-
 
230
; ¢ ¯ ¬ï⨠। ªâ®à  ⥪áâ ᮤ¥à¦¨âáï ­¥ ¢ ¢¨¤¥ ascii áâப.
-
 
231
align 4
-
 
232
GetFindRezult:
-
 
233
  push eax
-
 
234
    mov bh,1
-
 
235
    mov esi,edx ;copy edx
-
 
236
    @@:
-
 
237
      cmp byte[edx],bl
-
 
238
      jne .no_text
-
 
239
 
-
 
240
      inc eax ;*** get next symbol (in find text) ***
-
 
241
      mov bl,byte[eax]
-
 
242
      cmp bl,0
-
 
243
      je @f ;end of find text
-
 
244
 
-
 
245
      call IteratNext ;*** get next symbol (in editor text) ***
-
 
246
      cmp edx,ted_tex_1
-
 
247
      jle @f ;end of editor text
-
 
248
 
-
 
249
      jmp @b
174
	pop ecx
Line 250... Line 175...
250
      .no_text:
175
	ret
251
	xor bh,bh
176
 
252
	mov edx,esi ;restore edx
177
align 4
253
    @@:
178
ted_save_err_msg:
Line 254... Line 179...
254
  pop eax
179
	mov byte[msgbox_6.err],al
255
  mov bl,byte[eax] ;restore bl
180
	stdcall [mb_create],msgbox_6,thread ;message: Can-t save text file!
256
  ret
181
	ret
257
 
182
 
258
align 4
-
 
259
proc ted_but_open_syntax, edit:dword
-
 
260
  push edi
-
 
261
  mov edi,dword[edit]
-
 
262
 
-
 
263
  cmp ted_panel_id,TE_PANEL_SYNTAX
-
 
264
  jne @f
-
 
265
    stdcall dword[tl_node_get_data], tree1
-
 
266
    pop dword[fn_col_option]
-
 
267
    stdcall InitColText,edi
-
 
268
    call CmColored
-
 
269
    stdcall draw_main_win,edi
183
align 4
270
  @@:
-
 
271
  pop edi
-
 
272
  ret
-
 
273
endp
-
 
274
 
-
 
275
align 4
-
 
276
proc ted_but_select_word, edit:dword
-
 
277
  pushad
-
 
278
  mov edi,dword[edit]
-
 
279
 
-
 
280
  call GetPos
-
 
281
  push edx
-
 
282
    call ItPervColorTag
-
 
283
    cmp edx,ted_tex_1
-
 
284
    jle @f
-
 
285
      call GetTexCoords
-
 
286
      mov ted_sel_x0,ebx
-
 
287
      mov ted_sel_y0,eax
-
 
288
    @@:
-
 
289
  pop edx
-
 
290
    call ItNextColorTag
184
proc ted_but_open_syntax, edit:dword
291
    cmp edx,ted_tex_1
-
 
292
    jle @f
-
 
293
      call GetTexCoords
-
 
294
      mov ted_sel_x1,ebx
-
 
295
      mov ted_sel_y1,eax
-
 
296
    @@:
185
  push ebx edi
297
 
-
 
298
  call draw_but_toolbar
-
 
299
  stdcall draw_main_win,edi
-
 
300
  popad
-
 
301
  ret
-
 
302
endp
186
  mov edi,dword[edit]
303
 
-
 
304
align 4
-
 
305
proc ted_but_cut, edit:dword
-
 
306
  push edi
187
 
307
  mov edi,dword[edit]
188
  cmp ted_panel_id,TED_PANEL_SYNTAX
308
 
-
 
309
  stdcall ted_but_copy,edi
-
 
310
  stdcall ted_set_undo,edi
-
 
311
  stdcall SelTextDel,ted_opt_ed_change_time
-
 
312
 
-
 
313
  cmp al,1
-
 
314
  jne @f
-
 
315
    call draw_but_toolbar
-
 
316
    stdcall draw_main_win,edi
-
 
317
  @@:
-
 
318
  pop edi
-
 
319
  ret
-
 
320
endp
-
 
321
 
-
 
322
;output:
-
 
323
; al = 1 if copy text
-
 
324
align 4
-
 
325
proc ted_but_copy, edit:dword
-
 
326
  pushad
-
 
327
  mov edi,dword[edit]
-
 
328
 
-
 
329
  stdcall IsSel,edi
-
 
330
  cmp al,0
-
 
331
  je .end_f ;if not selected text
-
 
332
  stdcall SelNormalize,edi
-
 
333
 
-
 
334
  mov esi,ted_seln_x1
-
 
335
  mov ecx,ted_seln_y1
-
 
336
  call GetPosByParam
-
 
337
  mov ebx,edx
-
 
338
  mov esi,ted_seln_x0
-
 
339
  mov ecx,ted_seln_y0
-
 
340
  call GetPosByParam
-
 
341
  mov esi,ebx
-
 
342
 
-
 
343
  xor ecx,ecx
-
 
344
  mov ebx,buf
-
 
345
  ;mov edx,ted_tex
-
 
346
  @@:
-
 
347
    cmp edx,ted_tex_1 ;end of file
-
 
348
    jle @f
-
 
349
    cmp edx,esi ;end of select
-
 
350
    je @f
-
 
351
    inc ecx
-
 
352
    cmp ecx,BUF_SIZE ;owerflow bufer
189
  jne @f
353
    je @f
-
 
354
 
-
 
355
    mov al,byte[edx]
-
 
356
    mov byte[ebx],al
190
    stdcall dword[tl_node_get_data], tree1
357
    inc ebx
-
 
358
 
-
 
359
    call IteratNext
-
 
360
    jmp @b
-
 
361
  @@:
-
 
362
  add ecx,buf
191
    pop dword[fn_col_option]
363
  mov byte[ebx],0
192
	mov ebx,dword[fn_col_option]
Line 364... Line -...
364
 
-
 
365
  cmp ecx,0
193
	copy_path ebx,fn_syntax_dir,file_name_rez,0x0
366
  je .end_f
-
 
367
    call draw_but_toolbar
-
 
368
    stdcall draw_bufer,edi
-
 
369
  .end_f:
-
 
370
  popad
-
 
371
  ret
-
 
372
endp
-
 
373
 
-
 
374
 
-
 
375
align 4
-
 
376
proc ted_but_paste, edit:dword
-
 
377
  push eax ebx esi edi
-
 
378
  mov edi,dword[edit]
-
 
379
 
-
 
380
    mov esi,buf
-
 
381
    call strlen
-
 
382
    cmp eax,1
-
 
383
    jl @f
-
 
384
      stdcall ted_set_undo,edi
-
 
385
      mov esi,eax
-
 
386
      mov ebx,ted_opt_ed_change_time+ted_opt_ed_move_cursor
-
 
387
      stdcall SelTextDel,ebx
-
 
388
	  cmp al,1
-
 
389
	  jne .del
-
 
390
	    mov ebx,ted_opt_ed_move_cursor
-
 
391
	  .del:
194
	copy_path file_name_rez,sys_path,file_name,0x0
392
      stdcall ted_text_add,edi,buf,esi,ebx
195
    stdcall [ted_init_syntax_file],edi,run_file_70,file_name
393
      call draw_but_toolbar
196
    call [ted_text_colored]
Line 394... Line 197...
394
      stdcall draw_main_win,edi
197
    stdcall [ted_draw],edi
395
    @@:
198
  @@:
396
  pop edi esi ebx eax
199
  pop edi ebx
397
  ret
200
  ret
398
endp
201
endp
399
 
202
 
400
align 4
203
align 4
401
proc but_find, edit:dword ;¢ë§®¢/áªàë⨥ ¯ ­¥«¨ ¯®¨áª 
204
proc ted_but_find ;¢ë§®¢/áªàë⨥ ¯ ­¥«¨ ¯®¨áª 
402
  push edi
205
  push edi
403
  mov edi,dword[edit]
206
  mov edi,tedit0
404
 
207
 
405
  cmp ted_panel_id,TE_PANEL_NULL
208
  cmp ted_panel_id,TED_PANEL_NULL
406
  je @f
209
  je @f
407
    mov ted_panel_id,TE_PANEL_NULL
210
    mov ted_panel_id,TED_PANEL_NULL
Line 408... Line 211...
408
    mov ted_wnd_l,0
211
    mov ted_wnd_l,0
409
    jmp .e_if
-
 
410
  @@:
-
 
411
    mov ted_panel_id,TE_PANEL_FIND
-
 
412
    mov ted_wnd_l,TE_PANEL_WIDTH
-
 
413
  .e_if:
212
    jmp .e_if
414
  stdcall EvSize,edi
-
 
415
  stdcall draw_main_win,edi
-
 
416
  pop edi
-
 
417
  ret
-
 
418
endp
-
 
419
 
-
 
420
align 4
-
 
421
but_replace:
-
 
422
  ret
-
 
423
 
-
 
424
align 4
-
 
425
but_find_key_w:
-
 
426
  ret
-
 
427
 
-
 
428
align 4
-
 
429
proc but_sumb_upper, edit:dword
-
 
430
  push edi esi
-
 
431
  mov edi,dword[edit]
-
 
432
 
-
 
433
  mov [conv_table],EvUpper
-
 
434
  call ConvertSelText
-
 
435
  cmp esi,0
-
 
436
  je @f
-
 
437
    stdcall draw_main_win,edi
-
 
438
  @@:
-
 
439
  pop esi edi
-
 
440
  ret
-
 
441
endp
-
 
442
 
-
 
443
align 4
-
 
444
proc but_sumb_lover, edit:dword
-
 
445
  push edi esi
-
 
446
  mov edi,dword[edit]
-
 
447
 
-
 
448
  mov [conv_table],EvLover
-
 
449
  call ConvertSelText
-
 
450
  cmp esi,0
-
 
451
  je @f
-
 
452
    stdcall draw_main_win,edi
-
 
453
  @@:
-
 
454
  pop esi edi
-
 
455
  ret
-
 
456
endp
-
 
457
 
-
 
458
align 4
-
 
459
proc but_reverse, edit:dword
-
 
460
  push eax ebx edi
-
 
461
  mov edi,dword[edit]
-
 
462
 
-
 
463
  stdcall IsSel,edi
-
 
464
  cmp al,0
-
 
465
  je @f
-
 
466
    stdcall SelNormalize,edi
-
 
467
    push esi ecx edx
-
 
468
      mov esi,ted_seln_x0
-
 
469
      mov ecx,ted_seln_y0
-
 
470
      call GetPosByParam
-
 
471
      mov eax,edx
-
 
472
      mov esi,ted_seln_x1
-
 
473
      cmp esi,0
-
 
474
      je .beg_str
213
  @@:
475
	dec esi
-
 
476
      .beg_str:
214
    mov ted_panel_id,TED_PANEL_FIND
477
      mov ecx,ted_seln_y1
-
 
Line 478... Line 215...
478
      call GetPosByParam
215
    mov ted_wnd_l,TED_PANEL_WIDTH
479
      ;call GetTexPervPos
-
 
480
      mov ebx,edx
216
  .e_if:
481
    pop edx ecx esi
-
 
482
    ;cmp eax,...
-
 
483
    ;je @f
-
 
484
    call Revers
-
 
485
  @@:
-
 
486
  stdcall draw_main_win,edi
-
 
487
  pop edi ebx eax
-
 
488
  ret
-
 
489
endp
-
 
490
 
-
 
491
align 4
-
 
492
proc ted_but_undo, edit:dword
217
  stdcall EvSize,edi
493
  push eax edi
-
 
Line 494... Line 218...
494
  mov edi,dword[edit]
218
  stdcall [ted_draw],edi
495
 
-
 
496
  mov eax,ted_tim_undo
-
 
497
  cmp ted_tim_ch,eax
-
 
498
  jbe @f
-
 
499
    inc ted_tim_undo
-
 
500
    ;call CmColored
-
 
501
	stdcall draw_main_win,edi
219
  pop edi
502
	call draw_but_toolbar
-
 
503
  @@:
-
 
504
  pop edi eax
-
 
505
  ret
-
 
506
endp
-
 
507
 
220
  ret
508
align 4
-
 
Line 509... Line 221...
509
proc ted_but_redo, edit:dword
221
endp
510
  push edi
222
 
511
  mov edi,dword[edit]
223
align 4
512
 
224
ted_on_find_err:
Line 513... Line 225...
513
  cmp ted_tim_undo,1
225
	stdcall [mb_create],msgbox_7,thread ;message: Can not find text
514
  jb @f
226
	ret
515
    dec ted_tim_undo
227
 
516
    ;call CmColored
228
align 4
517
	stdcall draw_main_win,edi
229
but_replace:
518
	call draw_but_toolbar
230
  ret
Line 519... Line 231...
519
  @@:
231
 
Line 539... Line 251...
539
  mov edi,dword[edit]
251
  mov edi,dword[edit]
Line 540... Line 252...
540
 
252
 
541
  xor ted_mode_color,1
253
  xor ted_mode_color,1
542
  cmp ted_mode_color,0
254
  cmp ted_mode_color,0
543
  je @f
255
  je @f
544
    call CmColored
256
    call [ted_text_colored]
545
  @@:
257
  @@:
546
  call draw_but_toolbar
258
  call draw_but_toolbar
547
  stdcall draw_main_win,edi
259
  stdcall [ted_draw],edi
548
  pop edi
260
  pop edi
549
  ret
261
  ret
Line 550... Line -...
550
endp
-
 
551
 
-
 
552
 
-
 
553
;input:
-
 
554
; edi = pointer to tedit struct
-
 
555
align 4
-
 
556
but_CtrlHome:
-
 
557
	mov ted_cur_x,0
-
 
558
	mov ted_cur_y,0
-
 
559
	push eax
-
 
560
		mov eax,ted_scr_w
-
 
561
		mov dword[eax+sb_offs_position],0
-
 
562
		mov eax,ted_scr_h
-
 
563
		mov dword[eax+sb_offs_position],0
-
 
564
	pop eax
-
 
565
	call draw_but_toolbar
-
 
566
	stdcall draw_main_win,edi
-
 
567
	ret
262
endp
568
 
263
 
569
align 4
264
align 4
570
proc but_synt_show, edit:dword
265
proc but_synt_show, edit:dword
Line 571... Line 266...
571
  push edi
266
  push edi
572
  mov edi,[edit]
267
  mov edi,[edit]
573
 
268
 
574
  cmp ted_panel_id,TE_PANEL_NULL
269
  cmp ted_panel_id,TED_PANEL_NULL
575
  je @f
270
  je @f
576
    mov ted_panel_id,TE_PANEL_NULL
271
    mov ted_panel_id,TED_PANEL_NULL
577
    mov ted_wnd_l,0
272
    mov ted_wnd_l,0
578
    jmp .e_if
273
    jmp .e_if
579
  @@:
274
  @@:
580
    mov ted_panel_id,TE_PANEL_SYNTAX
275
    mov ted_panel_id,TED_PANEL_SYNTAX
581
    mov ted_wnd_l,TE_PANEL_WIDTH
-
 
582
  .e_if:
-
 
583
  stdcall EvSize,edi
-
 
584
  stdcall draw_main_win,edi
-
 
585
  pop edi
-
 
586
  ret
-
 
587
endp
-
 
588
 
-
 
589
align 4
-
 
590
proc ted_sel_key_up, edit:dword
-
 
591
  push edi
-
 
592
  mov edi,dword[edit]
-
 
593
 
-
 
594
  cmp ted_drag_k,1
-
 
595
  je @f
-
 
596
    stdcall SelStart,edi
-
 
597
    mov ted_drag_k,1
-
 
598
  @@:
-
 
599
  push dx
-
 
600
    call CurMoveUp
-
 
601
    cmp dl,8
-
 
602
    jne @f
-
 
603
      call OnInitialUpdate
-
 
604
    @@:
-
 
605
  pop dx
-
 
606
  stdcall SelMove,edi
-
 
607
  stdcall draw_main_win,edi
-
 
608
  pop edi
-
 
609
  ret
-
 
610
endp
-
 
611
 
-
 
612
align 4
-
 
613
proc ted_sel_key_down, edit:dword
-
 
614
  push edi
-
 
615
  mov edi,dword[edit]
-
 
616
 
-
 
617
  cmp ted_drag_k,1
-
 
618
  je @f
-
 
619
    stdcall SelStart,edi
-
 
620
    mov ted_drag_k,1
-
 
621
  @@:
-
 
622
  push dx
-
 
623
    call CurMoveDown
-
 
624
    cmp dl,8
-
 
625
    jne @f
-
 
626
      call OnInitialUpdate
276
    mov ted_wnd_l,TED_PANEL_WIDTH
627
    @@:
-
 
628
  pop dx
-
 
629
  stdcall SelMove,edi
-
 
630
  stdcall draw_main_win,edi
-
 
631
  pop edi
-
 
632
  ret
-
 
633
endp
-
 
634
 
-
 
635
align 4
-
 
636
proc ted_sel_key_left, edit:dword
-
 
637
  push edi
-
 
638
  mov edi,dword[edit]
-
 
639
 
-
 
640
  cmp ted_drag_k,1
-
 
641
  je @f
-
 
642
    stdcall SelStart,edi
-
 
643
  @@:
-
 
644
  push dx
-
 
645
    call CurMoveLeft
-
 
646
    stdcall SelMove,edi
-
 
647
    cmp ted_drag_k,1
-
 
648
    je @f
-
 
649
      mov ted_drag_k,1
-
 
650
      mov dl,8
-
 
651
    @@:
-
 
652
    cmp dl,8
-
 
653
    jne @f
-
 
654
      call OnInitialUpdate
-
 
655
      stdcall draw_main_win,edi
-
 
656
      jmp .end_f
-
 
657
    @@:
-
 
658
      stdcall draw_cur_line,edi
-
 
659
    .end_f:
-
 
660
  pop dx
-
 
661
  pop edi
-
 
662
  ret
-
 
663
endp
-
 
664
 
-
 
665
align 4
-
 
666
proc ted_sel_key_right, edit:dword
-
 
667
  push edi
-
 
668
  mov edi,dword[edit]
-
 
669
 
-
 
670
  cmp ted_drag_k,1
-
 
671
  je @f
-
 
672
    stdcall SelStart,edi
-
 
673
  @@:
-
 
674
  push dx
-
 
675
    call CurMoveRight
-
 
676
    stdcall SelMove,edi
-
 
677
    cmp ted_drag_k,1
-
 
678
    je @f
-
 
679
      mov ted_drag_k,1
-
 
680
      mov dl,8
-
 
681
    @@:
-
 
682
    cmp dl,8
-
 
683
    jne @f
-
 
684
      call OnInitialUpdate
-
 
685
      stdcall draw_main_win,edi
-
 
686
      jmp .end_f
-
 
687
    @@:
-
 
688
      stdcall draw_cur_line,edi
277
  .e_if:
689
    .end_f:
278
  stdcall EvSize,edi
690
  pop dx
279
  stdcall [ted_draw],edi