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
proc mouse_wnd_main, edit:dword
2
proc mouse_wnd_main, edit:dword
2
  push eax ebx ecx edi
3
  push eax ebx ecx edi
3
  mcall 37,2 ;get mouse buttons
4
  mcall 37,2 ;get mouse buttons
Line 4... Line 5...
4
 
5
 
Line 47... Line 48...
47
;input:
48
;input:
48
; eax -> (x,y)
49
; eax -> (x,y)
49
; edi -> óêàçàòåëü íà ñòðóêòóðó tedit
50
; edi -> óêàçàòåëü íà ñòðóêòóðó tedit
50
;description:
51
;description:
51
; ôóíêöèÿ âûçûâåòñÿ ïðè íàæàòèè êíîïêîé ìûøè è ïîïàäåíèè êóðñîðîì â îêíî ðåäàêòîðà
52
; ôóíêöèÿ âûçûâåòñÿ ïðè íàæàòèè êíîïêîé ìûøè è ïîïàäåíèè êóðñîðîì â îêíî ðåäàêòîðà
-
 
53
align 4
52
wnd_main_click:
54
wnd_main_click:
53
  push ecx edx
55
  push ecx edx
Line 54... Line 56...
54
 
56
 
55
  push eax
57
  push eax
Line 65... Line 67...
65
    cmp eax,[hScr.cur_area]
67
    cmp eax,[hScr.cur_area]
66
    jle @f
68
    jle @f
67
      mov eax,[hScr.cur_area]
69
      mov eax,[hScr.cur_area]
68
    @@:
70
    @@:
69
    ;dec eax
71
    ;dec eax
70
    mov [cur_x],eax
72
    mov ted_cur_x,eax
71
  pop eax
73
  pop eax
Line 72... Line 74...
72
 
74
 
73
  push eax
75
  push eax
74
    and eax,0xffff
76
    and eax,0xffff
Line 82... Line 84...
82
    cmp eax,[wScr.cur_area]
84
    cmp eax,[wScr.cur_area]
83
    jle @f
85
    jle @f
84
      mov eax,[wScr.cur_area]
86
      mov eax,[wScr.cur_area]
85
    @@:
87
    @@:
86
    dec eax
88
    dec eax
87
    mov [cur_y],eax
89
    mov ted_cur_y,eax
88
  pop eax
90
  pop eax
Line 89... Line 91...
89
 
91
 
90
  cmp ted_drag_m,0
92
  cmp ted_drag_m,0
91
  je @f
93
  je @f
92
    call SelMove
94
    stdcall SelMove,edi
93
    jmp .sel_move
95
    jmp .sel_move
94
  @@:
96
  @@:
95
    mov ted_drag_m,1
97
    mov ted_drag_m,1
96
    call SelStart
98
    stdcall SelStart,edi
97
  .sel_move:
99
  .sel_move:
98
  pop edx ecx
100
  pop edx ecx
Line -... Line 101...
-
 
101
  ret
99
  ret
102
 
100
 
103
align 4
101
wnd_main_mouse_scroll:
104
wnd_main_mouse_scroll:
102
  push eax ebx
105
  push eax ebx
103
  mcall 37,7
106
  mcall 37,7
Line 120... Line 123...
120
    stdcall draw_main_win, tedit0
123
    stdcall draw_main_win, tedit0
121
  .no_scroll:
124
  .no_scroll:
122
  pop ebx eax
125
  pop ebx eax
123
  ret
126
  ret
Line -... Line 127...
-
 
127
 
-
 
128
align 4
-
 
129
draw_but_toolbar: ;âíåøíÿÿ ôóíêöèÿ äëÿ ðèñîâàíèÿ ïàíåëè èíñòðóìåíòîâ
124
 
130
  push ebx ecx edx edi
Line 125... Line -...
125
draw_but_toolbar:
-
 
126
 
131
  mov edi,tedit0
127
  push ebx ecx edx
132
 
128
  mov ecx,0x40000000
133
  mov ecx,0x40000000
129
;  mov edx,5*65536+25
134
;  mov edx,5*65536+25
Line 130... Line 135...
130
  mov edx,85*65536+2
135
  mov edx,85*65536+2
131
  call draw_but_icon
136
  call draw_but_icon
132
 
137
 
133
  inc cx
138
  inc cx
Line 134... Line 139...
134
;  mov edx,30*65536+25
139
;  mov edx,30*65536+25
135
  mov edx,110*65536+2
140
  mov edx,110*65536+2
136
  call draw_but_icon
141
  call draw_but_icon
137
 
142
 
138
call CanSave
143
stdcall ted_can_save,edi
139
cmp al,1
144
cmp al,1
Line 148... Line 153...
148
 
153
 
149
  inc cx
154
  inc cx
150
  mov edx,85*65536+25
155
  mov edx,85*65536+25
Line 151... Line 156...
151
  call draw_but_icon
156
  call draw_but_icon
152
 
157
 
153
stdcall IsSel, tedit0
158
stdcall IsSel,edi
154
cmp al,0
159
cmp al,0
155
jne @f
160
jne @f
156
and ecx,0xffff
161
and ecx,0xffff
Line 195... Line 200...
195
 
200
 
196
  inc cx
201
  inc cx
197
  mov edx,235*65536+25
202
  mov edx,235*65536+25
Line 198... Line 203...
198
  call draw_but_icon
203
  call draw_but_icon
199
 
204
 
200
mov ebx,[tim_Undo]
205
mov ebx,ted_tim_undo
201
cmp [ch_tim],ebx
206
cmp ted_tim_ch,ebx
202
jg @f
207
jg @f
203
and ecx,0xffff
208
and ecx,0xffff
204
@@:
209
@@:
205
  mov cx,13
210
  mov cx,13
206
  mov edx,345*65536+25
211
  mov edx,345*65536+25
Line 207... Line 212...
207
  call draw_but_icon
212
  call draw_but_icon
208
or ecx,0x40000000
213
or ecx,0x40000000
209
 
214
 
210
cmp [tim_Undo],1
215
cmp ted_tim_undo,1
211
jge @f
216
jge @f
212
and ecx,0xffff
217
and ecx,0xffff
Line 226... Line 231...
226
 
231
 
227
  mov cx,17
232
  mov cx,17
228
  mov edx,450*65536+25
233
  mov edx,450*65536+25
Line 229... Line 234...
229
  call draw_but_icon
234
  call draw_but_icon
230
 
235
 
Line 231... Line 236...
231
  pop edx ecx ebx
236
  pop edi edx ecx ebx
232
  ret
237
  ret
-
 
238
 
233
 
239
;input:
234
;input:
240
;  clear_o - åñëè =1 î÷èñòèòü îäíó ñòðîêó, =0 î÷èñòèòü âñå ñòðîêè îêíà äî íèçó
235
;  clear_o - åñëè =1 î÷èñòèòü îäíó ñòðîêó, =0 î÷èñòèòü âñå ñòðîêè îêíà äî íèçó
241
align 4
236
proc clear_line_before_draw, edit:dword, coords:dword, clear_o:dword, numb_lin:dword
242
proc clear_line_before_draw, edit:dword, coords:dword, clear_o:dword, numb_lin:dword
237
  pushad
243
  pushad
Line 263... Line 269...
263
    xor bx,bx
269
    xor bx,bx
264
    add ebx,ted_wnd_w
270
    add ebx,ted_wnd_w
265
    sub ebx,ted_rec_l
271
    sub ebx,ted_rec_l
266
	xor cx,cx
272
	xor cx,cx
267
    add ecx,ted_rec_h
273
    add ecx,ted_rec_h
268
    mov edx,[WND_WORK_COLOR]
274
    mov edx,ted_color_wnd_work
Line 269... Line 275...
269
 
275
 
270
    cmp dword[clear_o],0
276
    cmp dword[clear_o],0
271
    je .pusto
277
    je .pusto
272
    cmp ax,cx
278
    cmp ax,cx
Line 276... Line 282...
276
    @@:
282
    @@:
Line 277... Line 283...
277
 
283
 
278
    stdcall IsSel,edi
284
    stdcall IsSel,edi
279
    cmp al,0
285
    cmp al,0
280
    je @f
286
    je @f
281
    cmp [seln.y0],esi
287
    cmp ted_seln_y0,esi
282
    jg @f
288
    jg @f
283
    cmp [seln.y1],esi
289
    cmp ted_seln_y1,esi
284
    jl @f
290
    jl @f
285
      mov edx,[SELECT_COLOR] ;draw selected line
291
      mov edx,ted_color_select ;draw selected line
Line 286... Line 292...
286
    @@:
292
    @@:
287
 
293
 
Line 293... Line 299...
293
    je .no_clear
299
    je .no_clear
Line 294... Line 300...
294
 
300
 
295
    mov al,13 ;rect
301
    mov al,13 ;rect
296
	xor cx,cx
302
	xor cx,cx
297
    add ecx,ted_rec_h
303
    add ecx,ted_rec_h
298
    cmp [seln.y0],esi
304
    cmp ted_seln_y0,esi
299
    jne @f
305
    jne @f
300
      push bx
306
      push bx
301
      mov edx,[seln.x0] ; âåðõíÿÿ ïîëîñà (çàòèðàåò ñëåâà)
307
      mov edx,ted_seln_x0 ; âåðõíÿÿ ïîëîñà (çàòèðàåò ñëåâà)
302
      cmp edx,[hScr.position]
308
      cmp edx,[hScr.position]
303
      jle .in_wnd
309
      jle .in_wnd
304
	sub edx,[hScr.position]
310
	sub edx,[hScr.position]
305
	imul edx,ted_rec_w
311
	imul edx,ted_rec_w
306
	mov bx,dx
312
	mov bx,dx
307
	jmp .no_wnd
313
	jmp .no_wnd
308
      .in_wnd:
314
      .in_wnd:
309
	mov bx,0
315
	mov bx,0
310
      .no_wnd:
316
      .no_wnd:
311
      mov edx,[WND_WORK_COLOR]
317
      mov edx,ted_color_wnd_work
312
      int 0x40
318
      int 0x40
313
      pop bx
319
      pop bx
314
    @@:
320
    @@:
315
    cmp [seln.y1],esi
321
    cmp ted_seln_y1,esi
316
    jne @f
322
    jne @f
317
      mov edx,[seln.x1] ; íèæíÿÿ ïîëîñà (çàòèðàåò ñïðàâà)
323
      mov edx,ted_seln_x1 ; íèæíÿÿ ïîëîñà (çàòèðàåò ñïðàâà)
318
      cmp edx,[hScr.position]
324
      cmp edx,[hScr.position]
319
      jle .in_wnd2
325
      jle .in_wnd2
320
	sub edx,[hScr.position]
326
	sub edx,[hScr.position]
321
	imul edx,ted_rec_w
327
	imul edx,ted_rec_w
322
	sub bx,dx
328
	sub bx,dx
323
	shl edx,16
329
	shl edx,16
324
	add ebx,edx
330
	add ebx,edx
Line 325... Line 331...
325
      .in_wnd2:
331
      .in_wnd2:
326
 
332
 
327
      mov edx,[WND_WORK_COLOR]
333
      mov edx,ted_color_wnd_work
Line 328... Line 334...
328
      int 0x40
334
      int 0x40
329
    @@:
335
    @@:
330
 
336
 
331
  .no_clear:
337
  .no_clear:
Line 332... Line 338...
332
  popad
338
  popad
333
  ret
339
  ret
334
endp
340
endp
335
 
341
 
336
 
342
align 4
337
proc draw_main_win, edit:dword
343
proc draw_main_win, edit:dword
338
  locals
344
  locals
Line 339... Line 345...
339
    line_num dd ?
345
    line_num dd ?
340
  endl
346
  endl
341
  pushad
347
  pushad
342
  mov edi,dword[edit]
-
 
Line 343... Line 348...
343
 
348
  mov edi,dword[edit]
344
  mov eax,4 ;draw text
349
 
345
  mov ecx,[tex_colors]
350
  mov eax,4 ;draw text
346
  push dword[ecx]
351
  mov ecx,ted_text_colors
347
  pop ecx
352
  mov ecx,dword[ecx]
348
 
353
 
Line 349... Line 354...
349
  mov ebx,ted_wnd_l
354
  mov ebx,ted_wnd_l
350
  add ebx,ted_rec_l
355
  add ebx,ted_rec_l
351
  shl ebx,16
356
  shl ebx,16
Line 352... Line 357...
352
  add ebx,ted_wnd_t
357
  add ebx,ted_wnd_t
353
  add ebx,ted_rec_t
358
  add ebx,ted_rec_t
354
  add ebx,0x10001 ;äîáàâëÿåì îòñòóïû äëÿ âûðàâíèâàíèÿ áóêâû ïî öåíòðó
359
  add ebx,0x10001 ;äîáàâëÿåì îòñòóïû äëÿ âûðàâíèâàíèÿ áóêâû ïî öåíòðó
355
 
360
 
356
  call SelNormalize ;need before draw select
361
  stdcall SelNormalize,edi ;need before draw select
357
  mov esi,[wScr.position]
362
  mov esi,[wScr.position]
358
  mov dword[line_num],esi
363
  mov dword[line_num],esi
359
 
364
 
360
  stdcall clear_line_before_draw, tedit0,ebx,1,esi
365
  stdcall clear_line_before_draw, edi,ebx,1,esi
Line 361... Line 366...
361
  call GetFirstVisiblePos
366
  call GetFirstVisiblePos
362
  cmp edx,0
367
  cmp edx,0
363
  je .no_draw_text
368
  je .no_draw_text
364
  mov esi,1 ;äëèííà âûâîäèìîãî òåêñòà ïî 1-ìó ñèìâîëó
369
  mov esi,1 ;äëèííà âûâîäèìîãî òåêñòà ïî 1-ìó ñèìâîëó
365
  @@:
370
  @@:
366
    call IteratNext
371
    call IteratNext
367
    cmp edx,[tex_1]
372
    cmp edx,ted_tex_1
Line 368... Line 373...
368
    jle .no_draw_text
373
    jle .no_draw_text
369
 
374
 
370
    ; *** öâåòîâàÿ ðàçìåòêà
375
    ; *** öâåòîâàÿ ðàçìåòêà
371
    cmp byte[mode_colored],0
376
    cmp ted_mode_color,0
372
    je .no_col_change
377
    je .no_col_change
-
 
378
    cmp byte[edx+1],0
373
    cmp byte[edx+1],0
379
    je .no_col_change
374
    je .no_col_change
380
      call GetSymbColor
375
      call GetSymbColor
381
    .no_col_change:
376
    .no_col_change:
382
 
377
 
383
    cmp byte [edx],13
378
    cmp byte [edx],13
384
    jne .no_13
Line 397... Line 403...
397
      add ebx,ted_wnd_l
403
      add ebx,ted_wnd_l
398
      add ebx,ted_rec_l
404
      add ebx,ted_rec_l
399
      inc ebx
405
      inc ebx
400
      ror ebx,16
406
      ror ebx,16
401
      inc dword[line_num] ;increment line number
407
      inc dword[line_num] ;increment line number
402
      stdcall clear_line_before_draw, tedit0,ebx,1,dword[line_num]
408
      stdcall clear_line_before_draw,edi,ebx,1,dword[line_num]
403
      call OptDrawLineLeft
409
      call OptDrawLineLeft
404
      jmp @b
410
      jmp @b
405
    .no_13:
411
    .no_13:
Line 406... Line 412...
406
 
412
 
Line 416... Line 422...
416
	mov si,1
422
	mov si,1
417
    ror ebx,16
423
    ror ebx,16
418
    jmp @b
424
    jmp @b
419
  .no_draw_text:
425
  .no_draw_text:
Line 420... Line 426...
420
 
426
 
421
  stdcall clear_line_before_draw, tedit0,ebx,0,dword[line_num]
427
  stdcall clear_line_before_draw,edi,ebx,0,dword[line_num]
422
  stdcall draw_line_numbers, tedit0
428
  stdcall draw_line_numbers,edi
Line 423... Line 429...
423
  stdcall draw_main_cursor, tedit0
429
  stdcall draw_main_cursor,edi
424
 
430
 
425
;---------------------------------------------
431
;---------------------------------------------
426
; set all_redraw flag for draw all ScrollBar
432
; set all_redraw flag for draw all ScrollBar
Line 470... Line 476...
470
 
476
 
471
;txtBUp db 24
477
;txtBUp db 24
472
;txtBDn db 25
478
;txtBDn db 25
473
;txtBRi db 26
479
;txtBRi db 26
-
 
480
;txtBLe db 27
474
;txtBLe db 27
481
align 4
475
proc draw_panel_find, edit:dword
482
proc draw_panel_find, edit:dword
476
  push edi
483
  push edi
Line 477... Line 484...
477
  mov edi,dword[edit]
484
  mov edi,dword[edit]
478
 
485
 
479
  cmp byte[panel_id],TE_PANEL_FIND ;if not panel
486
  cmp ted_panel_id,TE_PANEL_FIND ;if not panel
Line 480... Line 487...
480
  jne @f
487
  jne @f
481
  push eax ebx ecx edx
488
  push eax ebx ecx edx
Line 494... Line 501...
494
  mov ecx,[sc.work_text]
501
  mov ecx,[sc.work_text]
495
  or ecx,0x80000000
502
  or ecx,0x80000000
496
  mov edx,txtFindCapt
503
  mov edx,txtFindCapt
497
  int 0x40
504
  int 0x40
Line 498... Line -...
498
 
-
 
499
  push dword edit2
505
 
Line 500... Line 506...
500
  call [edit_box_draw]
506
  stdcall [edit_box_draw], dword edit2
501
 
507
 
502
  mov eax,13 ;ðèñîâàíèå ïðÿìîóãîëüíèêà
508
  mov eax,13 ;ðèñîâàíèå ïðÿìîóãîëüíèêà
503
  mov ebx,TE_PANEL_WIDTH
509
  mov ebx,TE_PANEL_WIDTH
Line 540... Line 546...
540
  .end_f:
546
  .end_f:
541
  pop edi
547
  pop edi
542
  ret
548
  ret
543
endp
549
endp
Line -... Line 550...
-
 
550
 
-
 
551
 
544
 
552
align 4
545
proc draw_panel_syntax, edit:dword
553
proc draw_panel_syntax, edit:dword
546
  push edi
554
  push edi
Line 547... Line 555...
547
  mov edi,dword[edit]
555
  mov edi,dword[edit]
548
 
556
 
549
  cmp byte[panel_id],TE_PANEL_SYNTAX ;if not panel
557
  cmp ted_panel_id,TE_PANEL_SYNTAX ;if not panel
Line 550... Line 558...
550
  jne @f
558
  jne @f
551
  push eax ebx ecx edx
559
  push eax ebx ecx edx
Line 556... Line 564...
556
  shl ecx,16
564
  shl ecx,16
557
  mov cx,20
565
  mov cx,20
558
  mov edx,[sc.work]
566
  mov edx,[sc.work]
559
  int 0x40 ;ðèñîâàíèå âåðõíåãî ôîíîâîãî ïðÿìîóãîëüíèêà
567
  int 0x40 ;ðèñîâàíèå âåðõíåãî ôîíîâîãî ïðÿìîóãîëüíèêà
Line 560... Line 568...
560
 
568
 
561
  stdcall dword[tl_draw], dword tree1
569
  stdcall dword[tl_draw], tree1
562
  mov [ws_dir_lbox.all_redraw],1 ;äëÿ ïîëíîé ïåðåðèñîâêè äî÷åðíåãî ñêðîëëèíãà
570
  mov [ws_dir_lbox.all_redraw],1 ;äëÿ ïîëíîé ïåðåðèñîâêè äî÷åðíåãî ñêðîëëèíãà
Line 563... Line 571...
563
  stdcall dword[scrollbar_ver_draw], dword ws_dir_lbox
571
  stdcall dword[scrollbar_ver_draw], dword ws_dir_lbox
564
 
572
 
Line 611... Line 619...
611
  .end_f:
619
  .end_f:
612
  pop edi
620
  pop edi
613
  ret
621
  ret
614
endp
622
endp
Line -... Line 623...
-
 
623
 
-
 
624
 
615
 
625
align 4
616
proc draw_cur_line, edit:dword
626
proc draw_cur_line, edit:dword
617
  pushad
627
  pushad
Line 618... Line 628...
618
    mov edi,dword[edit]
628
    mov edi,dword[edit]
619
 
629
 
620
    mov ebx,ted_wnd_l
630
    mov ebx,ted_wnd_l
621
    add ebx,ted_rec_l
631
    add ebx,ted_rec_l
622
    shl ebx,16
632
    shl ebx,16
623
    mov eax,[cur_y]
633
    mov eax,ted_cur_y
624
    imul eax,ted_rec_h
634
    imul eax,ted_rec_h
625
	mov bx,ax
635
	mov bx,ax
626
    add ebx,ted_wnd_t
636
    add ebx,ted_wnd_t
Line 627... Line 637...
627
    add ebx,ted_rec_t ;ebx - êîîðäèíàòû äëÿ ïðÿìîóãîëüíèêà î÷èñòêè ëèíèè
637
    add ebx,ted_rec_t ;ebx - êîîðäèíàòû äëÿ ïðÿìîóãîëüíèêà î÷èñòêè ëèíèè
628
	add ebx,0x10001   ;äîáàâëÿåì îòñòóïû äëÿ âûðàâíèâàíèÿ áóêâû ïî öåíòðó
638
	add ebx,0x10001   ;äîáàâëÿåì îòñòóïû äëÿ âûðàâíèâàíèÿ áóêâû ïî öåíòðó
629
 
639
 
630
    call SelNormalize ;need before draw select
640
    stdcall SelNormalize,edi ;need before draw select
Line 631... Line 641...
631
	mov ecx,[cur_y]
641
	mov ecx,ted_cur_y
632
    add ecx,[wScr.position]
642
    add ecx,[wScr.position]
Line 633... Line 643...
633
    stdcall clear_line_before_draw, tedit0, ebx,1,ecx
643
    stdcall clear_line_before_draw, tedit0, ebx,1,ecx
634
 
644
 
635
    mov esi,[hScr.position]
645
    mov esi,[hScr.position]
636
    call GetPosByParam
646
    call GetPosByParam
637
 
647
 
638
  cmp [gpOpt],2
648
  cmp ted_gp_opt,2
639
  jne .no_draw_text
649
  jne .no_draw_text
640
;  mov eax,4 ;draw text
650
;  mov eax,4 ;draw text
641
  call GetSymbColor
651
  call GetSymbColor
Line 642... Line 652...
642
  mov esi,1 ;draw 1 symbol
652
  mov esi,1 ;draw 1 symbol
643
  @@:
653
  @@:
644
    ;call IteratNext
654
    ;call IteratNext
645
    cmp edx,[tex_1]
655
    cmp edx,ted_tex_1
646
    jle .no_draw_text
656
    jle .no_draw_text
647
 
657
 
648
    ; *** öâåòîâàÿ ðàçìåòêà
658
    ; *** öâåòîâàÿ ðàçìåòêà
Line 649... Line 659...
649
    cmp byte[mode_colored],0
659
    cmp ted_mode_color,0
650
    je .no_col_change
660
    je .no_col_change
651
    cmp byte[edx+1],0
661
    cmp byte[edx+1],0
652
    je .no_col_change
662
    je .no_col_change
653
      call GetSymbColor
663
      call GetSymbColor
654
    .no_col_change:
664
    .no_col_change:
-
 
665
 
655
 
666
    mov eax,4 ;draw text
656
    mov eax,4 ;draw text
667
    cmp byte [edx],13
657
    cmp byte [edx],13
668
    jne .no_13
658
    jne .no_13
669
      cmp ted_mode_invis,1
659
      cmp [invis],1
670
      jne .no_draw_text
Line 675... Line 686...
675
    ror ebx,16
686
    ror ebx,16
676
    call IteratNext
687
    call IteratNext
677
    jmp @b
688
    jmp @b
678
  .no_draw_text:
689
  .no_draw_text:
Line 679... Line 690...
679
 
690
 
680
  stdcall draw_main_cursor, tedit0
691
  stdcall draw_main_cursor,edi
681
  popad
692
  popad
682
  ret
693
  ret
Line 683... Line 694...
683
endp
694
endp
684
 
695
 
685
MIN_M_WND_H equ 100
696
MIN_M_WND_H equ 100
-
 
697
MIN_W_SCRL_ARE equ 3
686
MIN_W_SCRL_ARE equ 3
698
MIN_H_SCRL_ARE equ 3
687
MIN_H_SCRL_ARE equ 3
699
align 4
688
proc EvSize, edit:dword
700
proc EvSize, edit:dword
Line 689... Line 701...
689
  push eax ecx edx edi
701
  push eax ecx edx edi
Line 757... Line 769...
757
  pop edi edx ecx eax
769
  pop edi edx ecx eax
758
  call OnInitialUpdate
770
  call OnInitialUpdate
759
  ret
771
  ret
760
endp
772
endp
Line -... Line 773...
-
 
773
 
761
 
774
align 4
762
OnInitialUpdate:
775
OnInitialUpdate:
763
  mov [wScr.redraw],1
776
  mov [wScr.redraw],1
764
  mov [hScr.redraw],1
777
  mov [hScr.redraw],1
Line -... Line 778...
-
 
778
  ret
-
 
779
 
765
  ret
780
;input:
-
 
781
; edi = pointer to tedit struct
766
 
782
;output:
767
;output:
783
; ecx = íîâûé öâåò ñèìâîëà
-
 
784
; edx = pointer to symbol
768
; edx = pointer to symbol
785
; edx = 0 if text not in screen
769
; edx = 0 if text not in screen
786
align 4
770
GetFirstVisiblePos:
787
GetFirstVisiblePos:
771
  push ecx
788
  push ecx
772
  mov edx,[tex]
789
  mov edx,ted_tex
773
  xor ecx,ecx
790
  xor ecx,ecx
774
  @@:
791
  @@:
775
    cmp ecx,[wScr.position]
792
    cmp ecx,[wScr.position]
776
    je @f
793
    je @f
777
    call IteratNext
794
    call IteratNext
778
    cmp edx,[tex_1]
795
    cmp edx,ted_tex_1
779
    jle @f
796
    jle @f
780
    cmp byte [edx],13
797
    cmp byte [edx],13
781
    jne @b
798
    jne @b
Line 797... Line 814...
797
 
814
 
798
 
815
 
-
 
816
 
799
 
817
;input:
800
;input:
818
; edx = pointer to symbol
-
 
819
; edi = pointer to tedit struct
-
 
820
;output:
801
; edx = pointer to symbol
821
; ecx = íîâûé öâåò ñèìâîëà
802
;output:
822
; edx = óêàçàòåëü íà ïåðâûé ëåâûé ñèìâîë
-
 
823
align 4
803
; edx = pointer to first left symbol
824
proc OptDrawLineLeft
804
OptDrawLineLeft:
825
  push ebx
805
  push ecx
826
 
806
  mov ecx,[hScr.position]
827
  mov ebx,[hScr.position]
807
  cmp ecx,0
828
  cmp ebx,0
Line 808... Line 829...
808
  je .ret_f
829
  je .ret_f
809
  push eax
830
  push eax
810
  mov eax,edx
831
  mov eax,edx
811
 
832
 
812
  cmp edx,[tex]
833
  cmp edx,ted_tex
Line 813... Line 834...
813
  jne @f
834
  jne @f
814
    call IteratNext
835
    call IteratNext
Line 815... Line 836...
815
    jmp .beg_cycle
836
    jmp .beg_cycle
816
  @@:
837
  @@:
817
 
838
 
818
  cmp ecx,0
839
  cmp ebx,0
819
  je @f
840
  je @f
820
 
841
 
821
  cmp byte[edx],13
842
  cmp byte[edx],13
822
  jne @f
843
  jne @f
823
    call IteratNext
844
    call IteratNext
824
    .beg_cycle:
845
    .beg_cycle:
825
  @@:
846
  @@:
-
 
847
    cmp edx,ted_tex_1
-
 
848
    jle @f
-
 
849
    cmp byte[edx],13
-
 
850
    je @f
-
 
851
    cmp ebx,0
-
 
852
    je @f
-
 
853
;--------------------------------------
-
 
854
xor eax,eax ;eax áóäåò ìåíÿòüñÿ
-
 
855
mov al,byte[edx+1]
-
 
856
cmp al,0
-
 
857
je .no_color
-
 
858
cmp eax,ted_colors_text_count
-
 
859
jge .no_color
-
 
860
  xor ecx,ecx
826
    cmp edx,[tex_1]
861
  mov cl,byte[edx+1]
827
    jle @f
862
  shl cx,2
828
    cmp byte[edx],13
863
  add ecx,ted_text_colors
829
    je @f
864
  mov ecx,dword[ecx]
830
    cmp ecx,0
865
.no_color:
831
    je @f
866
;--------------------------------------
832
    mov eax,edx
867
    mov eax,edx
833
    call IteratNext
868
    call IteratNext
834
    dec ecx
-
 
835
    jmp @b
869
    dec ebx
-
 
870
    jmp @b
836
  @@:
871
  @@:
-
 
872
    mov edx,eax
Line 837... Line 873...
837
    mov edx,eax
873
  pop eax
838
  pop eax
874
  .ret_f:
-
 
875
  call GetSymbColor
839
  .ret_f:
876
  pop ebx
840
  pop ecx
877
  ret
-
 
878
endp
841
  call GetSymbColor
879
 
842
  ret
880
;input:
843
 
881
; edx = pointer to symbol
844
;input:
882
; edi = pointer to tedit struct
845
; edx = pointer to symbol
883
;output:
846
;output:
884
; edx = pointer to 13 symbol
847
; edx = pointer to 13 symbol
885
align 4
848
OptDrawLineRight:
886
proc OptDrawLineRight
849
  push eax
887
  push eax
850
  mov eax,edx
888
  mov eax,edx
851
  @@:
889
  @@:
852
    cmp edx,[tex_1]
890
    cmp edx,ted_tex_1
853
    jle @f
891
    jle @f
854
    cmp byte[edx],13
-
 
855
    je @f
892
    cmp byte[edx],13
-
 
893
    je @f
-
 
894
    mov eax,edx
856
    mov eax,edx
895
    call IteratNext
-
 
896
    jmp @b
Line -... Line 897...
-
 
897
  @@:
857
    call IteratNext
898
  mov edx,eax ;perv sumbol
858
    jmp @b
899
  call GetSymbColor
859
  @@:
900
 
Line 860... Line 901...
860
  mov edx,eax ;perv sumbol
901
  pop eax
861
  pop eax
902
  ret
862
  call GetSymbColor
903
endp
863
  ret
904
 
864
 
905
align 4
865
proc draw_main_cursor, edit:dword
906
proc draw_main_cursor, edit:dword
Line 866... Line 907...
866
  pushad
907
  pushad
867
  mov edi,dword[edit]
908
  mov edi,dword[edit]
868
 
909
 
869
  mov eax,13 ;draw cursor
910
  mov eax,13 ;draw cursor
870
  mov ecx,ted_wnd_t ;calc rect -> y0,y1
911
  mov ecx,ted_wnd_t ;calc rect -> y0,y1
871
  add ecx,ted_rec_t
912
  add ecx,ted_rec_t
872
  mov edx,[cur_y]
913
  mov edx,ted_cur_y
873
  imul edx,ted_rec_h
914
  imul edx,ted_rec_h
874
  add ecx,edx
915
  add ecx,edx
875
 
916
 
876
  cmp [curMod],1 ;ïðîâåðêà ðåæèìà ðàáîòû êóðñîðà (îáû÷íûé èëè âñòàâêà)
917
  cmp ted_cur_ins,1 ;ïðîâåðêà ðåæèìà ðàáîòû êóðñîðà (îáû÷íûé èëè âñòàâêà)
877
  jne @f
918
  jne @f
878
    mov edx,ted_rec_h
919
    mov edx,ted_rec_h
Line 879... Line 920...
879
    inc edx   ;1->1, 3->2, 5->3, ...
920
    inc edx   ;1->1, 3->2, 5->3, ...
880
    shr edx,1 ;edx = âûñîòà ñòðîêè äåëåííàÿ íà 2 (êîãäà êóðñîð íå ïîëíûé)
921
    shr edx,1 ;edx = âûñîòà ñòðîêè äåëåííàÿ íà 2 (êîãäà êóðñîð íå ïîëíûé)
881
    add ecx,edx
922
    add ecx,edx
882
  @@:
923
  @@:
883
  shl ecx,16
924
  shl ecx,16
884
  add ecx,ted_rec_h
925
  add ecx,ted_rec_h
885
  cmp [curMod],1
926
  cmp ted_cur_ins,1
Line 886... Line 927...
886
  jne @f
927
  jne @f
887
    shr cx,1 ;äåëèì âûñîòó êóðñîðà íà 2
928
    shr cx,1 ;äåëèì âûñîòó êóðñîðà íà 2
Line 888... Line 929...
888
  @@:
929
  @@:
889
 
930
 
890
  mov ebx,ted_wnd_l ;calc rect -> x0,x1
931
  mov ebx,ted_wnd_l ;calc rect -> x0,x1
891
  add ebx,ted_rec_l
932
  add ebx,ted_rec_l
892
  mov edx,[cur_x]
933
  mov edx,ted_cur_x
893
  imul edx,ted_rec_w
934
  imul edx,ted_rec_w
894
  add ebx,edx
935
  add ebx,edx
895
  shl ebx,16
936
  shl ebx,16
896
  add ebx,ted_rec_w
937
  add ebx,ted_rec_w
897
 
938
 
898
  mov edx,[CURSOR_COLOR]
939
  mov edx,ted_color_cursor
899
  int 0x40 ;âûâîä êóðñîðà
940
  int 0x40 ;âûâîä êóðñîðà
900
 
941
 
901
  call GetPos
942
  call GetPos
902
  cmp [gpOpt],2
943
  cmp ted_gp_opt,2
903
  jne @f
944
  jne @f
904
    mov eax,4 ;draw text
945
    mov eax,4 ;draw text
905
    mov esi,1
946
    mov esi,1
906
    ror ecx,16
947
    ror ecx,16
Line 907... Line 948...
907
    mov bx,cx
948
    mov bx,cx
908
    add ebx,0x10001
949
    add ebx,0x10001
909
    cmp [curMod],1
950
    cmp ted_cur_ins,1
910
    jne .no_up_tetx
951
    jne .no_up_tetx
911
      mov ecx,ted_rec_h
952
      mov ecx,ted_rec_h
912
      inc cx ; 1->1, 3->2, 5->3, ...
953
      inc cx ; 1->1, 3->2, 5->3, ...
913
      shr cx,1
954
      shr cx,1
914
      sub bx,cx
955
      sub bx,cx
915
    .no_up_tetx:
956
    .no_up_tetx:
916
    mov ecx,[CUR_TEXT_COLOR]
957
    mov ecx,ted_color_cur_text
Line 917... Line 958...
917
    call ConvertInvisSymb
958
    call ConvertInvisSymb
918
    int 0x40
959
    int 0x40
919
  @@:
960
  @@:
Line 920... Line 961...
920
 
961
 
921
  mov eax,4
962
  mov eax,4
922
  mov ebx,ted_wnd_l
963
  mov ebx,ted_wnd_l
923
  add ebx,ted_rec_l
964
  add ebx,ted_rec_l
924
  shl ebx,16
965
  shl ebx,16
925
  add ebx,ted_wnd_t
966
  add ebx,ted_wnd_t
926
  add ebx,3
967
  add ebx,3
Line 927... Line 968...
927
  mov ecx,[WND_BORD_COLOR]
968
  mov ecx,ted_color_wnd_bord
928
  or  ecx,0x80000000
969
  or  ecx,0x80000000
Line 929... Line 970...
929
  mov edx,txtRow
970
  mov edx,txtRow
930
  int 0x40 ;âûâîä ïîäïèñè 'Ñòðîêà'
971
  int 0x40 ;âûâîä ïîäïèñè 'Ñòðîêà'
931
 
972
 
Line 932... Line 973...
932
  add ebx,0x500000
973
  add ebx,0x500000
933
  mov edx,txtCol
974
  mov edx,txtCol
934
  int 0x40 ;âûâîä ïîäïèñè 'Çíàê'
975
  int 0x40 ;âûâîä ïîäïèñè 'Çíàê'
935
 
976
 
936
  cmp [tim_Undo],0
977
  cmp ted_tim_undo,0
937
  je @f
978
  je @f
938
    add ebx,0x500000
979
    add ebx,0x500000
939
    mov edx,txtOtm
980
    mov edx,txtOtm
940
    int 0x40
981
    int 0x40
941
    sub ebx,0x500000
-
 
-
 
982
    sub ebx,0x500000
-
 
983
  @@:
942
  @@:
984
 
-
 
985
  stdcall draw_bufer,edi
943
 
986
  stdcall draw_help_f1
Line 944... Line 987...
944
  stdcall draw_bufer, edi
987
 
945
  stdcall draw_help_f1, edi
988
  mov eax,47 ;draw cursor coords
946
 
989
  mov esi,ted_color_wnd_bord
947
  mov eax,47 ;draw cursor coords
990
  or  esi,0x40000000
948
  mov esi,[WND_BORD_COLOR]
991
 
949
  or  esi,0x40000000
992
  mov edx,ebx
-
 
993
  ror edx,16
-
 
994
  sub edx,35
-
 
995
  ror edx,16
Line 950... Line 996...
950
 
996
  ;add edx,3
951
  mov edx,ebx
997
  mov ebx,0x40000 ;Row=...
952
  ror edx,16
998
  mov ecx,ted_cur_y
953
  sub edx,35
999
  inc ecx
954
  ror edx,16
1000
  add ecx,[wScr.position]
955
  ;add edx,3
1001
 
Line 956... Line 1002...
956
  mov ebx,0x40000 ;Row=...
1002
push edi
957
  mov ecx,[cur_y]
1003
  mov edi,ted_color_wnd_work
958
  inc ecx
1004
  int 0x40 ;âûâîä ÷èñëà òåêóùåé ñòðîêè
Line -... Line 1005...
-
 
1005
pop edi
959
  add ecx,[wScr.position]
1006
 
960
; edi <> tedit ----------------------------------------------------------------
1007
  ;mov ebx,0x40000 ;Col=...
961
  mov edi,[WND_WORK_COLOR]
1008
  mov ecx,ted_cur_x
Line 962... Line 1009...
962
  int 0x40
1009
  inc ecx
Line 989... Line 1036...
989
    add ebx,ted_rec_l
1036
    add ebx,ted_rec_l
990
  add bx,250
1037
  add bx,250
991
    shl ebx,16
1038
    shl ebx,16
992
    add ebx,ted_wnd_t
1039
    add ebx,ted_wnd_t
993
    add ebx,3
1040
    add ebx,3
994
    mov ecx,[WND_BORD_COLOR]
1041
    mov ecx,ted_color_wnd_bord
995
    or	ecx,0x40000000
1042
    or	ecx,0x40000000
996
    mov edi,[WND_WORK_COLOR]
1043
    mov edi,ted_color_wnd_work
Line 997... Line 1044...
997
    
1044
    
998
    mov edx,txtBuf
1045
    mov edx,txtBuf
999
    mov esi,buf
1046
    mov esi,buf
1000
    call strlen
1047
    call strlen
Line 1018... Line 1065...
1018
  @@:
1065
  @@:
1019
  popad
1066
  popad
1020
  ret
1067
  ret
1021
endp
1068
endp
Line -... Line 1069...
-
 
1069
 
-
 
1070
;input:
-
 
1071
; edi = pointer to tedit struct
1022
 
1072
align 4
1023
proc draw_help_f1, edit:dword
1073
proc draw_help_f1
1024
  pushad
-
 
Line 1025... Line 1074...
1025
  mov edi,dword[edit]
1074
  pushad
1026
 
1075
 
1027
  mov eax,13 ;clear place before draw help
1076
  mov eax,13 ;clear place before draw help
1028
  mov ebx,ted_wnd_l
1077
  mov ebx,ted_wnd_l
Line 1032... Line 1081...
1032
  sub ebx,ted_rec_l
1081
  sub ebx,ted_rec_l
1033
  mov ecx,ted_wnd_t
1082
  mov ecx,ted_wnd_t
1034
  add ecx,13
1083
  add ecx,13
1035
  shl ecx,16
1084
  shl ecx,16
1036
  add ecx,ted_rec_h
1085
  add ecx,ted_rec_h
1037
  mov edx,[WND_CAPT_COLOR]
1086
  mov edx,ted_color_wnd_capt
1038
  int 0x40
1087
  int 0x40
Line 1039... Line 1088...
1039
 
1088
 
1040
  cmp [help_id],-1
1089
  cmp ted_help_id,-1
1041
  je @f
1090
  je @f
1042
    mov eax,[help_id]
1091
    mov eax,ted_help_id
Line 1043... Line 1092...
1043
    ColToIndexOffset eax,edx
1092
    ColToIndexOffset eax,edx
1044
 
1093
 
1045
    ;SetCoordinates
1094
    ;SetCoordinates
Line 1051... Line 1100...
1051
 
1100
 
1052
    ;SetTextColor
1101
    ;SetTextColor
1053
    xor eax,eax
1102
    xor eax,eax
1054
    mov al,byte[edx+MAX_COLOR_WORD_LEN+6]
1103
    mov al,byte[edx+MAX_COLOR_WORD_LEN+6]
1055
    shl ax,2
1104
    shl ax,2
1056
    mov ecx,[tex_colors]
1105
    mov ecx,ted_text_colors
1057
    add ecx,eax
1106
    add ecx,eax
1058
    push dword[ecx]
-
 
1059
    pop ecx
1107
    mov ecx,dword[ecx]
-
 
1108
    or	ecx,0xc0000000 ;SetTextStyles
1060
    or	ecx,0xc0000000 ;SetTextStyles
1109
	mov esi,edi
1061
    mov edi,[WND_WORK_COLOR]
-
 
1062
; edi <> edit -----------------------------------------------------------------
1110
      mov edi,ted_color_wnd_work
1063
    mov eax,4
1111
      mov eax,4
-
 
1112
      int 0x40
Line 1064... Line 1113...
1064
    int 0x40
1113
    mov edi,esi
1065
 
1114
 
1066
    ;*** draw help string ***
1115
    ;*** draw help string ***
1067
    mov ecx,[WND_BORD_COLOR]
1116
    mov ecx,ted_color_wnd_bord
1068
    or ecx,0x80000000
1117
    or ecx,0x80000000
1069
    mov edi,dword[edx+MAX_COLOR_WORD_LEN]
1118
    mov edx,dword[edx+MAX_COLOR_WORD_LEN]
1070
    cmp edi,0
1119
    cmp edx,0
1071
    je @f
-
 
1072
      add edi,dword[tex_help_f1]
1120
    je @f
1073
      mov edx,edi
1121
      add edx,ted_help_text_f1
1074
      add ebx,0x500000
1122
      add ebx,0x500000
1075
      int 0x40
1123
      int 0x40
1076
  @@:
1124
  @@:
1077
  popad
1125
  popad
Line -... Line 1126...
-
 
1126
  ret
1078
  ret
1127
endp
1079
endp
1128
 
1080
 
1129
align 4
Line 1081... Line 1130...
1081
proc draw_line_numbers, edit:dword
1130
proc draw_line_numbers, edit:dword
1082
  pushad
1131
  pushad
1083
  mov edi,dword[edit]
1132
  mov edi,dword[edit]
1084
 
1133
 
1085
  ;top panel with caption
1134
  ;top panel with caption
1086
  mov ebx,ted_wnd_l
1135
  mov ebx,ted_wnd_l
1087
;  add ebx,ted_rec_l
1136
;  add ebx,ted_rec_l
1088
  shl ebx,16
1137
  shl ebx,16
1089
  add ebx,ted_wnd_w
1138
  add ebx,ted_wnd_w
1090
;  sub ebx,ted_rec_l
1139
;  sub ebx,ted_rec_l
1091
  mov edx,[WND_WORK_COLOR]
1140
  mov edx,ted_color_wnd_work
1092
  mov ecx,ted_wnd_t
1141
  mov ecx,ted_wnd_t
1093
  shl ecx,16
1142
  shl ecx,16
Line 1094... Line 1143...
1094
  add ecx,ted_rec_t
1143
  add ecx,ted_rec_t
1095
  mov eax,13
1144
  mov eax,13
1096
  mov edx,[WND_CAPT_COLOR]
1145
  mov edx,ted_color_wnd_capt
Line 1115... Line 1164...
1115
  mov ecx,ted_rec_h
1164
  mov ecx,ted_rec_h
1116
  rol ecx,16
1165
  rol ecx,16
1117
  mov cx,dx
1166
  mov cx,dx
1118
  rol ecx,16
1167
  rol ecx,16
1119
  mov eax,13
1168
  mov eax,13
1120
  mov edx,[WND_CAPT_COLOR]
1169
  mov edx,ted_color_wnd_capt
1121
  int 0x40 ;ðèñóåì ïðÿìîóãîëüíèê ïîä íîìåðîì ñòðîêè
1170
  int 0x40 ;ðèñóåì ïðÿìîóãîëüíèê ïîä íîìåðîì ñòðîêè
1122
pop edx ecx ebx
1171
pop edx ecx ebx
Line 1123... Line 1172...
1123
 
1172
 
1124
    mov eax,47
1173
    mov eax,47
1125
    mov esi,[WND_BORD_COLOR]
1174
    mov esi,ted_color_wnd_bord
1126
    int 0x40 ;ðèñóåì íîìåð ñòðîêè
1175
    int 0x40 ;ðèñóåì íîìåð ñòðîêè
1127
    inc ecx
1176
    inc ecx
1128
    add edx,ted_rec_h
1177
    add edx,ted_rec_h
1129
    sub edx,ted_wnd_t
1178
    sub edx,ted_wnd_t
Line 1138... Line 1187...
1138
  popad
1187
  popad
1139
  ret
1188
  ret
1140
endp
1189
endp
Line 1141... Line 1190...
1141
  
1190
  
-
 
1191
;this function need to optimize output
1142
;this function need to optimize output
1192
align 4
1143
proc draw_cursor_sumb, edit:dword
1193
proc draw_cursor_sumb, edit:dword
1144
  push eax ecx edx edi
1194
  push eax ecx edx edi
Line 1145... Line 1195...
1145
  mov edi,dword[edit]
1195
  mov edi,dword[edit]
1146
 
1196
 
1147
  mov eax,13 ;rect
1197
  mov eax,13 ;rect
1148
  mov ebx,ted_wnd_l
1198
  mov ebx,ted_wnd_l
1149
  add ebx,ted_rec_l
1199
  add ebx,ted_rec_l
1150
  mov edx,[cur_x]
1200
  mov edx,ted_cur_x
1151
  imul edx,ted_rec_w
1201
  imul edx,ted_rec_w
1152
  add ebx,edx
1202
  add ebx,edx
Line 1153... Line 1203...
1153
  shl ebx,16
1203
  shl ebx,16
1154
  add ebx,ted_rec_w
1204
  add ebx,ted_rec_w
1155
 
1205
 
1156
  mov ecx,ted_wnd_t ;calc rect -> y0,y1
1206
  mov ecx,ted_wnd_t ;calc rect -> y0,y1
1157
  add ecx,ted_rec_t
1207
  add ecx,ted_rec_t
1158
  mov edx,[cur_y]
1208
  mov edx,ted_cur_y
1159
  imul edx,ted_rec_h
1209
  imul edx,ted_rec_h
Line 1160... Line 1210...
1160
  add ecx,edx
1210
  add ecx,edx
1161
  shl ecx,16
1211
  shl ecx,16
1162
  add ecx,ted_rec_h
1212
  add ecx,ted_rec_h
Line 1163... Line 1213...
1163
 
1213
 
1164
  mov edx,[WND_WORK_COLOR]
1214
  mov edx,ted_color_wnd_work
1165
  push ecx
1215
  push ecx
Line 1166... Line 1216...
1166
    call SelNormalize
1216
    stdcall SelNormalize,edi
1167
 
1217
 
1168
    mov ecx,[wScr.position]
1218
    mov ecx,[wScr.position]
1169
    sub [seln.y0],ecx
1219
    sub ted_seln_y0,ecx
1170
    sub [seln.y1],ecx
1220
    sub ted_seln_y1,ecx
1171
 
1221
 
Line 1172... Line 1222...
1172
    mov ecx,[cur_y]
1222
    mov ecx,ted_cur_y
1173
    cmp ecx,[seln.y0]
1223
    cmp ecx,ted_seln_y0
1174
    jl .no_cur_sel
1224
    jl .no_cur_sel
1175
    cmp ecx,[seln.y1]
1225
    cmp ecx,ted_seln_y1
1176
    jg .no_cur_sel
1226
    jg .no_cur_sel
1177
    mov edx,[SELECT_COLOR]
1227
    mov edx,ted_color_select
1178
    
1228
    
1179
    cmp ecx,[seln.y0]
1229
    cmp ecx,ted_seln_y0
Line 1180... Line 1230...
1180
    jne @f
1230
    jne @f
1181
      mov ecx,[cur_x]
1231
      mov ecx,ted_cur_x
1182
      add ecx,[hScr.position]
1232
      add ecx,[hScr.position]
1183
      cmp ecx,[seln.x0]
1233
      cmp ecx,ted_seln_x0
1184
      jge @f
1234
      jge @f
1185
	mov edx,[WND_WORK_COLOR]
1235
	mov edx,ted_color_wnd_work
1186
    @@:
1236
    @@:
1187
 
1237
 
Line 1188... Line 1238...
1188
    mov ecx,[cur_y]
1238
    mov ecx,ted_cur_y
1189
    cmp ecx,[seln.y1]
1239
    cmp ecx,ted_seln_y1
1190
    jne .no_cur_sel
1240
    jne .no_cur_sel
Line 1191... Line 1241...
1191
      mov ecx,[cur_x]
1241
      mov ecx,ted_cur_x
1192
      add ecx,[hScr.position]
1242
      add ecx,[hScr.position]
1193
      cmp ecx,[seln.x1]
1243
      cmp ecx,ted_seln_x1
1194
      jl .no_cur_sel
1244
      jl .no_cur_sel
1195
      mov edx,[WND_WORK_COLOR]
1245
      mov edx,ted_color_wnd_work
1196
 
1246
 
1197
    .no_cur_sel:
1247
    .no_cur_sel:
1198
  pop ecx
1248
  pop ecx
1199
  int 0x40
1249
  int 0x40
1200
 
-
 
1201
  call GetPos
1250
 
1202
  cmp [gpOpt],2
1251
  call GetPos
1203
  jne @f
1252
  cmp ted_gp_opt,2
1204
    push esi
1253
  jne @f
1205
    mov eax,4 ;draw text
1254
    push esi
Line 1218... Line 1267...
1218
  ret
1267
  ret
1219
endp
1268
endp
Line 1220... Line 1269...
1220
 
1269
 
1221
 
1270
 
-
 
1271
;input:
1222
;input:
1272
; edx -> pointer to text
1223
; edx = pointer to text
1273
; edi -> óêàçàòåëü íà ñòðóêòóðó tedit
1224
;output:
1274
;output:
-
 
1275
; ecx = color
1225
; ecx = color
1276
; if ted_mode_color=0 then ecx=ted_color_wnd_text
1226
; if mode_colored=0 then ecx=WND_TEXT_COLOR
1277
align 4
Line 1227... Line 1278...
1227
GetSymbColor:
1278
GetSymbColor:
1228
  mov ecx,[WND_TEXT_COLOR]
1279
  mov ecx,ted_color_wnd_text ;çàäàåì öâåò òåêñòà ïî óìîë÷àíèþ
1229
 
1280
 
1230
  push eax edx
1281
  push eax edx
1231
  cmp byte[mode_colored],0
1282
  cmp ted_mode_color,0
1232
  je .exit
1283
  je .exit
1233
    jmp .on_first
1284
    jmp .on_first
1234
    @@:
1285
    @@:
1235
      call IteratPerv
1286
      call IteratPerv
1236
      cmp edx,[tex_1]
1287
      cmp edx,ted_tex_1
1237
      jle .exit
1288
      jle .exit
1238
    .on_first:
1289
    .on_first:
1239
      xor eax,eax
1290
      xor eax,eax
Line 1240... Line -...
1240
      mov al,byte[edx+1]
-
 
1241
      cmp al,0
-
 
1242
    je @b
1291
      mov al,byte[edx+1]
1243
 
1292
      cmp al,0 ;åñëè al=0 òî öâåò íå ìåíÿåòñÿ
Line 1244... Line 1293...
1244
    ;cmp al,0xff
1293
    je @b
1245
    ;je .exit
1294
 
1246
    cmp eax,[ColColor]
1295
    cmp eax,ted_colors_text_count
1247
    jge .exit
1296
    jge .exit
1248
 
-
 
1249
    shl ax,2 ;*4
1297
 
1250
    mov ecx,[tex_colors]
1298
    shl ax,2 ;óìíîæàåì èíäåêñ öâåòà íà 4 áàéòà
1251
    add ecx,eax
1299
    mov ecx,ted_text_colors ;ïðèáàâëÿåì ñìåùåíèå 1-ãî öâåòà
Line 1252... Line 1300...
1252
    push dword[ecx]
1300
    add ecx,eax
1253
    pop ecx
1301
    mov ecx,dword[ecx] ;óñòàíàâëèâàåì òåêóùèé öâåò òåêñòà ïî ñìåùåíèþ
-
 
1302
  .exit:
-
 
1303
  pop edx eax
1254
  .exit:
1304
  ret
1255
  pop edx eax
1305
 
1256
  ret
1306
;input:
1257
 
1307
; edx = pointer to text
1258
;input:
1308
; edi = pointer to tedit struct
-
 
1309
align 4
1259
; edx = pointer to text
1310
ConvertInvisSymb:
1260
ConvertInvisSymb:
1311
  cmp ted_mode_invis,1
1261
  cmp [invis],1
1312
  jne @f
Line 1262... Line 1313...
1262
  jne @f
1313
  cmp byte [edx],13
1263
  cmp byte [edx],13
1314
  jne @f
1264
  jne @f
1315
    mov edx,edi
1265
    mov edx,symbol_new_line
1316
	add edx,ted_offs_symbol_new_line
-
 
1317
  @@:
1266
  @@:
1318
  ret
1267
  ret
1319
 
Line 1268... Line 1320...
1268
 
1320
;input:
1269
;input:
1321
;  ecx = 0x4000____