Subversion Repositories Kolibri OS

Rev

Rev 259 | Rev 280 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
259 mikedld 1
 
2
func draw_editor ;///// DRAW EDITOR //////////////////////////////////////////
267 mikedld 3
;-----------------------------------------------------------------------------
259 mikedld 4
5
 
267 mikedld 6
	mov	bx,word[cur_editor.Bounds.Right]
7
	sub	bx,word[cur_editor.Bounds.Left]
8
	inc	ebx
259 mikedld 9
	mov	ecx,[cur_editor.Bounds.Top-2]
267 mikedld 10
	mov	cx,word[cur_editor.Bounds.Bottom]
11
	sub	cx,word[cur_editor.Bounds.Top]
12
	inc	ecx
259 mikedld 13
	mov	edx,[cl_3d_inset]
14
	call	draw_framerect
15
@^
16
	mov	ebx,[cur_editor.Bounds.Left-2]
267 mikedld 17
	mov	bx,word[cur_editor.Bounds.Right]
18
	mov	ecx,[cur_editor.Bounds.Top-2]
19
	mov	cx,word[cur_editor.Bounds.Top]
20
	mcall	38,,,[cl_3d_inset]
259 mikedld 21
	mov	ecx,[cur_editor.Bounds.Bottom-2]
267 mikedld 22
	mov	cx,word[cur_editor.Bounds.Bottom]
23
	mcall
259 mikedld 24
	mov	bx,word[cur_editor.Bounds.Left]
267 mikedld 25
	mov	cx,word[cur_editor.Bounds.Top]
26
	mcall
259 mikedld 27
	mov	ebx,[cur_editor.Bounds.Right-2]
267 mikedld 28
	mov	bx,word[cur_editor.Bounds.Right]
29
	mov	cx,word[cur_editor.Bounds.Top]
30
	mcall
259 mikedld 31
^@
32
	mov	[cur_editor.Gutter.Visible],0
267 mikedld 33
	test	[options],OPTS_LINENUMS
259 mikedld 34
	jnz	@f
35
	xor	eax,eax ;! mov eax,2+LCHGW
36
	jmp	.lp1
37
    @@: inc	[cur_editor.Gutter.Visible]
267 mikedld 38
	mov	edi,p_info+100
259 mikedld 39
	mov	eax,[cur_editor.Lines.Count] ;! eax,[lines]
267 mikedld 40
	mov	ecx,10
259 mikedld 41
	call	uint2str
42
	lea	eax,[edi-p_info-100]
43
	cmp	eax,3
44
	jae	@f
45
	mov	eax,3
46
    @@: imul	eax,6
47
	add	eax,8
48
  .lp1: mov	[cur_editor.Gutter.Width],eax ;! [left_ofs],eax
267 mikedld 49
	mov	[left_ofs],eax
259 mikedld 50
51
 
52
	call	draw_editor_vscroll
53
	call	draw_editor_hscroll
54
	call	draw_editor_text
55
	call	draw_editor_caret
56
57
 
58
endf
59
60
 
61
func draw_editor_gutter ;///// DRAW EDITOR GUTTER (LEFT PANEL) ///////////////
267 mikedld 62
;-----------------------------------------------------------------------------
259 mikedld 63
	cmp	[cur_editor.Gutter.Visible],0
267 mikedld 64
	je	.exit
259 mikedld 65
66
 
67
68
 
267 mikedld 69
	mov	bx,word[cur_editor.Gutter.Width]
70
	add	ebx,0x00010000
259 mikedld 71
	mov	ecx,[cur_editor.Bounds.Top-2]
267 mikedld 72
	mov	cx,word[cur_editor.Bounds.Bottom]
73
	sub	cx,word[cur_editor.Bounds.Top]
74
	add	cx,-SCRLW
259 mikedld 75
	add	ecx,0x00010000
76
	dec	cx
77
	mcall	13,,,[cl_3d_normal]
78
79
 
267 mikedld 80
	push	bx
259 mikedld 81
	shl	ebx,16
82
	pop	bx
83
	add	ecx,[cur_editor.Bounds.Top]
267 mikedld 84
	mcall	38,,,[cl_3d_inset]
259 mikedld 85
86
 
87
	mov	bx,word[cur_editor.Bounds.Top]
267 mikedld 88
	add	bx,3
259 mikedld 89
	mov	edi,[sc.work_text]
90
	mov	ecx,[cur_editor.TopLeft.Y]
267 mikedld 91
	inc	ecx
259 mikedld 92
	mov	edx,p_info+100
93
    @@: pushad
94
	push	eax edx edi
95
	mov	eax,ecx
96
	mov	ecx,10
97
	mov	edi,edx
98
	call	uint2str
99
	mov	esi,edi
100
	pop	edi edx eax
101
	sub	esi,edx
102
	imul	eax,esi,6*65536
103
	sub	ebx,eax
104
	mcall	4,,edi
105
	popad
106
	add	ebx,LINEH
107
	inc	ecx
108
	cmp	ecx,[cur_editor.Lines.Count]
267 mikedld 109
	jg	@f
259 mikedld 110
	mov	esi,ecx
111
	sub	esi,[cur_editor.TopLeft.Y]
267 mikedld 112
	cmp	esi,[lines.scr]
259 mikedld 113
	jbe	@b
114
    @@: add	esp,4*8*2
115
116
 
117
	ret
118
endf
119
120
 
121
func draw_editor_vscroll ;///// DRAW EDITOR VERTICAL SCROLL BAR //////////////
267 mikedld 122
;-----------------------------------------------------------------------------
259 mikedld 123
	mov	ebx,[cur_editor.Bounds.Right]
267 mikedld 124
	shl	ebx,16
259 mikedld 125
	add	ebx,(-SCRLW)*65536+SCRLW
126
	mov	ecx,[cur_editor.Bounds.Top-2]
267 mikedld 127
	mov	cx,SCRLW
259 mikedld 128
	mcall	8,,,'VSL' or 0x40000000
267 mikedld 129
	pushad
259 mikedld 130
	sar	ebx,16
131
	sar	ecx,16
132
	push	ebx ecx SCRLW SCRLW
133
	call	draw_3d_panel
134
	popad
135
	mov	eax,8
136
137
 
138
	push	0x18
139
	shr	ecx,16
140
	mov	bx,cx
141
	add	ebx,(SCRLW/2-2)*65536+SCRLW/2-3
142
	mcall	4,,[sc.work_text],esp,1
143
	add	esp,4
144
	popad
145
146
 
267 mikedld 147
	shl	ecx,16
259 mikedld 148
	add	ecx,(-SCRLW*2)*65536+SCRLW
149
	mcall	,,,'VSG' or 0x40000000
267 mikedld 150
	pushad
259 mikedld 151
	sar	ebx,16
152
	sar	ecx,16
153
	push	ebx ecx SCRLW SCRLW
154
	call	draw_3d_panel
155
	popad
156
	mov	eax,8
157
158
 
159
	push	0x19
160
	shr	ecx,16
161
	mov	bx,cx
162
	add	ebx,(SCRLW/2-2)*65536+SCRLW/2-3
163
	mcall	4,,[sc.work_text],esp,1
164
	add	esp,4
165
	popad
166
167
 
168
	mov	eax,[cur_editor.Lines.Count]
267 mikedld 169
	mov	ebx,[lines.scr]
259 mikedld 170
	mov	ecx,[cur_editor.TopLeft.Y]
267 mikedld 171
	mov	edx,[cur_editor.Bounds.Bottom]
172
	sub	edx,[cur_editor.Bounds.Top]
173
	add	edx,-SCRLW*3+1
259 mikedld 174
	call	get_scroll_vars
175
	mov	[cur_editor.VScroll.Top],eax
267 mikedld 176
	mov	[cur_editor.VScroll.Size],ebx
177
	pop	ebx
259 mikedld 178
179
 
180
	add	ecx,[cur_editor.Bounds.Top]
267 mikedld 181
	add	ecx,SCRLW+1
259 mikedld 182
183
 
184
	sar	ebx,16
185
	push	ebx ecx SCRLW [cur_editor.VScroll.Size]
267 mikedld 186
	dec	dword[esp]
259 mikedld 187
	call	draw_3d_panel
188
	popad
189
	mov	eax,13
190
	add	ebx,1*65536-1
191
192
 
267 mikedld 193
	mov	cx,word[cur_editor.VScroll.Top]
194
	add	ecx,(SCRLW+1)*65536
259 mikedld 195
	mov	edx,[sc.work]
196
	or	cx,cx
197
	jle	@f
198
	mcall	13
199
    @@:
200
	mov	ecx,[cur_editor.Bounds.Top]
267 mikedld 201
	add	ecx,[cur_editor.VScroll.Top]
202
	add	ecx,[cur_editor.VScroll.Size]
203
	add	ecx,SCRLW+1
259 mikedld 204
	mov	di,cx
205
	shl	ecx,16
206
	mov	cx,word[cur_editor.Bounds.Bottom]
267 mikedld 207
	sub	cx,di
259 mikedld 208
	sub	cx,SCRLW*2;+1
209
	jle	@f
210
	mcall
211
    @@:
212
	rol	ebx,16
213
	dec	bx
214
	push	bx
215
	rol	ebx,16
216
	pop	bx
217
	mov	ecx,[cur_editor.Bounds.Top-2]
267 mikedld 218
	mov	cx,word[cur_editor.Bounds.Bottom]
219
	add	ecx,(SCRLW)*65536-SCRLW*2-1
259 mikedld 220
	mcall	38,,,[cl_3d_inset]
221
222
 
223
endf
224
225
 
226
func draw_editor_hscroll ;///// DRAW EDITOR HORIZONTAL SCROLL BAR ////////////
267 mikedld 227
;-----------------------------------------------------------------------------
259 mikedld 228
	mov	ebx,[cur_editor.Bounds.Left-2]
267 mikedld 229
	mov	bx,SCRLW
259 mikedld 230
	mov	ecx,[cur_editor.Bounds.Bottom]
267 mikedld 231
	shl	ecx,16
259 mikedld 232
	add	ecx,(-SCRLW)*65536+SCRLW
233
	mcall	8,,,'HSL' or 0x40000000
267 mikedld 234
	pushad
259 mikedld 235
	sar	ebx,16
236
	sar	ecx,16
237
	push	ebx ecx SCRLW SCRLW
238
	call	draw_3d_panel
239
	popad
240
241
 
242
	push	0x1B
243
	shr	ecx,16
244
	mov	bx,cx
245
	add	ebx,(SCRLW/2-2)*65536+SCRLW/2-3
246
	mcall	4,,[sc.work_text],esp,1
247
	add	esp,4
248
	popad
249
250
 
267 mikedld 251
	shl	ebx,16
259 mikedld 252
	add	ebx,(-SCRLW*2)*65536+SCRLW
253
	mcall	8,,,'HSG' or 0x40000000
267 mikedld 254
	pushad
259 mikedld 255
	sar	ebx,16
256
	sar	ecx,16
257
	push	ebx ecx SCRLW SCRLW
258
	call	draw_3d_panel
259
	popad
260
261
 
262
	push	0x1A
263
	shr	ecx,16
264
	mov	bx,cx
265
	add	ebx,(SCRLW/2-2)*65536+SCRLW/2-3
266
	mcall	4,,[sc.work_text],esp,1
267
	add	esp,4
268
	popad
269
270
 
271
	mov	eax,[cur_editor.Columns.Count]
267 mikedld 272
	mov	ebx,[columns.scr]
259 mikedld 273
	mov	ecx,[cur_editor.TopLeft.X]
267 mikedld 274
	mov	edx,[cur_editor.Bounds.Right]
275
	add	edx,-(SCRLW*3)
259 mikedld 276
	call	get_scroll_vars
277
	mov	[cur_editor.HScroll.Top],eax
267 mikedld 278
	mov	[cur_editor.HScroll.Size],ebx
279
	pop	ecx
259 mikedld 280
281
 
282
	add	ebx,[cur_editor.Bounds.Left]
267 mikedld 283
	add	ebx,SCRLW+1
259 mikedld 284
	shl	ebx,16
285
	mov	bx,word[cur_editor.HScroll.Size]
267 mikedld 286
259 mikedld 287
 
288
	sar	ecx,16
289
	rol	ebx,16
290
	movsx	eax,bx
291
	sar	ebx,16
292
	dec	ebx
293
	push	eax ecx ebx SCRLW
294
	call	draw_3d_panel
295
	popad
296
	add	ecx,1*65536-1
297
298
 
267 mikedld 299
	mov	bx,word[cur_editor.Bounds.Left]
300
	mov	bx,word[cur_editor.HScroll.Top]
301
	add	ebx,(1+SCRLW)*65536
259 mikedld 302
	mcall	13,,,[sc.work]
303
	mov	ebx,[cur_editor.Bounds.Left]
267 mikedld 304
	add	ebx,1+SCRLW
259 mikedld 305
	add	ebx,[cur_editor.HScroll.Top]
267 mikedld 306
	add	ebx,[cur_editor.HScroll.Size]
307
	mov	di,bx
259 mikedld 308
	shl	ebx,16
309
	mov	bx,word[cur_editor.Bounds.Right]
267 mikedld 310
	sub	bx,di
259 mikedld 311
	sub	bx,SCRLW*2
312
	jle	@f
313
	mcall
314
    @@:
315
	mov	ebx,[cur_editor.Bounds.Left-2]
267 mikedld 316
	mov	bx,word[cur_editor.Bounds.Right]
317
	add	ebx,(SCRLW)*65536-SCRLW*2-1
259 mikedld 318
	rol	ecx,16
319
	dec	cx
320
	push	cx
321
	rol	ecx,16
322
	pop	cx
323
	mcall	38,,,[cl_3d_inset]
324
325
 
326
endf
327
328
 
329
func draw_editor_text ;///// DRAW EDITOR TEXT ////////////////////////////////
267 mikedld 330
;-----------------------------------------------------------------------------
259 mikedld 331
	mov	eax,[cur_editor.Bounds.Bottom]
267 mikedld 332
	sub	eax,[cur_editor.Bounds.Top]
333
	cmp	eax,LINEH
259 mikedld 334
	jge	@f
335
	ret
336
    @@:
337
	call	init_sel_vars
338
	call	check_bottom_right
339
340
 
341
342
 
267 mikedld 343
	add	eax,[cur_editor.Gutter.Width]
344
	add	eax,LCHGW+3
259 mikedld 345
	mov	[left_ofs],eax
346
	mov	eax,[cur_editor.Bounds.Top]
267 mikedld 347
	add	eax,3
259 mikedld 348
	mov	[top_ofs],eax
349
350
 
351
	add	ebx,[left_ofs-2]
352
353
 
267 mikedld 354
	push	ecx
259 mikedld 355
	call	get_line_offset
356
357
 
358
	add	esp,4
359
	mov	ecx,[lines.scr]
360
	or	ecx,ecx
361
	jle	.exit
362
	add	esp,-4
363
364
 
267 mikedld 365
	mov	eax,[lines.scr]
259 mikedld 366
	sub	eax,[cur_editor.Lines.Count] ;! eax,[lines]
267 mikedld 367
	mov	[draw_blines],eax
259 mikedld 368
369
 
370
371
 
372
373
 
374
	shl	ecx,16
375
	mov	cl,LINEH
376
	mov	ebx,[cur_editor.Bounds.Right]
267 mikedld 377
	;sub     ebx,[cur_editor.Bounds.Left]
378
	add	ebx,-SCRLW
259 mikedld 379
	add	ebx,[left_ofs-2]
380
	sub	ebx,[left_ofs]
381
	add	ebx,-2*65536+2
382
383
 
384
	mov	[in_sel],0
385
	mov	edx,[color_tbl+4*5]
386
	mov	eax,[esp+4*2]
387
	cmp	eax,[sel.begin.y]
388
	jl	.lp6
389
	je	.lp1
390
	cmp	eax,[sel.end.y]
391
	jg	.lp6
392
	je	.lp3
393
	jmp	.lp6.2
394
  .lp1: mov	eax,[sel.begin.y]
395
	cmp	eax,[sel.end.y]
396
	je	.lp5
397
  .lp2: mov	eax,[sel.begin.x]
398
	sub	eax,[cur_editor.TopLeft.X] ;! eax,[left_col]
267 mikedld 399
	jle	.lp6.2
259 mikedld 400
	cmp	eax,[columns.scr]
401
	jge	.lp6
402
	imul	eax,6
403
	pushad
404
	sub	bx,ax
405
	rol	ebx,16
406
	mov	bx,ax
407
	add	ebx,[left_ofs]
408
	add	ebx,-2
409
	rol	ebx,16
410
	mov	edx,[color_tbl+4*7]
411
	mcall	13
412
	popad
413
	mov	bx,ax
414
	mov	[in_sel],2
415
	jmp	.lp6
416
  .lp3: mov	eax,[sel.begin.y]
417
	cmp	eax,[sel.end.y]
418
	je	.lp5
419
  .lp4: mov	eax,[sel.end.x]
420
	sub	eax,[cur_editor.TopLeft.X] ;! eax,[left_col]
267 mikedld 421
	jle	.lp6
259 mikedld 422
	cmp	eax,[columns.scr]
423
	jg	.lp6.2
424
	imul	eax,6
425
	pushad
426
	sub	bx,ax
427
	rol	ebx,16
428
	add	eax,[left_ofs];OLEFT-1
429
	add	eax,-2
430
	mov	bx,ax
431
	rol	ebx,16
432
	mcall	13
433
	popad
434
	inc	eax
435
	mov	edx,[color_tbl+4*7]
436
	mov	bx,ax
437
	mov	[in_sel],3
438
	jmp	.lp6
439
  .lp5: mov	eax,[cur_editor.TopLeft.X] ;! eax,[left_col]
267 mikedld 440
	cmp	eax,[sel.begin.x]
259 mikedld 441
	jge	.lp4
442
	add	eax,[columns.scr]
443
	cmp	eax,[sel.end.x]
444
	jl	.lp2
445
	mov	eax,[sel.begin.x]
446
	cmp	eax,[sel.end.x]
447
	je	.lp6
448
	sub	eax,[cur_editor.TopLeft.X] ;! eax,[left_col]
267 mikedld 449
	imul	eax,6
259 mikedld 450
	pushad
451
	mov	ebx,[sel.end.x]
452
	sub	ebx,[sel.begin.x]
453
	imul	ebx,6
454
	sal	ebx,16
455
	dec	eax
456
	add	eax,[left_ofs]
457
	mov	bx,ax
458
	rol	ebx,16
459
	mov	edx,[color_tbl+4*7]
460
	mcall	13
461
	movzx	eax,bx
462
	sar	ebx,16
463
	add	eax,ebx
464
	mov	ebx,eax
465
	sal	ebx,16
466
	sub	ax,[esp+4*4]
467
	neg	ax
468
	add	ax,word[left_ofs]
469
	add	ax,-2
470
	mov	bx,ax
471
	mov	edx,[color_tbl+4*5]
472
	mcall	13
473
	popad
474
	mov	bx,ax
475
	mov	[in_sel],4
476
	jmp	.lp6
477
478
 
479
	mov	edx,[color_tbl+4*7]
480
	inc	[in_sel]
481
  .lp6:
482
	mcall	13
483
484
 
485
486
 
487
	mov	edx,[color_tbl+4*5]
488
	test	eax,0x00010000
489
	jz	@f
490
	mov	edx,[color_tbl+4*8]
491
	test	eax,0x00020000
492
	jz	@f
493
	mov	edx,[color_tbl+4*9]
494
    @@: mov	ebx,[left_ofs]
495
267 mikedld 496
 
259 mikedld 497
	shl	ebx,16
498
	mov	bx,LCHGW
499
	mcall	13
500
	popad
501
502
 
503
	and	eax,0x0000FFFF
504
	mov	[cur_line_len],eax
505
506
 
507
	ja	.next_block
508
	add	esp,4*2
509
	jmp	.exit ; .draw_cursor
510
511
 
512
513
 
514
	call	get_next_part
515
	pop	ebx
516
517
 
518
	mov	ecx,eax
519
520
 
521
	mov	eax,ebx
522
	sub	ebx,[cur_editor.TopLeft.X] ;! ebx,[left_col]
267 mikedld 523
	cmp	ebx,[columns.scr]
259 mikedld 524
	jge	.skip_t
525
	add	ebx,esi
526
	jle	.skip_t
527
	mov	ebx,[esp+8+4*2] ;// 4*2=esi+ebx
528
	sub	eax,[cur_editor.TopLeft.X] ;! eax,[left_col]
267 mikedld 529
	jge	.qqq
259 mikedld 530
	sub	edx,eax
531
	add	esi,eax
532
;       mov     eax,OLEFT*65536
533
	xor	eax,eax
534
	jmp	.qqq2
535
  .qqq:
536
;       inc     eax
537
	imul	eax,6*65536
538
  .qqq2:
539
	and	ebx,0x0000FFFF
540
	add	eax,[left_ofs-2];OLEFT*65536
541
	add	ebx,eax
542
543
 
544
	add	eax,[esp+4] ; esi
545
	sub	eax,[cur_editor.TopLeft.X] ;! eax,[left_col]
267 mikedld 546
	sub	eax,[columns.scr]
259 mikedld 547
	jle	.qweqwe
548
	sub	esi,eax
549
  .qweqwe:
550
551
 
552
	cmp	al,0
553
	je	.draw_t
554
	dec	al
555
	jz	.ya4
556
  .nt1: dec	al
557
	jnz	.nt2
558
	mov	eax,[esp]
559
	cmp	eax,[sel.begin.x]
560
	jge	.ya4
561
	add	eax,[esp+4]
562
	cmp	eax,[sel.begin.x]
563
	jl	.draw_t
564
;---[ selection crosses block from the right ]-(-
565
  .ya1: mov	eax,esi
566
	mov	esi,[sel.begin.x]
567
	sub	esi,[esp]
568
	pushad
569
	mov	ecx,[cur_editor.TopLeft.X] ;! ecx,[left_col]
267 mikedld 570
	sub	ecx,[esp+4*8]
259 mikedld 571
	jle	@f
572
	sub	esi,ecx
573
	sub	[esp+4],ecx
574
    @@: sub	eax,esi
575
	add	edx,esi
576
	imul	esi,6
577
	rol	ebx,16
578
	add	bx,si
579
	rol	ebx,16
580
	mov	esi,eax
581
	mov	ecx,[color_tbl+4*6]
582
	mcall	4
583
	popad
584
	jmp	.draw_t
585
;----------------------------------------------)-
586
  .nt2: dec	al
587
	jnz	.nt3
588
	mov	eax,[esp]
589
	cmp	eax,[sel.end.x]
590
	jge	.draw_t
591
	add	eax,[esp+4]
592
	cmp	eax,[sel.end.x]
593
	jl	.ya4
594
;---[ selection crosses block from the left ]--(-
595
  .ya2: mov	eax,[sel.end.x]
596
	sub	eax,[esp]
597
	push	ebx
598
	mov	ebx,[esp+4]
599
	sub	ebx,[cur_editor.TopLeft.X] ;! ebx,[left_col]
267 mikedld 600
	jge	.ya2.1
259 mikedld 601
	add	eax,ebx
602
  .ya2.1:
603
	pop	ebx
604
	pushad
605
	mov	esi,eax
606
	mov	ecx,[color_tbl+4*6]
607
	mcall	4
608
	popad
609
	sub	esi,eax
610
	add	edx,eax
611
	imul	eax,6*65536
612
	add	ebx,eax
613
	jmp	.draw_t
614
;----------------------------------------------)-
615
  .nt3: mov	eax,[esp]
616
	cmp	eax,[sel.end.x]
617
	jge	.draw_t
618
	cmp	eax,[sel.begin.x]
619
	jge	@f
620
	add	eax,[esp+4]
621
	cmp	eax,[sel.begin.x]
622
	jl	.draw_t
623
	cmp	eax,[sel.end.x]
624
	jl	.ya1
625
;---[ selection inside block ]-----------------(-
626
	mov	eax,esi
627
	mov	esi,[sel.begin.x]
628
	sub	esi,[esp]
629
	push	eax
630
	mov	eax,[esp+4]
631
	sub	eax,[cur_editor.TopLeft.X] ;! eax,[left_col]
267 mikedld 632
	jge	.nt3.1
259 mikedld 633
	add	esi,eax
634
  .nt3.1:
635
	pop	eax
636
	sub	eax,esi
637
	pushad
638
	add	edx,esi
639
	imul	esi,6*65536
640
	add	ebx,esi
641
	mov	esi,[sel.end.x]
642
	sub	esi,[sel.begin.x]
643
	mov	ecx,[color_tbl+4*6]
644
	sub	eax,esi
645
	push	eax
646
	mcall	4
647
	add	edx,esi
648
	imul	esi,6*65536
649
	add	ebx,esi
650
	pop	esi
651
	mov	ecx,[esp+4*6]
652
	mcall	4
653
	popad
654
	jmp	.draw_t
655
;----------------------------------------------)-
656
    @@: add	eax,esi
657
	dec	eax
658
	cmp	eax,[sel.end.x]
659
	jge	.ya2
660
;---[ block inside selection ]-----------------(-
661
  .ya4: mov	ecx,[color_tbl+4*6]
662
;----------------------------------------------)-
663
664
 
665
	mcall	4;[esp+8]
666
  .skip_t:
667
	pop	eax eax ; ebx esi
668
	imul	eax,6
669
	add	[esp+4*2+2],ax
670
	pop	ecx esi
671
	cmp	ecx,[cur_line_len];LINE_WIDTH
672
	jl	.next_block
673
674
 
675
	and	ebx,0x0000FFFF
676
	add	ebx,[left_ofs-2]
677
	add	ebx,LINEH
678
	add	esi,[cur_line_len];LINE_WIDTH
679
	inc	dword[esp]
680
	dec	ecx
681
	jg	.next_line
682
683
 
684
685
 
686
	jl	@f
687
	mov	ecx,[esp-8]
688
	shl	ecx,16
689
	mov	cx,word[cur_editor.Bounds.Bottom]
267 mikedld 690
	sub	cx,[esp-8]
259 mikedld 691
	add	cx,-SCRLW
692
	mov	eax,[cur_editor.Bounds.Left]
267 mikedld 693
	add	eax,[cur_editor.Gutter.Width]
694
	inc	eax
259 mikedld 695
	mov	ebx,eax
696
	shl	ebx,16
697
	mov	bx,word[cur_editor.Bounds.Right]
267 mikedld 698
	sub	bx,ax
259 mikedld 699
	add	ebx,-SCRLW
700
	mcall	13,,,[color_tbl+4*5]
701
    @@:
702
703
 
704
	add	esp,4
705
	ret
706
endf
707
708
 
709
func draw_editor_caret ;///// DRAW EDITOR TEXT CARET /////////////////////////
267 mikedld 710
;-----------------------------------------------------------------------------
259 mikedld 711
	cmp	[bot_mode],0
712
	jne	@f
713
	mov	ebx,[cur_editor.Caret.X]
267 mikedld 714
	sub	ebx,[cur_editor.TopLeft.X]
715
	js	@f
259 mikedld 716
	cmp	ebx,[columns.scr]
717
	ja	@f
718
	imul	ebx,6
719
	add	ebx,[left_ofs]
720
	dec	ebx
721
	push	bx
722
	shl	ebx,16
723
	pop	bx
724
	mov	eax,[cur_editor.Caret.Y]
267 mikedld 725
	sub	eax,[cur_editor.TopLeft.Y]
726
	js	@f
259 mikedld 727
	cmp	eax,[lines.scr]
728
	jge	@f
729
	imul	eax,LINEH
730
	add	eax,[top_ofs]
731
	mov	esi,eax
732
	shl	esi,16
733
	add	eax,LINEH-2
734
	mov	si,ax
735
	mov	ecx,2
736
	cmp	[ins_mode],0
737
	jne	.lp8
738
	add	cl,4
739
  .lp8: push	ecx
740
	mcall	38,,esi,0x01000000
741
	add	ebx,0x00010001
742
	pop	ecx
743
	loop	.lp8
744
    @@:
745
	ret
746
endf
747