Subversion Repositories Kolibri OS

Rev

Rev 1449 | Rev 1457 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

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