Subversion Repositories Kolibri OS

Rev

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

Rev 1456 Rev 1457
Line 1... Line 1...
1
align 4
1
align 4
2
proc mouse_wnd_main, edit:dword
-
 
3
  push eax ebx ecx edi
-
 
4
  mcall 37,2 ;get mouse buttons
-
 
5
 
-
 
6
  mov edi,dword[edit]
-
 
7
 
-
 
8
  cmp al,1
-
 
9
  jne @f
-
 
10
    mcall 37,1 ;get mouse coords
-
 
11
    mov ebx,ted_wnd_t
-
 
12
    add ebx,ted_rec_t
-
 
13
    cmp ax,bx
-
 
14
    jl @f ;y_mouse
-
 
15
 
-
 
16
    sub ebx,ted_rec_t
-
 
17
    add ebx,ted_wnd_h
-
 
18
    cmp bx,ax
-
 
19
    jl @f ;y_mouse>y_wnd
-
 
20
 
-
 
21
    mov ebx,ted_wnd_l
-
 
22
    add ebx,ted_rec_l
-
 
23
    mov ecx,eax
-
 
24
    shr ecx,16
-
 
25
    cmp cx,bx
-
 
26
    jl @f ;x_mouse
-
 
27
 
-
 
28
    sub ebx,ted_rec_l
-
 
29
    add ebx,ted_wnd_w
-
 
30
    cmp bx,cx
-
 
31
    jl @f ;x_mouse>x_wnd
-
 
32
 
-
 
33
    stdcall draw_cursor_sumb, tedit0
-
 
34
    call wnd_main_click
-
 
35
    jmp .no_in_wnd
-
 
36
  @@:
-
 
37
    call wnd_main_mouse_scroll
-
 
38
    cmp ted_drag_m,0
-
 
39
    je .no_in_wnd
-
 
40
      mov ted_drag_m,0
-
 
41
      call draw_but_toolbar
-
 
42
      stdcall draw_main_win, tedit0
-
 
43
  .no_in_wnd:
-
 
44
  pop edi ecx ebx eax
-
 
45
  ret
-
 
46
endp
-
 
47
 
-
 
48
;input:
-
 
49
; eax -> (x,y)
-
 
50
; edi -> óêàçàòåëü íà ñòðóêòóðó tedit
-
 
51
;description:
-
 
52
; ôóíêöèÿ âûçûâåòñÿ ïðè íàæàòèè êíîïêîé ìûøè è ïîïàäåíèè êóðñîðîì â îêíî ðåäàêòîðà
-
 
53
align 4
-
 
54
wnd_main_click:
-
 
55
  push ecx edx
-
 
56
 
-
 
57
  push eax
-
 
58
    shr eax,16
-
 
59
    and eax,0xffff
-
 
60
    sub eax,ted_wnd_l
-
 
61
    sub eax,ted_rec_l
-
 
62
 
-
 
63
    xor edx,edx
-
 
64
    mov ecx,ted_rec_w
-
 
65
    div cx
-
 
66
    ;inc eax
-
 
67
    cmp eax,[hScr.cur_area]
-
 
68
    jle @f
-
 
69
      mov eax,[hScr.cur_area]
-
 
70
    @@:
-
 
71
    ;dec eax
-
 
72
    mov ted_cur_x,eax
-
 
73
  pop eax
-
 
74
 
-
 
75
  push eax
-
 
76
    and eax,0xffff
-
 
77
    sub eax,ted_wnd_t
-
 
78
    sub eax,ted_rec_t
-
 
79
 
-
 
80
    xor edx,edx
-
 
81
    mov ecx,ted_rec_h
-
 
82
    div cx
-
 
83
    inc eax
-
 
84
    cmp eax,[wScr.cur_area]
-
 
85
    jle @f
-
 
86
      mov eax,[wScr.cur_area]
-
 
87
    @@:
-
 
88
    dec eax
-
 
89
    mov ted_cur_y,eax
-
 
90
  pop eax
-
 
91
 
-
 
92
  cmp ted_drag_m,0
-
 
93
  je @f
-
 
94
    stdcall SelMove,edi
-
 
95
    jmp .sel_move
-
 
96
  @@:
-
 
97
    mov ted_drag_m,1
-
 
98
    stdcall SelStart,edi
-
 
99
  .sel_move:
-
 
100
  pop edx ecx
-
 
101
  ret
-
 
102
 
-
 
103
align 4
-
 
104
wnd_main_mouse_scroll:
-
 
105
  push eax ebx
-
 
106
  mcall 37,7
-
 
107
  cmp ax,0
-
 
108
  je .no_scroll
-
 
109
    mov ebx,dword[wScr.position] ;copy old scroll position
-
 
110
    and eax,0xffff
-
 
111
    btr ax,15
-
 
112
    jae @f
-
 
113
      or eax,0xffff8000
-
 
114
    @@:
-
 
115
    add dword[wScr.position],eax
-
 
116
 
-
 
117
    mov eax,[wScr.position]
-
 
118
    cmp eax,[wScr.max_area]
-
 
119
    jb @f
-
 
120
      mov dword[wScr.position],ebx ;if scroll position out of range
-
 
121
      jmp .no_scroll
-
 
122
    @@:
-
 
123
    stdcall draw_main_win, tedit0
-
 
124
  .no_scroll:
-
 
125
  pop ebx eax
-
 
126
  ret
-
 
127
 
-
 
128
align 4
-
 
129
draw_but_toolbar: ;âíåøíÿÿ ôóíêöèÿ äëÿ ðèñîâàíèÿ ïàíåëè èíñòðóìåíòîâ
2
draw_but_toolbar: ;ôóíêöèÿ äëÿ ðèñîâàíèÿ ïàíåëè èíñòðóìåíòîâ
130
  push ebx ecx edx edi
3
  pushad
131
  mov edi,tedit0
4
  mov edi,tedit0
Line 132... Line 5...
132
 
5
 
133
  mov ecx,0x40000000
6
  mov ecx,0x40000000
134
;  mov edx,5*65536+25
7
;  mov edx,5*65536+25
Line 138... Line 11...
138
  inc cx
11
  inc cx
139
;  mov edx,30*65536+25
12
;  mov edx,30*65536+25
140
  mov edx,110*65536+2
13
  mov edx,110*65536+2
141
  call draw_but_icon
14
  call draw_but_icon
Line 142... Line 15...
142
 
15
 
143
stdcall ted_can_save,edi
16
stdcall [ted_can_save],edi
144
cmp al,1
17
cmp al,1
145
je @f
18
je @f
146
and ecx,0xffff
19
and ecx,0xffff
147
@@:
20
@@:
Line 153... Line 26...
153
 
26
 
154
  inc cx
27
  inc cx
155
  mov edx,85*65536+25
28
  mov edx,85*65536+25
Line 156... Line 29...
156
  call draw_but_icon
29
  call draw_but_icon
157
 
30
 
158
stdcall IsSel,edi
31
call [ted_is_select]
159
cmp al,0
32
cmp al,0
160
jne @f
33
jne @f
161
and ecx,0xffff
34
and ecx,0xffff
Line 174... Line 47...
174
 
47
 
175
  inc cx ; Lower
48
  inc cx ; Lower
176
  mov edx,290*65536+25
49
  mov edx,290*65536+25
Line 177... Line 50...
177
  call draw_but_icon
50
  call draw_but_icon
178
 
51
 
179
  inc cx ; Reverse
52
  inc cx ; reverse
180
  mov edx,315*65536+25
53
  mov edx,315*65536+25
Line 181... Line 54...
181
  call draw_but_icon
54
  call draw_but_icon
Line 231... Line 104...
231
 
104
 
232
  mov cx,17
105
  mov cx,17
233
  mov edx,450*65536+25
106
  mov edx,450*65536+25
Line 234... Line -...
234
  call draw_but_icon
-
 
235
 
-
 
236
  pop edi edx ecx ebx
-
 
237
  ret
-
 
238
 
-
 
239
;input:
-
 
240
;  clear_o - åñëè =1 î÷èñòèòü îäíó ñòðîêó, =0 î÷èñòèòü âñå ñòðîêè îêíà äî íèçó
-
 
241
align 4
-
 
242
proc clear_line_before_draw, edit:dword, coords:dword, clear_o:dword, numb_lin:dword
-
 
243
  pushad
-
 
244
    mov edi,dword[edit]
-
 
245
    mov ebx,dword[coords]   ;ebx = x*2^16+y coords to left up point clear line
-
 
246
    mov esi,dword[numb_lin] ;esi - number text line
-
 
247
 
-
 
248
    sub ebx,0x10001 ;îòíèìàåì îòñòóïû äëÿ âûðàâíèâàíèÿ áóêâû ïî öåíòðó
-
 
249
    cmp dword[clear_o],0
-
 
250
    jne @f
-
 
251
      add ebx,ted_rec_h
-
 
252
      inc esi
-
 
253
      ror ebx,16
-
 
254
	  xor bx,bx
-
 
255
      add ebx,ted_wnd_l
-
 
256
      add ebx,ted_rec_l ;bx = ted_wnd_l+ted_rec_l
-
 
257
      ror ebx,16
-
 
258
    @@:
-
 
259
 
-
 
260
    mov eax,ted_wnd_h
-
 
261
    add eax,ted_wnd_t
-
 
262
    cmp ax,bx
-
 
263
    jl .no_clear
-
 
264
    sub ax,bx
-
 
265
 
-
 
266
    mov cx,bx
-
 
267
    shl ecx,16
-
 
268
 
-
 
269
    xor bx,bx
-
 
270
    add ebx,ted_wnd_w
-
 
271
    sub ebx,ted_rec_l
-
 
272
	xor cx,cx
-
 
273
    add ecx,ted_rec_h
-
 
274
    mov edx,ted_color_wnd_work
-
 
275
 
-
 
276
    cmp dword[clear_o],0
-
 
277
    je .pusto
-
 
278
    cmp ax,cx
-
 
279
    jge @f
-
 
280
      .pusto:
-
 
281
      mov cx,ax
-
 
282
    @@:
-
 
283
 
-
 
284
    stdcall IsSel,edi
-
 
285
    cmp al,0
-
 
286
    je @f
-
 
287
    cmp ted_seln_y0,esi
-
 
288
    jg @f
-
 
289
    cmp ted_seln_y1,esi
-
 
290
    jl @f
-
 
291
      mov edx,ted_color_select ;draw selected line
-
 
292
    @@:
-
 
293
 
-
 
294
    mov eax,13 ;rect
-
 
295
    int 0x40
-
 
296
 
-
 
297
    stdcall IsSel,edi
-
 
298
    cmp al,0
-
 
299
    je .no_clear
-
 
300
 
-
 
301
    mov al,13 ;rect
-
 
302
	xor cx,cx
-
 
303
    add ecx,ted_rec_h
-
 
304
    cmp ted_seln_y0,esi
-
 
305
    jne @f
-
 
306
      push bx
-
 
307
      mov edx,ted_seln_x0 ; âåðõíÿÿ ïîëîñà (çàòèðàåò ñëåâà)
-
 
308
      cmp edx,[hScr.position]
-
 
309
      jle .in_wnd
-
 
310
	sub edx,[hScr.position]
-
 
311
	imul edx,ted_rec_w
-
 
312
	mov bx,dx
-
 
313
	jmp .no_wnd
-
 
314
      .in_wnd:
-
 
315
	mov bx,0
-
 
316
      .no_wnd:
-
 
317
      mov edx,ted_color_wnd_work
-
 
318
      int 0x40
-
 
319
      pop bx
-
 
320
    @@:
-
 
321
    cmp ted_seln_y1,esi
-
 
322
    jne @f
-
 
323
      mov edx,ted_seln_x1 ; íèæíÿÿ ïîëîñà (çàòèðàåò ñïðàâà)
-
 
324
      cmp edx,[hScr.position]
-
 
325
      jle .in_wnd2
-
 
326
	sub edx,[hScr.position]
-
 
327
	imul edx,ted_rec_w
-
 
328
	sub bx,dx
-
 
329
	shl edx,16
-
 
330
	add ebx,edx
-
 
331
      .in_wnd2:
-
 
332
 
-
 
333
      mov edx,ted_color_wnd_work
-
 
334
      int 0x40
-
 
335
    @@:
-
 
336
 
-
 
337
  .no_clear:
-
 
338
  popad
-
 
339
  ret
-
 
340
endp
-
 
341
 
-
 
342
align 4
-
 
343
proc draw_main_win, edit:dword
-
 
344
  locals
-
 
345
    line_num dd ?
-
 
346
  endl
-
 
347
  pushad
-
 
348
  mov edi,dword[edit]
-
 
349
 
-
 
350
  mov eax,4 ;draw text
-
 
351
  mov ecx,ted_text_colors
-
 
352
  mov ecx,dword[ecx]
-
 
353
 
-
 
354
  mov ebx,ted_wnd_l
-
 
355
  add ebx,ted_rec_l
-
 
356
  shl ebx,16
-
 
357
  add ebx,ted_wnd_t
-
 
358
  add ebx,ted_rec_t
-
 
359
  add ebx,0x10001 ;äîáàâëÿåì îòñòóïû äëÿ âûðàâíèâàíèÿ áóêâû ïî öåíòðó
-
 
360
 
-
 
361
  stdcall SelNormalize,edi ;need before draw select
-
 
362
  mov esi,[wScr.position]
-
 
363
  mov dword[line_num],esi
-
 
364
 
-
 
365
  stdcall clear_line_before_draw, edi,ebx,1,esi
-
 
366
  call GetFirstVisiblePos
-
 
367
  cmp edx,0
-
 
368
  je .no_draw_text
-
 
369
  mov esi,1 ;äëèííà âûâîäèìîãî òåêñòà ïî 1-ìó ñèìâîëó
-
 
370
  @@:
-
 
371
    call IteratNext
-
 
372
    cmp edx,ted_tex_1
-
 
373
    jle .no_draw_text
-
 
374
 
-
 
375
    ; *** öâåòîâàÿ ðàçìåòêà
-
 
376
    cmp ted_mode_color,0
-
 
377
    je .no_col_change
-
 
378
    cmp byte[edx+1],0
-
 
379
    je .no_col_change
-
 
380
      call GetSymbColor
-
 
381
    .no_col_change:
-
 
382
 
-
 
383
    cmp byte [edx],13
-
 
384
    jne .no_13
-
 
385
      cmp ted_mode_invis,1
-
 
386
      jne .no_invis
-
 
387
	push edx
-
 
388
	mov edx,edi
-
 
389
	add edx,ted_offs_symbol_new_line
-
 
390
	int 0x40
-
 
391
	pop edx
-
 
392
      .no_invis:
-
 
393
      add ebx,ted_rec_h
-
 
394
      ;optimized output \/
-
 
395
      mov eax,ted_wnd_h
-
 
396
      add eax,ted_wnd_t
-
 
397
      cmp bx,ax
-
 
398
      jg .no_draw_text
-
 
399
      mov eax,4
-
 
400
      ;optimized output /\        
-
 
401
	  and ebx,0xffff
-
 
402
      ror ebx,16
-
 
403
      add ebx,ted_wnd_l
-
 
404
      add ebx,ted_rec_l
-
 
405
      inc ebx
-
 
406
      ror ebx,16
-
 
407
      inc dword[line_num] ;increment line number
-
 
408
      stdcall clear_line_before_draw,edi,ebx,1,dword[line_num]
-
 
409
      call OptDrawLineLeft
-
 
410
      jmp @b
-
 
411
    .no_13:
-
 
412
 
-
 
413
    int 0x40
-
 
414
    ror ebx,16
-
 
415
    add ebx,ted_rec_w
-
 
416
    mov esi,ted_wnd_l
-
 
417
    add esi,ted_wnd_w
-
 
418
    cmp bx,si
-
 
419
    jl .no_opt
-
 
420
      call OptDrawLineRight
-
 
421
    .no_opt:
-
 
422
	mov si,1
-
 
423
    ror ebx,16
-
 
424
    jmp @b
-
 
425
  .no_draw_text:
-
 
426
 
-
 
427
  stdcall clear_line_before_draw,edi,ebx,0,dword[line_num]
-
 
428
  stdcall draw_line_numbers,edi
-
 
429
  stdcall draw_main_cursor,edi
-
 
430
 
-
 
431
;---------------------------------------------
-
 
432
; set all_redraw flag for draw all ScrollBar
-
 
433
; In some cases it is necessity to draw only the area
-
 
434
; of moving of a "runner", for acceleration of output - 
-
 
435
; in this case the flag needs to be reset to 0 (zero).
-
 
436
	xor	eax,eax
-
 
437
	inc	eax
-
 
438
	mov	[wScr.all_redraw],eax
-
 
439
	mov	[hScr.all_redraw],eax	
-
 
440
 
-
 
441
; draw for Vertical ScrollBar
-
 
442
	stdcall [scrollbar_ver_draw], dword wScr
-
 
443
	stdcall [scrollbar_hor_draw], dword hScr
-
 
444
; reset all_redraw flag 
-
 
445
	xor	eax,eax
-
 
446
	mov	[wScr.all_redraw],eax
-
 
447
	mov	[hScr.all_redraw],eax
-
 
448
;---------------------------------------------
-
 
449
 
-
 
450
  mov eax,13
-
 
451
  ;left-bottom square
-
 
452
  mov ebx,ted_wnd_l
-
 
453
  shl ebx,16
-
 
454
  add ebx,ted_rec_l
-
 
455
  mov ecx,ted_wnd_t
-
 
456
  add ecx,ted_wnd_h
-
 
457
  shl ecx,16
-
 
458
  mov cx,word[hScr.size_y]
-
 
459
  inc cx
-
 
460
  mov edx,[sc.work]
-
 
461
  int 0x40
-
 
462
 
-
 
463
  ;right-bottom square
-
 
464
  mov ebx,ted_wnd_l
-
 
465
  add ebx,ted_wnd_w
-
 
466
  shl ebx,16
-
 
467
  mov bx,word[wScr.size_x]
-
 
468
  inc bx
-
 
469
  int 0x40
-
 
470
 
-
 
471
  stdcall draw_panel_find, edi
107
  call draw_but_icon
472
  stdcall draw_panel_syntax, edi
108
 
473
  popad
-
 
Line 474... Line 109...
474
  ret
109
  popad
475
endp
110
  ret
476
 
111
 
477
;txtBUp db 24
112
;txtBUp db 24
478
;txtBDn db 25
-
 
479
;txtBRi db 26
-
 
480
;txtBLe db 27
-
 
481
align 4
-
 
Line -... Line 113...
-
 
113
;txtBDn db 25
-
 
114
;txtBRi db 26
-
 
115
;txtBLe db 27
-
 
116
 
-
 
117
;input:
-
 
118
; edi = pointer to tedit struct
482
proc draw_panel_find, edit:dword
119
align 4
483
  push edi
120
proc draw_panel_find
484
  mov edi,dword[edit]
121
;push edi
Line 485... Line 122...
485
 
122
;mov edi,dword[edit]
486
  cmp ted_panel_id,TE_PANEL_FIND ;if not panel
123
  cmp ted_panel_id,TED_PANEL_FIND ;if not panel
487
  jne @f
124
  jne @f
488
  push eax ebx ecx edx
125
  push eax ebx ecx edx
489
 
126
 
490
  mov eax,13 ;ðèñîâàíèå ïðÿìîóãîëüíèêà
127
  mov eax,13 ;ðèñîâàíèå ïðÿìîóãîëüíèêà
491
  mov ebx,TE_PANEL_WIDTH
128
  mov ebx,TED_PANEL_WIDTH
Line 504... Line 141...
504
  int 0x40
141
  int 0x40
Line 505... Line 142...
505
 
142
 
Line 506... Line 143...
506
  stdcall [edit_box_draw], dword edit2
143
  stdcall [edit_box_draw], dword edit2
507
 
144
 
508
  mov eax,13 ;ðèñîâàíèå ïðÿìîóãîëüíèêà
145
  mov eax,13 ;ðèñîâàíèå ïðÿìîóãîëüíèêà
509
  mov ebx,TE_PANEL_WIDTH
146
  mov ebx,TED_PANEL_WIDTH
510
  mov ecx,ted_wnd_t
147
  mov ecx,ted_wnd_t
511
  add cx,20+15 ; 15 - height text box
148
  add cx,20+15 ; 15 - height text box
-
 
149
  shl ecx,16
512
  shl ecx,16
150
  add ecx,ted_wnd_h
513
  add ecx,ted_wnd_h
151
  mov edx,ted_scr_h
514
  add cx,word[hScr.size_y]
152
  add cx,word[edx+sb_offs_size_y]
515
  sub cx,20+15-1 ; 15 - height text box
153
  sub cx,20+15-1 ; 15 - height text box
Line 516... Line 154...
516
  mov edx,[sc.work]
154
  mov edx,[sc.work]
Line 542... Line 180...
542
    mov edx,201
180
    mov edx,201
543
    or edx,0x80000000
181
    or edx,0x80000000
544
    int 0x40
182
    int 0x40
545
  pop edx eax
183
  pop edx eax
546
  .end_f:
184
  .end_f:
547
  pop edi
185
;pop edi
548
  ret
186
  ret
549
endp
187
endp
Line 550... Line 188...
550
 
188
 
-
 
189
;input:
551
 
190
; edi = pointer to tedit struct
552
align 4
191
align 4
553
proc draw_panel_syntax, edit:dword
192
proc draw_panel_syntax
554
  push edi
193
;push edi
555
  mov edi,dword[edit]
-
 
556
 
194
;mov edi,dword[edit]
557
  cmp ted_panel_id,TE_PANEL_SYNTAX ;if not panel
195
  cmp ted_panel_id,TED_PANEL_SYNTAX ;if not panel
558
  jne @f
196
  jne @f
Line 559... Line 197...
559
  push eax ebx ecx edx
197
  pushad
560
 
198
 
561
  mov eax,13 ;ðèñîâàíèå ïðÿìîóãîëüíèêà
199
  mov eax,13 ;ðèñîâàíèå ïðÿìîóãîëüíèêà
562
  mov ebx,TE_PANEL_WIDTH
200
  mov ebx,TED_PANEL_WIDTH
563
  mov ecx,ted_wnd_t
201
  mov ecx,ted_wnd_t
564
  shl ecx,16
202
  shl ecx,16
565
  mov cx,20
203
  mov cx,20
Line 574... Line 212...
574
  add ecx,dword[tree1.box_height]
212
  add ecx,dword[tree1.box_height]
575
  add ecx,20
213
  add ecx,20
576
  and ecx,0xffff
214
  and ecx,0xffff
577
  ror ecx,16
215
  ror ecx,16
578
  add ecx,ted_wnd_h
216
  add ecx,ted_wnd_h
-
 
217
  mov esi,ted_scr_h
579
  add cx,word[hScr.size_y]
218
  add cx,word[esi+sb_offs_size_y]
580
  sub cx,20
219
  sub cx,20
581
  sub ecx,dword[tree1.box_height]
220
  sub ecx,dword[tree1.box_height]
582
  inc cx
221
  inc cx
583
  int 0x40 ;ðèñîâàíèå íèæíåãî ôîíîâîãî ïðÿìîóãîëüíèêà
222
  int 0x40 ;ðèñîâàíèå íèæíåãî ôîíîâîãî ïðÿìîóãîëüíèêà
Line 605... Line 244...
605
  add ebx,dword[tree1.box_height]
244
  add ebx,dword[tree1.box_height]
606
  add ebx,ted_wnd_t
245
  add ebx,ted_wnd_t
607
  mov edx,txtFormatApply
246
  mov edx,txtFormatApply
608
  int 0x40
247
  int 0x40
Line 609... Line 248...
609
 
248
 
610
  pop edx ecx ebx eax
249
  popad
611
  jmp .end_f
250
  jmp .end_f
612
  @@:
251
  @@:
613
    push eax edx
252
    push eax edx
614
      mov eax,8
253
      mov eax,8
615
      mov edx,200
254
      mov edx,200
616
      or edx,0x80000000
255
      or edx,0x80000000
617
      int 0x40 ;åñëè íåò ïàíåëè òî óäàëÿåì êíîïêó
256
      int 0x40 ;åñëè íåò ïàíåëè òî óäàëÿåì êíîïêó
618
    pop edx eax
257
    pop edx eax
619
  .end_f:
258
  .end_f:
620
  pop edi
-
 
621
  ret
-
 
622
endp
-
 
623
 
-
 
624
 
-
 
625
align 4
-
 
626
proc draw_cur_line, edit:dword
-
 
627
  pushad
-
 
628
    mov edi,dword[edit]
-
 
629
 
-
 
630
    mov ebx,ted_wnd_l
-
 
631
    add ebx,ted_rec_l
-
 
632
    shl ebx,16
-
 
633
    mov eax,ted_cur_y
-
 
634
    imul eax,ted_rec_h
-
 
635
	mov bx,ax
-
 
636
    add ebx,ted_wnd_t
-
 
637
    add ebx,ted_rec_t ;ebx - êîîðäèíàòû äëÿ ïðÿìîóãîëüíèêà î÷èñòêè ëèíèè
-
 
638
	add ebx,0x10001   ;äîáàâëÿåì îòñòóïû äëÿ âûðàâíèâàíèÿ áóêâû ïî öåíòðó
-
 
639
 
-
 
640
    stdcall SelNormalize,edi ;need before draw select
-
 
641
	mov ecx,ted_cur_y
-
 
642
    add ecx,[wScr.position]
-
 
643
    stdcall clear_line_before_draw, tedit0, ebx,1,ecx
-
 
644
 
-
 
645
    mov esi,[hScr.position]
-
 
646
    call GetPosByParam
-
 
647
 
-
 
648
  cmp ted_gp_opt,2
-
 
649
  jne .no_draw_text
-
 
650
;  mov eax,4 ;draw text
-
 
651
  call GetSymbColor
-
 
652
  mov esi,1 ;draw 1 symbol
-
 
653
  @@:
-
 
654
    ;call IteratNext
-
 
655
    cmp edx,ted_tex_1
-
 
656
    jle .no_draw_text
-
 
657
 
-
 
658
    ; *** öâåòîâàÿ ðàçìåòêà
-
 
659
    cmp ted_mode_color,0
-
 
660
    je .no_col_change
-
 
661
    cmp byte[edx+1],0
-
 
662
    je .no_col_change
-
 
663
      call GetSymbColor
-
 
664
    .no_col_change:
-
 
665
 
-
 
666
    mov eax,4 ;draw text
-
 
667
    cmp byte [edx],13
-
 
668
    jne .no_13
-
 
669
      cmp ted_mode_invis,1
-
 
670
      jne .no_draw_text
-
 
671
 push edx
-
 
672
 mov edx,edi
-
 
673
 add edx,ted_offs_symbol_new_line
-
 
674
 int 0x40
-
 
675
 pop edx
-
 
676
      jmp .no_draw_text
-
 
677
    .no_13:
-
 
678
 
-
 
679
    int 0x40
-
 
680
    ror ebx,16
-
 
681
    add ebx,ted_rec_w
-
 
682
    mov eax,ted_wnd_w
-
 
683
    add eax,ted_wnd_l ;ax = îòñòóï ïî îñè x
-
 
684
    cmp bx,ax
-
 
685
    jge .no_draw_text ;Opt
-
 
686
    ror ebx,16
-
 
687
    call IteratNext
-
 
688
    jmp @b
-
 
689
  .no_draw_text:
-
 
690
 
-
 
691
  stdcall draw_main_cursor,edi
-
 
692
  popad
259
;pop edi
693
  ret
260
  ret
Line 694... Line 261...
694
endp
261
endp
695
 
262
 
696
MIN_M_WND_H equ 100
263
MIN_M_WND_H equ 100
697
MIN_W_SCRL_ARE equ 3
264
MIN_W_SCRL_ARE equ 3
698
MIN_H_SCRL_ARE equ 3
265
MIN_H_SCRL_ARE equ 3
699
align 4
266
align 4
700
proc EvSize, edit:dword
267
proc EvSize, edit:dword
-
 
268
  pushad
-
 
269
  mov edi,dword[edit]
Line 701... Line 270...
701
  push eax ecx edx edi
270
  mov ebx,ted_scr_h
702
  mov edi,dword[edit]
271
  mov esi,ted_scr_w
703
 
272
 
704
  m2m ted_wnd_w,[procinfo.client_box.width] ;ñòàâèì øèðèíó îêíà ðåäàêòîðà ðàâíîé øèðèíå âñåãî îêíà
273
  m2m ted_wnd_w,[procinfo.client_box.width] ;ñòàâèì øèðèíó îêíà ðåäàêòîðà ðàâíîé øèðèíå âñåãî îêíà
705
  mov eax,ted_wnd_l
274
  mov eax,ted_wnd_l
706
  sub ted_wnd_w,eax ;îòíèìàåì îòñòóï ñëåâà
275
  sub ted_wnd_w,eax ;îòíèìàåì îòñòóï ñëåâà
Line 707... Line 276...
707
  mov eax,[wScr]    ;+0 size_x
276
  mov eax,dword[esi+sb_offs_size_x]
708
  and eax,0xffff
277
  and eax,0xffff
709
  sub ted_wnd_w,eax ;îòíèìàåì øèðèíó âåðò. ñêðîëëèíãà
278
  sub ted_wnd_w,eax ;îòíèìàåì øèðèíó âåðò. ñêðîëëèíãà
710
 
279
 
711
  m2m ted_wnd_h,[procinfo.client_box.height] ;ñòàâèì âûñîòó îêíà ðåäàêòîðà ðàâíîé âûñîòå âñåãî îêíà
280
  m2m ted_wnd_h,[procinfo.client_box.height] ;ñòàâèì âûñîòó îêíà ðåäàêòîðà ðàâíîé âûñîòå âñåãî îêíà
Line 712... Line 281...
712
  cmp ted_wnd_h,MIN_M_WND_H
281
  cmp ted_wnd_h,MIN_M_WND_H
713
  jg @f
282
  jg @f
714
    mov ted_wnd_h,MIN_M_WND_H
283
    mov ted_wnd_h,MIN_M_WND_H
715
  @@:
284
  @@:
716
 
285
 
717
  mov ax,word[hScr.size_y]
286
  mov ax,word[ebx+sb_offs_size_y]
718
  and eax,0xffff
287
  and eax,0xffff
Line 719... Line 288...
719
  sub ted_wnd_h,eax	      ;îòíèìàåì âûñîòó ãîðèç. ñêðîëëèíãà
288
  sub ted_wnd_h,eax	      ;îòíèìàåì âûñîòó ãîðèç. ñêðîëëèíãà
720
    mov eax,ted_wnd_h	      ;eax = âûñîòà îêíà - âûñîòà ãîðèç. ñêðîëëèíãà
289
    mov eax,ted_wnd_h	  ;eax = âûñîòà îêíà - âûñîòà ãîðèç. ñêðîëëèíãà
721
    mov word[hScr.start_y],ax ;ïåðåäâèãàåì ãîðèç. ñêðîëëèíã
290
    mov word[ebx+sb_offs_start_y],ax ;ïåðåäâèãàåì ãîðèç. ñêðîëëèíã
722
  mov eax,ted_wnd_t
291
  mov eax,ted_wnd_t
723
  sub ted_wnd_h,eax	      ;îòíèìàåì îòñòóï ñâåðõó
292
  sub ted_wnd_h,eax	      ;îòíèìàåì îòñòóï ñâåðõó
724
 
293
 
Line 725... Line 294...
725
  mov eax,ted_wnd_w
294
  mov eax,ted_wnd_w
726
  mov ecx,ted_wnd_l
295
  mov ecx,ted_wnd_l
727
  add eax,ecx
296
  add eax,ecx
728
  mov word[wScr.start_x],ax   ;ïåðåäâèãàåì âåðò. ñêðîëëèíã
297
  mov word[esi+sb_offs_start_x],ax   ;ïåðåäâèãàåì âåðò. ñêðîëëèíã
729
  mov eax,ted_wnd_h
298
  mov eax,ted_wnd_h
Line 730... Line 299...
730
  mov word[wScr.size_y],ax    ;çàäàåì âûñîòó âåðò. ñêðîëëèíãà
299
  mov word[esi+sb_offs_size_y],ax    ;çàäàåì âûñîòó âåðò. ñêðîëëèíãà
731
 
300
 
732
  add ecx,ted_rec_l	;ecx=ted_wnd_l+ted_rec_l
301
  add ecx,ted_rec_l	;ecx=ted_wnd_l+ted_rec_l
733
  mov [hScr.start_x],cx ;ñäâèãàåì ãîðèç. ñêðîëëèíã ïî ðàçìåðó ëåâîãî îòñòóïà äëÿ öèôð
302
  mov word[ebx+sb_offs_start_x],cx ;ñäâèãàåì ãîðèç. ñêðîëëèíã ïî ðàçìåðó ëåâîãî îòñòóïà äëÿ öèôð
734
  mov eax,ted_wnd_w
303
  mov eax,ted_wnd_w
735
  sub eax,ted_rec_l
304
  sub eax,ted_rec_l
736
  mov word[hScr.size_x],ax ;çàäàåì øèðèíó ãîðèç. ñêðîëëèíãà
305
  mov word[ebx+sb_offs_size_x],ax ;çàäàåì øèðèíó ãîðèç. ñêðîëëèíãà
737
 
306
 
738
  mov eax,ted_wnd_h ;calculate lines in page
307
  mov eax,ted_wnd_h ;calculate lines in page
739
  sub eax,ted_rec_t
308
  sub eax,ted_rec_t
Line 740... Line 309...
740
  xor edx,edx
309
  xor edx,edx
741
  mov ecx,ted_rec_h
310
  mov ecx,ted_rec_h
742
  div ecx
311
  div ecx
743
  cmp eax,MIN_W_SCRL_ARE
312
  cmp eax,MIN_W_SCRL_ARE
Line 754... Line 323...
754
  cmp eax,MIN_H_SCRL_ARE
323
  cmp eax,MIN_H_SCRL_ARE
755
  jg @f
324
  jg @f
756
    mov eax,MIN_H_SCRL_ARE
325
    mov eax,MIN_H_SCRL_ARE
757
  @@:
326
  @@:
758
  dec eax ; ???
327
  dec eax ; ???
759
  mov [hScr.cur_area],eax
328
  mov dword[ebx+sb_offs_cur_area],eax
Line 760... Line 329...
760
 
329
 
761
  mov eax,ted_wnd_t
330
  mov eax,ted_wnd_t
762
  mov edi,dword tree1
331
  mov edi,dword tree1
763
  mov tl_box_top,eax ;=ted_wnd_t
332
  mov tl_box_top,eax ;=ted_wnd_t
Line 764... Line 333...
764
  add tl_box_top,20
333
  add tl_box_top,20
765
 
334
 
Line 766... Line -...
766
  mov dword[edit2.top],eax ;=ted_wnd_t
-
 
767
  add dword[edit2.top],20
-
 
768
 
-
 
769
  pop edi edx ecx eax
-
 
770
  call OnInitialUpdate
-
 
771
  ret
-
 
772
endp
-
 
773
 
-
 
774
align 4
-
 
775
OnInitialUpdate:
-
 
776
  mov [wScr.redraw],1
-
 
777
  mov [hScr.redraw],1
-
 
778
  ret
-
 
779
 
-
 
780
;input:
-
 
781
; edi = pointer to tedit struct
-
 
782
;output:
-
 
783
; ecx = íîâûé öâåò ñèìâîëà
-
 
784
; edx = pointer to symbol
-
 
785
; edx = 0 if text not in screen
-
 
786
align 4
-
 
787
GetFirstVisiblePos:
-
 
788
  push ecx
-
 
789
  mov edx,ted_tex
-
 
790
  xor ecx,ecx
-
 
791
  @@:
-
 
792
    cmp ecx,[wScr.position]
-
 
793
    je @f
-
 
794
    call IteratNext
-
 
795
    cmp edx,ted_tex_1
-
 
796
    jle @f
-
 
797
    cmp byte [edx],13
-
 
798
    jne @b
-
 
799
    inc ecx
-
 
800
    jmp @b
-
 
801
  @@:
-
 
802
 
-
 
803
  cmp ecx,[wScr.position]
-
 
804
  je @f
-
 
805
    xor edx,edx
-
 
806
  @@:
-
 
807
  cmp ecx,[wScr.max_area]
-
 
808
  jle @f
-
 
809
    mov [wScr.max_area],ecx
-
 
810
  @@:
-
 
811
  pop ecx
-
 
812
  call OptDrawLineLeft
-
 
813
  ret
-
 
814
 
-
 
815
 
-
 
816
 
-
 
817
;input:
-
 
818
; edx = pointer to symbol
-
 
819
; edi = pointer to tedit struct
-
 
820
;output:
-
 
821
; ecx = íîâûé öâåò ñèìâîëà
-
 
822
; edx = óêàçàòåëü íà ïåðâûé ëåâûé ñèìâîë
-
 
823
align 4
-
 
824
proc OptDrawLineLeft
-
 
825
  push ebx
-
 
826
 
-
 
827
  mov ebx,[hScr.position]
-
 
828
  cmp ebx,0
-
 
829
  je .ret_f
-
 
830
  push eax
-
 
831
  mov eax,edx
-
 
832
 
-
 
833
  cmp edx,ted_tex
-
 
834
  jne @f
-
 
835
    call IteratNext
-
 
836
    jmp .beg_cycle
-
 
837
  @@:
-
 
838
 
-
 
839
  cmp ebx,0
-
 
840
  je @f
-
 
841
 
-
 
842
  cmp byte[edx],13
-
 
843
  jne @f
-
 
844
    call IteratNext
-
 
845
    .beg_cycle:
-
 
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
-
 
861
  mov cl,byte[edx+1]
-
 
862
  shl cx,2
-
 
863
  add ecx,ted_text_colors
-
 
864
  mov ecx,dword[ecx]
-
 
865
.no_color:
-
 
866
;--------------------------------------
-
 
867
    mov eax,edx
-
 
868
    call IteratNext
-
 
869
    dec ebx
-
 
870
    jmp @b
-
 
871
  @@:
-
 
872
    mov edx,eax
-
 
873
  pop eax
-
 
874
  .ret_f:
-
 
875
  call GetSymbColor
-
 
876
  pop ebx
-
 
877
  ret
-
 
878
endp
-
 
879
 
-
 
880
;input:
-
 
881
; edx = pointer to symbol
-
 
882
; edi = pointer to tedit struct
-
 
883
;output:
-
 
884
; edx = pointer to 13 symbol
-
 
885
align 4
-
 
886
proc OptDrawLineRight
-
 
887
  push eax
-
 
888
  mov eax,edx
-
 
889
  @@:
-
 
890
    cmp edx,ted_tex_1
-
 
891
    jle @f
-
 
892
    cmp byte[edx],13
-
 
893
    je @f
-
 
894
    mov eax,edx
-
 
895
    call IteratNext
-
 
896
    jmp @b
-
 
897
  @@:
-
 
898
  mov edx,eax ;perv sumbol
-
 
899
  call GetSymbColor
-
 
900
 
-
 
901
  pop eax
-
 
902
  ret
-
 
903
endp
-
 
904
 
-
 
905
align 4
-
 
906
proc draw_main_cursor, edit:dword
-
 
907
  pushad
-
 
908
  mov edi,dword[edit]
-
 
909
 
-
 
910
  mov eax,13 ;draw cursor
-
 
911
  mov ecx,ted_wnd_t ;calc rect -> y0,y1
-
 
912
  add ecx,ted_rec_t
-
 
913
  mov edx,ted_cur_y
-
 
914
  imul edx,ted_rec_h
-
 
915
  add ecx,edx
-
 
916
 
-
 
917
  cmp ted_cur_ins,1 ;ïðîâåðêà ðåæèìà ðàáîòû êóðñîðà (îáû÷íûé èëè âñòàâêà)
-
 
918
  jne @f
-
 
919
    mov edx,ted_rec_h
-
 
920
    inc edx   ;1->1, 3->2, 5->3, ...
-
 
921
    shr edx,1 ;edx = âûñîòà ñòðîêè äåëåííàÿ íà 2 (êîãäà êóðñîð íå ïîëíûé)
-
 
922
    add ecx,edx
-
 
923
  @@:
-
 
924
  shl ecx,16
-
 
925
  add ecx,ted_rec_h
-
 
926
  cmp ted_cur_ins,1
-
 
927
  jne @f
-
 
928
    shr cx,1 ;äåëèì âûñîòó êóðñîðà íà 2
-
 
929
  @@:
-
 
930
 
-
 
931
  mov ebx,ted_wnd_l ;calc rect -> x0,x1
-
 
932
  add ebx,ted_rec_l
-
 
933
  mov edx,ted_cur_x
-
 
934
  imul edx,ted_rec_w
-
 
935
  add ebx,edx
-
 
936
  shl ebx,16
-
 
937
  add ebx,ted_rec_w
-
 
938
 
-
 
939
  mov edx,ted_color_cursor
-
 
940
  int 0x40 ;âûâîä êóðñîðà
-
 
941
 
-
 
942
  call GetPos
-
 
943
  cmp ted_gp_opt,2
-
 
944
  jne @f
-
 
945
    mov eax,4 ;draw text
-
 
946
    mov esi,1
-
 
947
    ror ecx,16
-
 
948
    mov bx,cx
-
 
949
    add ebx,0x10001
-
 
950
    cmp ted_cur_ins,1
-
 
951
    jne .no_up_tetx
-
 
952
      mov ecx,ted_rec_h
-
 
953
      inc cx ; 1->1, 3->2, 5->3, ...
-
 
954
      shr cx,1
-
 
955
      sub bx,cx
-
 
956
    .no_up_tetx:
-
 
957
    mov ecx,ted_color_cur_text
-
 
958
    call ConvertInvisSymb
-
 
959
    int 0x40
-
 
960
  @@:
-
 
961
 
-
 
962
  mov eax,4
-
 
963
  mov ebx,ted_wnd_l
-
 
964
  add ebx,ted_rec_l
-
 
965
  shl ebx,16
-
 
966
  add ebx,ted_wnd_t
-
 
967
  add ebx,3
-
 
968
  mov ecx,ted_color_wnd_bord
-
 
969
  or  ecx,0x80000000
-
 
970
  mov edx,txtRow
-
 
971
  int 0x40 ;âûâîä ïîäïèñè 'Ñòðîêà'
-
 
972
 
-
 
973
  add ebx,0x500000
-
 
974
  mov edx,txtCol
-
 
975
  int 0x40 ;âûâîä ïîäïèñè 'Çíàê'
-
 
976
 
-
 
977
  cmp ted_tim_undo,0
-
 
978
  je @f
-
 
979
    add ebx,0x500000
-
 
980
    mov edx,txtOtm
-
 
981
    int 0x40
-
 
982
    sub ebx,0x500000
-
 
983
  @@:
-
 
984
 
-
 
985
  stdcall draw_bufer,edi
-
 
986
  stdcall draw_help_f1
-
 
987
 
-
 
988
  mov eax,47 ;draw cursor coords
-
 
989
  mov esi,ted_color_wnd_bord
-
 
990
  or  esi,0x40000000
-
 
991
 
-
 
992
  mov edx,ebx
-
 
993
  ror edx,16
-
 
994
  sub edx,35
-
 
995
  ror edx,16
-
 
996
  ;add edx,3
-
 
997
  mov ebx,0x40000 ;Row=...
-
 
998
  mov ecx,ted_cur_y
-
 
999
  inc ecx
-
 
1000
  add ecx,[wScr.position]
-
 
1001
 
-
 
1002
push edi
-
 
1003
  mov edi,ted_color_wnd_work
-
 
1004
  int 0x40 ;âûâîä ÷èñëà òåêóùåé ñòðîêè
-
 
1005
pop edi
-
 
1006
 
-
 
1007
  ;mov ebx,0x40000 ;Col=...
-
 
1008
  mov ecx,ted_cur_x
-
 
1009
  inc ecx
-
 
1010
  add ecx,[hScr.position]
-
 
1011
  add edx,0x500000
-
 
1012
push edi
-
 
1013
  mov edi,ted_color_wnd_work
-
 
1014
  int 0x40 ;âûâîä ÷èñëà çíàêîâ
-
 
1015
pop edi
-
 
1016
 
-
 
1017
  cmp ted_tim_undo,0
-
 
1018
  je @f
-
 
1019
    mov ecx,ted_tim_undo
-
 
1020
    add edx,0x500000
-
 
1021
    int 0x40
-
 
1022
  @@:
-
 
1023
 
-
 
1024
  popad
-
 
1025
  ret
-
 
1026
endp
-
 
1027
 
-
 
1028
align 4
-
 
1029
proc draw_bufer, edit:dword
-
 
1030
  pushad
-
 
1031
  mov edi,dword[edit]
-
 
1032
 
-
 
1033
  cmp byte[buf],0
-
 
1034
  je @f
-
 
1035
    mov ebx,ted_wnd_l
-
 
1036
    add ebx,ted_rec_l
-
 
1037
  add bx,250
-
 
1038
    shl ebx,16
-
 
1039
    add ebx,ted_wnd_t
-
 
1040
    add ebx,3
-
 
1041
    mov ecx,ted_color_wnd_bord
-
 
1042
    or	ecx,0x40000000
-
 
1043
    mov edi,ted_color_wnd_work
-
 
1044
    
-
 
1045
    mov edx,txtBuf
-
 
1046
    mov esi,buf
-
 
1047
    call strlen
-
 
1048
if lang eq ru
-
 
1049
    cmp eax,15
-
 
1050
    jle .crop_buf
-
 
1051
      mov eax,15
-
 
1052
    .crop_buf:
-
 
1053
    mov esi,7 ;7=len(txtBuf)
-
 
1054
else
-
 
1055
    cmp eax,14
-
 
1056
    jle .crop_buf
-
 
1057
      mov eax,14
-
 
1058
    .crop_buf:
-
 
1059
    mov esi,8 ;8=len(txtBuf)
-
 
1060
end if
-
 
1061
    add esi,eax
-
 
1062
 
-
 
1063
    mov eax,4
-
 
1064
    int 0x40
-
 
1065
  @@:
-
 
1066
  popad
-
 
1067
  ret
-
 
1068
endp
-
 
1069
 
-
 
1070
;input:
-
 
1071
; edi = pointer to tedit struct
-
 
1072
align 4
-
 
1073
proc draw_help_f1
-
 
1074
  pushad
-
 
1075
 
-
 
1076
  mov eax,13 ;clear place before draw help
-
 
1077
  mov ebx,ted_wnd_l
-
 
1078
  add ebx,ted_rec_l
-
 
1079
  shl ebx,16
-
 
1080
  add ebx,ted_wnd_w
-
 
1081
  sub ebx,ted_rec_l
-
 
1082
  mov ecx,ted_wnd_t
-
 
1083
  add ecx,13
-
 
1084
  shl ecx,16
-
 
1085
  add ecx,ted_rec_h
-
 
1086
  mov edx,ted_color_wnd_capt
-
 
1087
  int 0x40
-
 
1088
 
-
 
1089
  cmp ted_help_id,-1
-
 
1090
  je @f
-
 
1091
    mov eax,ted_help_id
-
 
1092
    ColToIndexOffset eax,edx
-
 
1093
 
-
 
1094
    ;SetCoordinates
-
 
1095
    mov ebx,ted_wnd_l
-
 
1096
    add ebx,ted_rec_l
-
 
1097
    shl ebx,16
-
 
1098
    add ebx,ted_wnd_t
-
 
1099
    add ebx,13 ;=3+10
-
 
1100
 
-
 
1101
    ;SetTextColor
-
 
1102
    xor eax,eax
-
 
1103
    mov al,byte[edx+MAX_COLOR_WORD_LEN+6]
-
 
1104
    shl ax,2
-
 
1105
    mov ecx,ted_text_colors
-
 
1106
    add ecx,eax
-
 
1107
    mov ecx,dword[ecx]
-
 
1108
    or	ecx,0xc0000000 ;SetTextStyles
-
 
1109
	mov esi,edi
-
 
1110
      mov edi,ted_color_wnd_work
-
 
1111
      mov eax,4
-
 
1112
      int 0x40
-
 
1113
    mov edi,esi
-
 
1114
 
-
 
1115
    ;*** draw help string ***
-
 
1116
    mov ecx,ted_color_wnd_bord
-
 
1117
    or ecx,0x80000000
-
 
1118
    mov edx,dword[edx+MAX_COLOR_WORD_LEN]
-
 
1119
    cmp edx,0
-
 
1120
    je @f
-
 
1121
      add edx,ted_help_text_f1
-
 
1122
      add ebx,0x500000
-
 
1123
      int 0x40
-
 
1124
  @@:
-
 
1125
  popad
-
 
1126
  ret
-
 
1127
endp
-
 
1128
 
-
 
1129
align 4
-
 
1130
proc draw_line_numbers, edit:dword
-
 
1131
  pushad
-
 
1132
  mov edi,dword[edit]
-
 
1133
 
-
 
1134
  ;top panel with caption
-
 
1135
  mov ebx,ted_wnd_l
-
 
1136
;  add ebx,ted_rec_l
-
 
1137
  shl ebx,16
-
 
1138
  add ebx,ted_wnd_w
-
 
1139
;  sub ebx,ted_rec_l
-
 
1140
  mov edx,ted_color_wnd_work
-
 
1141
  mov ecx,ted_wnd_t
-
 
1142
  shl ecx,16
-
 
1143
  add ecx,ted_rec_t
-
 
1144
  mov eax,13
-
 
1145
  mov edx,ted_color_wnd_capt
-
 
1146
  int 0x40
-
 
1147
 
-
 
1148
  ;line numbers
-
 
1149
  mov ebx,0x40000 ;format
-
 
1150
  mov ecx,[wScr.position]
-
 
1151
  inc ecx
-
 
1152
  mov edx,3
-
 
1153
  add edx,ted_wnd_l
-
 
1154
  rol edx,16
-
 
1155
  add edx,ted_wnd_t
-
 
1156
  add edx,ted_rec_t
-
 
1157
  @@:
-
 
1158
 
-
 
1159
push ebx ecx edx
-
 
1160
  ;left panel with numbers
-
 
1161
  mov ebx,ted_wnd_l
-
 
1162
  shl ebx,16
-
 
1163
  add ebx,ted_rec_l
-
 
1164
  mov ecx,ted_rec_h
-
 
1165
  rol ecx,16
-
 
1166
  mov cx,dx
-
 
1167
  rol ecx,16
-
 
1168
  mov eax,13
-
 
1169
  mov edx,ted_color_wnd_capt
-
 
1170
  int 0x40 ;ðèñóåì ïðÿìîóãîëüíèê ïîä íîìåðîì ñòðîêè
-
 
1171
pop edx ecx ebx
-
 
1172
 
-
 
1173
    mov eax,47
-
 
1174
    mov esi,ted_color_wnd_bord
-
 
1175
    int 0x40 ;ðèñóåì íîìåð ñòðîêè
-
 
1176
    inc ecx
-
 
1177
    add edx,ted_rec_h
-
 
1178
    sub edx,ted_wnd_t
-
 
1179
	mov esi,edx
-
 
1180
	and esi,0xffff
-
 
1181
    cmp esi,ted_wnd_h
-
 
1182
    jge @f
-
 
1183
    add edx,ted_wnd_t
-
 
1184
    jmp @b
335
  mov dword[edit2.top],eax ;=ted_wnd_t
1185
  @@:
336
  add dword[edit2.top],20
1186
 
337
 
Line 1187... Line -...
1187
  popad
-
 
1188
  ret
-
 
1189
endp
-
 
1190
  
-
 
1191
;this function need to optimize output
-
 
1192
align 4
-
 
1193
proc draw_cursor_sumb, edit:dword
-
 
1194
  push eax ecx edx edi
-
 
1195
  mov edi,dword[edit]
-
 
1196
 
-
 
1197
  mov eax,13 ;rect
-
 
1198
  mov ebx,ted_wnd_l
-
 
1199
  add ebx,ted_rec_l
-
 
1200
  mov edx,ted_cur_x
-
 
1201
  imul edx,ted_rec_w
-
 
1202
  add ebx,edx
-
 
1203
  shl ebx,16
-
 
1204
  add ebx,ted_rec_w
-
 
1205
 
-
 
1206
  mov ecx,ted_wnd_t ;calc rect -> y0,y1
-
 
1207
  add ecx,ted_rec_t
-
 
1208
  mov edx,ted_cur_y
-
 
1209
  imul edx,ted_rec_h
-
 
1210
  add ecx,edx
-
 
1211
  shl ecx,16
-
 
1212
  add ecx,ted_rec_h
-
 
1213
 
-
 
1214
  mov edx,ted_color_wnd_work
-
 
1215
  push ecx
-
 
1216
    stdcall SelNormalize,edi
-
 
1217
 
-
 
1218
    mov ecx,[wScr.position]
-
 
1219
    sub ted_seln_y0,ecx
-
 
1220
    sub ted_seln_y1,ecx
-
 
1221
 
-
 
1222
    mov ecx,ted_cur_y
-
 
1223
    cmp ecx,ted_seln_y0
-
 
1224
    jl .no_cur_sel
-
 
1225
    cmp ecx,ted_seln_y1
-
 
1226
    jg .no_cur_sel
-
 
1227
    mov edx,ted_color_select
-
 
1228
    
-
 
1229
    cmp ecx,ted_seln_y0
-
 
1230
    jne @f
-
 
1231
      mov ecx,ted_cur_x
-
 
1232
      add ecx,[hScr.position]
-
 
1233
      cmp ecx,ted_seln_x0
-
 
1234
      jge @f
-
 
1235
	mov edx,ted_color_wnd_work
-
 
1236
    @@:
-
 
1237
 
-
 
1238
    mov ecx,ted_cur_y
-
 
1239
    cmp ecx,ted_seln_y1
-
 
1240
    jne .no_cur_sel
-
 
1241
      mov ecx,ted_cur_x
-
 
1242
      add ecx,[hScr.position]
-
 
1243
      cmp ecx,ted_seln_x1
-
 
1244
      jl .no_cur_sel
-
 
1245
      mov edx,ted_color_wnd_work
-
 
1246
 
-
 
1247
    .no_cur_sel:
-
 
1248
  pop ecx
-
 
1249
  int 0x40
-
 
1250
 
-
 
1251
  call GetPos
-
 
1252
  cmp ted_gp_opt,2
-
 
1253
  jne @f
-
 
1254
    push esi
-
 
1255
    mov eax,4 ;draw text
-
 
1256
    mov esi,1
-
 
1257
    ror ecx,16
-
 
1258
    mov bx,cx
-
 
1259
    add ebx,0x10001
-
 
1260
    call GetSymbColor
-
 
1261
    call ConvertInvisSymb
-
 
1262
    int 0x40
-
 
1263
    pop esi
-
 
1264
  @@:
-
 
1265
 
-
 
1266
  pop edi edx ecx eax
-
 
1267
  ret
-
 
1268
endp
-
 
1269
 
-
 
1270
 
-
 
1271
;input:
-
 
1272
; edx -> pointer to text
-
 
1273
; edi -> óêàçàòåëü íà ñòðóêòóðó tedit
-
 
1274
;output:
-
 
1275
; ecx = color
-
 
1276
; if ted_mode_color=0 then ecx=ted_color_wnd_text
-
 
1277
align 4
-
 
1278
GetSymbColor:
-
 
1279
  mov ecx,ted_color_wnd_text ;çàäàåì öâåò òåêñòà ïî óìîë÷àíèþ
-
 
1280
 
-
 
1281
  push eax edx
-
 
1282
  cmp ted_mode_color,0
-
 
1283
  je .exit
-
 
1284
    jmp .on_first
-
 
1285
    @@:
-
 
1286
      call IteratPerv
-
 
1287
      cmp edx,ted_tex_1
-
 
1288
      jle .exit
-
 
1289
    .on_first:
-
 
1290
      xor eax,eax
-
 
1291
      mov al,byte[edx+1]
-
 
1292
      cmp al,0 ;åñëè al=0 òî öâåò íå ìåíÿåòñÿ
-
 
1293
    je @b
-
 
1294
 
-
 
1295
    cmp eax,ted_colors_text_count
-
 
1296
    jge .exit
-
 
1297
 
-
 
1298
    shl ax,2 ;óìíîæàåì èíäåêñ öâåòà íà 4 áàéòà
-
 
1299
    mov ecx,ted_text_colors ;ïðèáàâëÿåì ñìåùåíèå 1-ãî öâåòà
-
 
1300
    add ecx,eax
-
 
1301
    mov ecx,dword[ecx] ;óñòàíàâëèâàåì òåêóùèé öâåò òåêñòà ïî ñìåùåíèþ
-
 
1302
  .exit:
-
 
1303
  pop edx eax
-
 
1304
  ret
-
 
1305
 
-
 
1306
;input:
-
 
1307
; edx = pointer to text
-
 
1308
; edi = pointer to tedit struct
-
 
1309
align 4
-
 
1310
ConvertInvisSymb:
-
 
1311
  cmp ted_mode_invis,1
-
 
1312
  jne @f
-
 
1313
  cmp byte [edx],13
-
 
1314
  jne @f
-
 
1315
    mov edx,edi
-
 
1316
	add edx,ted_offs_symbol_new_line
338
  popad
1317
  @@:
339
  ret
1318
  ret
340
endp
1319
 
341
 
1320
;input:
342
;input:
Line 1332... Line 354...
1332
  add edx,3
354
		add edx,3
1333
  mov cx,bx
355
		mov cx,bx
1334
  shl ecx,16
356
		shl ecx,16
1335
  mov cx,19 ;=20-1
357
		mov cx,19 ;=20-1
1336
  mov bx,19 ;=20-1
358
		mov bx,19 ;=20-1
-
 
359
		mov esi,ebx
-
 
360
		shr esi,16
-
 
361
		add esi,20
-
 
362
		cmp esi,[procinfo.client_box.width]
-
 
363
		jge @f ;êíîïêà íå âëåçëà â ýêðàí
1337
  mov esi,[sc.work_button]
364
			mov esi,[sc.work_button]
-
 
365
			int 0x40 ;ñòàâèì êíîïêó
1338
  int 0x40
366
			mov eax,7 ;bmp
-
 
367
		@@:
1339
  pop esi edx ecx
368
	pop esi edx ecx
Line -... Line 369...
-
 
369
 
-
 
370
	cmp eax,7
1340
 
371
	jne @f ;êíîïêà íå âëåçëà â ýêðàí
1341
  mov ebx,ecx
372
	mov ebx,ecx
1342
  ror ebx,16
373
	ror ebx,16
1343
  cmp bx,0x4000
374
	cmp bx,0x4000
1344
  jne @f
-
 
1345
 
-
 
1346
  mov eax,7 ;bmp
375
	jne @f
1347
  mov ebx,[bmp_icon]
376
		mov ebx,[bmp_icon]
1348
  push ecx
377
		push ecx
1349
  and ecx,0xffff
378
		and ecx,0xffff
1350
  imul ecx,1200
379
		imul ecx,1200
1351
  add ebx,ecx
380
		add ebx,ecx
1352
  mov ecx,20
381
		mov ecx,20
1353
  shl ecx,16
382
		shl ecx,16
1354
  add ecx,20
383
		add ecx,20
1355
  int 0x40
384
		int 0x40 ;ñòàâèì ðèñóíîê íà êíîïêó
1356
  pop ecx
-
 
1357
 
385
		pop ecx
1358
  @@:
386
	@@:
1359
  pop ebx eax
387
	pop ebx eax