Subversion Repositories Kolibri OS

Rev

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

Rev 178 Rev 259
Line 8... Line 8...
8
    @@:
8
    @@:
Line 9... Line 9...
9
 
9
 
10
	mcall	48,3,sc,sizeof.system_colors
10
	mcall	48,3,sc,sizeof.system_colors
Line 11... Line -...
11
	call	calc_3d_colors
-
 
12
 
-
 
13
	test	[options],OPTS_LINENUMS
-
 
14
	jnz	@f
-
 
15
	mov	eax,2+LCHGW
-
 
16
	jmp	.lp1
-
 
17
    @@: mov	edi,p_info+100
-
 
18
	mov	eax,[lines]
-
 
19
	mov	ecx,10
-
 
20
	call	uint2str
-
 
21
	lea	eax,[edi-p_info-100]
-
 
22
	cmp	eax,3
-
 
23
	jae	@f
-
 
24
	mov	eax,3
-
 
25
    @@: imul	eax,6
-
 
26
	add	eax,2+4+LCHGW
-
 
27
  .lp1: mov	[left_ofs],eax
11
	call	calc_3d_colors
Line 28... Line 12...
28
 
12
 
29
	mcall	12,1
13
	mcall	12,1
Line 48... Line 32...
48
 
32
 
49
;	mcall	9,p_info,-1
33
;       mcall   9,p_info,-1
50
	cmp	[p_info.client_box.height],LINEH
34
	cmp	[p_info.client_box.height],LINEH
Line -... Line 35...
-
 
35
	jl	.exit.2
-
 
36
 
-
 
37
;++ calculate editor bounds ++
-
 
38
	mov	[tab_bar.Bounds.Left],0
-
 
39
	mov	[tab_bar.Bounds.Top],ATOPH
-
 
40
	mov	eax,[p_info.client_box.width]
-
 
41
	mov	[tab_bar.Bounds.Right],eax
-
 
42
	mov	eax,[p_info.client_box.height]
-
 
43
	sub	eax,[bot_dlg_height]
-
 
44
	add	eax,-STATH-1
-
 
45
	mov	[tab_bar.Bounds.Bottom],eax
-
 
46
 
51
	jl	.exit.2
47
	call	align_editor_in_tab
Line 52... Line 48...
52
 
48
 
53
	mov	[top_ofs],ATOPH;+1
49
	mov	[top_ofs],ATOPH;+1
-
 
50
 
54
 
51
	mov	eax,[cur_tab.Editor.Bounds.Right]
55
	mov	eax,[p_info.client_box.width]
52
	sub	eax,[cur_tab.Editor.Bounds.Left]
56
	sub	eax,SCRLW+1
53
	sub	eax,[cur_tab.Editor.Gutter.Width]
57
	sub	eax,[left_ofs]
54
	sub	eax,SCRLW+LCHGW+4
58
	cdq
55
	cdq
Line -... Line 56...
-
 
56
	mov	ebx,6
-
 
57
	div	ebx
-
 
58
	mov	[columns.scr],eax
-
 
59
 
-
 
60
	mov	eax,[cur_tab.Editor.Bounds.Bottom]
-
 
61
	sub	eax,[cur_tab.Editor.Bounds.Top]
-
 
62
	sub	eax,SCRLW+3
-
 
63
	cdq
59
	mov	ebx,6
64
	mov	ebx,LINEH
60
	div	ebx
65
	div	ebx
61
	mov	[columns.scr],eax
66
	mov	[lines.scr],eax
62
 
67
 
Line 63... Line 68...
63
	mov	eax,[p_info.client_box.height] ; calculate buttons position
68
	mov	eax,[p_info.client_box.height]
Line 64... Line 69...
64
	add	eax,-STATH;*3-2-2
69
	add	eax,-STATH+1;*3-2-2
65
	sub	eax,[bot_dlg_height]
-
 
66
	mov	[bot_ofs],eax
-
 
67
 
-
 
68
	call	draw_bottom_dialog
-
 
69
 
-
 
Line -... Line 70...
-
 
70
	sub	eax,[bot_dlg_height]
-
 
71
	mov	[bot_ofs],eax
-
 
72
 
-
 
73
	call	draw_bottom_dialog
-
 
74
 
70
	mov	[do_not_draw],1 ; do_not_draw = true
75
;        mov     [do_not_draw],1 ; do_not_draw = true
71
 
76
 
72
	mov	ebx,eax
77
;        mov     ebx,eax
73
	sub	ebx,[top_ofs]
78
;        sub     ebx,[top_ofs]
74
	sub	ebx,SCRLW*3+AMINS+5
79
;        sub     ebx,SCRLW*3+AMINS+5
75
	js	.no_draw
80
;        js      .no_draw
76
 
81
 
Line -... Line 82...
-
 
82
;        dec     [do_not_draw]    ; do_not_draw = false
77
	dec	[do_not_draw]	 ; do_not_draw = false
83
;        sub     eax,SCRLW+3
78
	sub	eax,SCRLW+3
84
;        sub     eax,[top_ofs]
79
	sub	eax,[top_ofs]
85
;        cdq
80
	cdq
86
;        mov     ebx,LINEH
81
	mov	ebx,LINEH
87
;        div     ebx
82
	div	ebx
88
;        mov     [lines.scr],eax
83
	mov	[lines.scr],eax
89
 
84
 
90
;-- horizontal lines for menubar and statusbar --
85
	mov	ebx,[p_info.client_box.width]
91
	;mov     ebx,[p_info.client_box.width]
86
	mov	ecx,[top_ofs-2]
92
	;mov     ecx,[top_ofs-2]
87
	mov	cx,word[top_ofs]
93
	;mov     cx,word[top_ofs]
Line 88... Line 94...
88
	sub	ecx,1*65536+1
94
	;sub     ecx,1*65536+1
Line 89... Line 95...
89
	mcall	38,,,[cl_3d_inset];[sc.work_text]
95
	;mcall   38,,,[cl_3d_inset];[sc.work_text]
Line 132... Line 138...
132
	idiv	ebx
138
	idiv	ebx
133
	mov	[columns.scr],eax
139
	mov	[columns.scr],eax
134
    @@:
140
    @@:
Line 135... Line 141...
135
 
141
 
-
 
142
  .exit:
136
  .exit:
143
;-- draw file --
-
 
144
	;call    draw_file
-
 
145
;++ draw editor control ++
-
 
146
	call	draw_editor
137
	call	draw_file
147
	call	draw_tabctl
138
  .exit.2:
148
  .exit.2:
139
	mcall	12,2
149
	mcall	12,2
140
	ret
150
	ret
Line 175... Line 185...
175
;-----------------------------------------------------------------------------
185
;-----------------------------------------------------------------------------
176
	mov	ebx,[p_info.client_box.width]
186
	mov	ebx,[p_info.client_box.width]
177
	inc	ebx
187
	inc	ebx
178
	mcall	13,,ATOPH-1,[cl_3d_normal]
188
	mcall	13,,ATOPH-1,[cl_3d_normal]
Line -... Line 189...
-
 
189
 
-
 
190
	mcall	38,[p_info.client_box.width],,[sc.frame];[cl_3d_pushed]
179
 
191
 
180
	mov	edx,main_menu
192
	mov	edx,main_menu
181
	mov	ebx,9*65536+ATOPH/2-4
193
	mov	ebx,9*65536+ATOPH/2-4
182
	mov	ecx,[sc.work_text]
194
	mov	ecx,[sc.work_text]
183
	mov	[mi_sel],0
195
	mov	[mi_sel],0
Line 218... Line 230...
218
;-----------------------------------------------------------------------------
230
;-----------------------------------------------------------------------------
219
; Input:
231
; Input:
220
;  EAX = start line
232
;  EAX = start line
221
;  EBX = end line
233
;  EBX = end line
222
;-----------------------------------------------------------------------------
234
;-----------------------------------------------------------------------------
-
 
235
	call	draw_editor;_text
-
 
236
	ret
-
 
237
macro unused {
223
	cmp	[p_info.client_box.height],LINEH
238
	cmp	[p_info.client_box.height],LINEH
224
	jge	@f
239
	jge	@f
225
	ret
240
	ret
226
    @@:
241
    @@:
227
	call	init_sel_vars
242
	call	init_sel_vars
Line 233... Line 248...
233
	jle	draw_file.exit
248
	jle	draw_file.exit
Line 234... Line 249...
234
 
249
 
235
	cmp	eax,ebx
250
	cmp	eax,ebx
236
	jle	@f
251
	jle	@f
237
	xchg	eax,ebx
252
	xchg	eax,ebx
238
    @@: cmp	eax,[top_line]
253
    @@: cmp	eax,[cur_tab.Editor.TopLeft.Y] ;! eax,[top_line]
239
	jge	@f
254
	jge	@f
240
	mov	eax,[top_line]
255
	mov	eax,[cur_tab.Editor.TopLeft.Y] ;! eax,[top_line]
241
    @@: mov	ecx,[top_line]
256
    @@: mov	ecx,[cur_tab.Editor.TopLeft.Y] ;! ecx,[top_line]
242
	add	ecx,[lines.scr]
257
	add	ecx,[lines.scr]
243
	cmp	ebx,ecx
258
	cmp	ebx,ecx
244
	jl	@f
259
	jl	@f
245
	dec	ecx
260
	dec	ecx
Line 256... Line 271...
256
	sub	ecx,eax
271
	sub	ecx,eax
257
	inc	ecx
272
	inc	ecx
Line 258... Line 273...
258
 
273
 
259
	mov	ebx,[top_ofs]
274
	mov	ebx,[top_ofs]
260
	add	ebx,[left_ofs-2]
275
	add	ebx,[left_ofs-2]
261
	sub	eax,[top_line]
276
	sub	eax,[cur_tab.Editor.TopLeft.Y] ;! eax,[top_line]
262
	imul	eax,LINEH
277
	imul	eax,LINEH
Line 263... Line 278...
263
	add	ebx,eax
278
	add	ebx,eax
264
 
279
 
Line 265... Line 280...
265
	imul	ebp,[left_col],6*65536
280
	imul	ebp,[cur_tab.Editor.TopLeft.X],6*65536 ;! ebp,[left_col],6*65536
-
 
281
	or	[draw_blines],-1
266
	or	[draw_blines],-1
282
 
Line 267... Line 283...
267
 
283
	jmp	draw_file.next_line
268
	jmp	draw_file.next_line
284
}
269
endf
285
endf
-
 
286
 
-
 
287
;-----------------------------------------------------------------------------
-
 
288
func draw_file ;//////////////////////////////////////////////////////////////
270
 
289
;-----------------------------------------------------------------------------
271
;-----------------------------------------------------------------------------
290
	call	draw_editor;_text
272
func draw_file ;//////////////////////////////////////////////////////////////
291
	ret
273
;-----------------------------------------------------------------------------
292
macro unused {
274
	cmp	[p_info.client_box.height],LINEH
293
	cmp	[p_info.client_box.height],LINEH
Line 281... Line 300...
281
	pushad
300
	pushad
Line 282... Line 301...
282
 
301
 
283
	mov	ebx,[top_ofs]
302
	mov	ebx,[top_ofs]
Line 284... Line 303...
284
	add	ebx,[left_ofs-2]
303
	add	ebx,[left_ofs-2]
285
 
304
 
286
	mov	ecx,[top_line]
305
	mov	ecx,[cur_tab.Editor.TopLeft.Y] ;! ecx,[top_line]
Line 287... Line 306...
287
	push	ecx
306
	push	ecx
288
	call	get_line_offset
307
	call	get_line_offset
289
 
308
 
290
  .start:
309
  .start:
291
	add	esp,4
310
	add	esp,4
292
	mov	ecx,[lines.scr]
311
	mov	ecx,[lines.scr]
Line 293... Line 312...
293
	or	ecx,ecx
312
	or	ecx,ecx
294
	jle	.exit
313
	jle	.exit
295
	add	esp,-4
314
	add	esp,-4
296
 
315
 
Line 297... Line 316...
297
	imul	ebp,[left_col],6*65536
316
	imul	ebp,[cur_tab.Editor.TopLeft.X],6*65536 ;! ebp,[left_col],6*65536
Line 298... Line 317...
298
	mov	eax,[lines.scr]
317
	mov	eax,[lines.scr]
Line 325... Line 344...
325
	jmp	.lp6.2
344
	jmp	.lp6.2
326
  .lp1: mov	eax,[sel.begin.y]
345
  .lp1: mov	eax,[sel.begin.y]
327
	cmp	eax,[sel.end.y]
346
	cmp	eax,[sel.end.y]
328
	je	.lp5
347
	je	.lp5
329
  .lp2: mov	eax,[sel.begin.x]
348
  .lp2: mov	eax,[sel.begin.x]
330
	sub	eax,[left_col]
349
	sub	eax,[cur_tab.Editor.TopLeft.X] ;! eax,[left_col]
331
	jle	.lp6.2
350
	jle	.lp6.2
332
	cmp	eax,[columns.scr]
351
	cmp	eax,[columns.scr]
333
	jge	.lp6
352
	jge	.lp6
334
	imul	eax,6
353
	imul	eax,6
335
	pushad
354
	pushad
Line 348... Line 367...
348
	jmp	.lp6
367
	jmp	.lp6
349
  .lp3: mov	eax,[sel.begin.y]
368
  .lp3: mov	eax,[sel.begin.y]
350
	cmp	eax,[sel.end.y]
369
	cmp	eax,[sel.end.y]
351
	je	.lp5
370
	je	.lp5
352
  .lp4: mov	eax,[sel.end.x]
371
  .lp4: mov	eax,[sel.end.x]
353
	sub	eax,[left_col]
372
	sub	eax,[cur_tab.Editor.TopLeft.X] ;! eax,[left_col]
354
	jle	.lp6
373
	jle	.lp6
355
	cmp	eax,[columns.scr]
374
	cmp	eax,[columns.scr]
356
	jg	.lp6.2
375
	jg	.lp6.2
357
	imul	eax,6
376
	imul	eax,6
358
	pushad
377
	pushad
Line 367... Line 386...
367
	popad
386
	popad
368
	mov	edx,[color_tbl+4*7]
387
	mov	edx,[color_tbl+4*7]
369
	mov	bx,ax
388
	mov	bx,ax
370
	mov	[in_sel],3
389
	mov	[in_sel],3
371
	jmp	.lp6
390
	jmp	.lp6
372
  .lp5: mov	eax,[left_col]
391
  .lp5: mov	eax,[cur_tab.Editor.TopLeft.X] ;! eax,[left_col]
373
	cmp	eax,[sel.begin.x]
392
	cmp	eax,[sel.begin.x]
374
	jge	.lp4
393
	jge	.lp4
375
	add	eax,[columns.scr]
394
	add	eax,[columns.scr]
376
	cmp	eax,[sel.end.x]
395
	cmp	eax,[sel.end.x]
377
	jl	.lp2
396
	jl	.lp2
378
	mov	eax,[sel.begin.x]
397
	mov	eax,[sel.begin.x]
379
	cmp	eax,[sel.end.x]
398
	cmp	eax,[sel.end.x]
380
	je	.lp6
399
	je	.lp6
381
	sub	eax,[left_col]
400
	sub	eax,[cur_tab.Editor.TopLeft.X] ;! eax,[left_col]
382
	imul	eax,6
401
	imul	eax,6
383
	pushad
402
	pushad
384
	mov	ebx,[sel.end.x]
403
	mov	ebx,[sel.end.x]
385
	sub	ebx,[sel.begin.x]
404
	sub	ebx,[sel.begin.x]
386
;       inc     ebx
405
;       inc     ebx
Line 450... Line 469...
450
	push	ecx
469
	push	ecx
451
	mov	ecx,eax
470
	mov	ecx,eax
Line 452... Line 471...
452
 
471
 
453
	push	esi ebx
472
	push	esi ebx
454
	mov	eax,ebx
473
	mov	eax,ebx
455
	sub	ebx,[left_col]
474
	sub	ebx,[cur_tab.Editor.TopLeft.X] ;! ebx,[left_col]
456
	cmp	ebx,[columns.scr]
475
	cmp	ebx,[columns.scr]
457
	jge	.skip_t
476
	jge	.skip_t
458
	add	ebx,esi
477
	add	ebx,esi
459
	jle	.skip_t
478
	jle	.skip_t
460
	mov	ebx,[esp+8+4*2] ;// 4*2=esi+ebx
479
	mov	ebx,[esp+8+4*2] ;// 4*2=esi+ebx
461
	sub	eax,[left_col]
480
	sub	eax,[cur_tab.Editor.TopLeft.X] ;! eax,[left_col]
462
	jge	.qqq
481
	jge	.qqq
463
	sub	edx,eax
482
	sub	edx,eax
464
	add	esi,eax
483
	add	esi,eax
465
;       mov     eax,OLEFT*65536
484
;       mov     eax,OLEFT*65536
Line 473... Line 492...
473
	add	eax,[left_ofs-2];OLEFT*65536
492
	add	eax,[left_ofs-2];OLEFT*65536
474
	add	ebx,eax
493
	add	ebx,eax
Line 475... Line 494...
475
 
494
 
476
	mov	eax,[esp]   ; ebx
495
	mov	eax,[esp]   ; ebx
477
	add	eax,[esp+4] ; esi
496
	add	eax,[esp+4] ; esi
478
	sub	eax,[left_col]
497
	sub	eax,[cur_tab.Editor.TopLeft.X] ;! eax,[left_col]
479
	sub	eax,[columns.scr]
498
	sub	eax,[columns.scr]
480
	jle	.qweqwe
499
	jle	.qweqwe
481
	sub	esi,eax
500
	sub	esi,eax
Line 497... Line 516...
497
;---[ selection crosses block from the right ]-(-
516
;---[ selection crosses block from the right ]-(-
498
  .ya1: mov	eax,esi
517
  .ya1: mov	eax,esi
499
	mov	esi,[sel.begin.x]
518
	mov	esi,[sel.begin.x]
500
	sub	esi,[esp]
519
	sub	esi,[esp]
501
	pushad
520
	pushad
502
	mov	ecx,[left_col]
521
	mov	ecx,[cur_tab.Editor.TopLeft.X] ;! ecx,[left_col]
503
	sub	ecx,[esp+4*8]
522
	sub	ecx,[esp+4*8]
504
	jle	@f
523
	jle	@f
505
	sub	esi,ecx
524
	sub	esi,ecx
506
	sub	[esp+4],ecx
525
	sub	[esp+4],ecx
507
    @@: sub	eax,esi
526
    @@: sub	eax,esi
Line 527... Line 546...
527
;---[ selection crosses block from the left ]--(-
546
;---[ selection crosses block from the left ]--(-
528
  .ya2: mov	eax,[sel.end.x]
547
  .ya2: mov	eax,[sel.end.x]
529
	sub	eax,[esp]
548
	sub	eax,[esp]
530
	push	ebx
549
	push	ebx
531
	mov	ebx,[esp+4]
550
	mov	ebx,[esp+4]
532
	sub	ebx,[left_col]
551
	sub	ebx,[cur_tab.Editor.TopLeft.X] ;! ebx,[left_col]
533
	jge	.ya2.1
552
	jge	.ya2.1
534
	add	eax,ebx
553
	add	eax,ebx
535
  .ya2.1:
554
  .ya2.1:
536
	pop	ebx
555
	pop	ebx
537
	pushad
556
	pushad
Line 559... Line 578...
559
	mov	eax,esi
578
	mov	eax,esi
560
	mov	esi,[sel.begin.x]
579
	mov	esi,[sel.begin.x]
561
	sub	esi,[esp]
580
	sub	esi,[esp]
562
	push	eax
581
	push	eax
563
	mov	eax,[esp+4]
582
	mov	eax,[esp+4]
564
	sub	eax,[left_col]
583
	sub	eax,[cur_tab.Editor.TopLeft.X] ;! eax,[left_col]
565
	jge	.nt3.1
584
	jge	.nt3.1
566
	add	esi,eax
585
	add	esi,eax
567
  .nt3.1:
586
  .nt3.1:
568
	pop	eax
587
	pop	eax
569
	sub	eax,esi
588
	sub	eax,esi
Line 640... Line 659...
640
	mov	ebx,[left_ofs]
659
	mov	ebx,[left_ofs]
641
	add	ebx,-3-LCHGW
660
	add	ebx,-3-LCHGW
642
	shl	ebx,16
661
	shl	ebx,16
643
	add	ebx,[top_ofs]
662
	add	ebx,[top_ofs]
644
	mov	edi,[sc.work_text]
663
	mov	edi,[sc.work_text]
645
	mov	ecx,[top_line]
664
	mov	ecx,[cur_tab.Editor.TopLeft.Y] ;! ecx,[top_line]
646
	inc	ecx
665
	inc	ecx
647
	mov	edx,p_info+100
666
	mov	edx,p_info+100
648
    @@: pushad
667
    @@: pushad
649
	push	eax edx edi
668
	push	eax edx edi
650
	mov	eax,ecx
669
	mov	eax,ecx
Line 658... Line 677...
658
	sub	ebx,eax
677
	sub	ebx,eax
659
	mcall	4,,edi
678
	mcall	4,,edi
660
	popad
679
	popad
661
	add	ebx,LINEH
680
	add	ebx,LINEH
662
	inc	ecx
681
	inc	ecx
663
	cmp	ecx,[lines]
682
	cmp	ecx,[cur_tab.Editor.Lines] ;! ecx,[lines]
664
	jg	@f
683
	jg	@f
665
	mov	esi,ecx
684
	mov	esi,ecx
666
	sub	esi,[top_line]
685
	sub	esi,[cur_tab.Editor.TopLeft.Y] ;! esi,[top_line]
667
	cmp	esi,[lines.scr]
686
	cmp	esi,[lines.scr]
668
	jbe	@b
687
	jbe	@b
669
    @@: add	esp,4*8*2
688
    @@: add	esp,4*8*2
Line 670... Line 689...
670
 
689
 
Line 686... Line 705...
686
    @@:
705
    @@:
Line 687... Line 706...
687
 
706
 
688
	add	esp,4
707
	add	esp,4
689
	cmp	[bot_mode],0
708
	cmp	[bot_mode],0
690
	jne	@f
709
	jne	@f
691
	mov	ebx,[pos.x]
710
	mov	ebx,[cur_tab.Editor.Caret.X] ;! ebx,[pos.x]
692
	sub	ebx,[left_col]
711
	sub	ebx,[cur_tab.Editor.TopLeft.X] ;! ebx,[left_col]
693
	js	@f
712
	js	@f
694
	cmp	ebx,[columns.scr]
713
	cmp	ebx,[columns.scr]
695
	ja	@f
714
	ja	@f
696
	imul	ebx,6
715
	imul	ebx,6
697
	add	ebx,[left_ofs]
716
	add	ebx,[left_ofs]
698
	dec	ebx
717
	dec	ebx
699
	push	bx
718
	push	bx
700
	shl	ebx,16
719
	shl	ebx,16
701
	pop	bx
720
	pop	bx
702
	mov	eax,[pos.y]
721
	mov	eax,[cur_tab.Editor.Caret.Y] ;! eax,[pos.y]
703
	sub	eax,[top_line]
722
	sub	eax,[cur_tab.Editor.TopLeft.Y] ;! eax,[top_line]
704
	js	@f
723
	js	@f
705
	cmp	eax,[lines.scr]
724
	cmp	eax,[lines.scr]
706
	jge	@f
725
	jge	@f
707
	imul	eax,LINEH
726
	imul	eax,LINEH
Line 784... Line 803...
784
	add	esp,4
803
	add	esp,4
785
	popad
804
	popad
786
;        sub     ebx,1*65536-2
805
;        sub     ebx,1*65536-2
Line 787... Line 806...
787
 
806
 
788
	push	ebx
807
	push	ebx
789
	mov	eax,[lines]
808
	mov	eax,[cur_tab.Editor.Lines] ;! eax,[lines]
790
	mov	ebx,[lines.scr]
809
	mov	ebx,[lines.scr]
791
	mov	ecx,[top_line]
810
	mov	ecx,[cur_tab.Editor.TopLeft.Y] ;! ecx,[top_line]
792
	mov	edx,[bot_ofs]
811
	mov	edx,[bot_ofs]
793
	sub	edx,[top_ofs]
812
	sub	edx,[top_ofs]
794
	add	edx,-SCRLW*3+1
813
	add	edx,-SCRLW*3+1
795
	call	get_scroll_vars
814
	call	get_scroll_vars
796
	mov	[vscrl_top],eax
815
	mov	[cur_tab.Editor.VScroll.Top],eax ;! [vscrl_top],eax
797
	mov	[vscrl_size],ebx
816
	mov	[cur_tab.Editor.VScroll.Size],ebx ;! [vscrl_size],ebx
Line 798... Line 817...
798
	pop	ebx
817
	pop	ebx
799
 
818
 
800
	mov	ecx,eax
819
	mov	ecx,eax
Line 808... Line 827...
808
	pushad
827
	pushad
809
	sar	ebx,16
828
	sar	ebx,16
810
;        rol     ecx,16
829
;        rol     ecx,16
811
;        movsx   eax,cx
830
;        movsx   eax,cx
812
;        sar     ecx,16
831
;        sar     ecx,16
813
	push	ebx ecx SCRLW [vscrl_size]
832
	push	ebx ecx SCRLW [cur_tab.Editor.VScroll.Size] ;! ebx ecx SCRLW [vscrl_size]
814
	dec	dword[esp]
833
	dec	dword[esp]
815
	call	draw_3d_panel
834
	call	draw_3d_panel
816
	popad
835
	popad
817
	mov	eax,13
836
	mov	eax,13
818
;!!!!!!!!!!!!!!!!!!
837
;!!!!!!!!!!!!!!!!!!
819
	inc	ebx
838
	inc	ebx
Line 820... Line 839...
820
 
839
 
821
	mov	ecx,[top_ofs-2]
840
	mov	ecx,[top_ofs-2]
822
	mov	cx,word[vscrl_top]
841
	mov	cx,word[cur_tab.Editor.VScroll.Top] ;! cx,word[vscrl_top]
823
	add	ecx,(SCRLW-1)*65536
842
	add	ecx,(SCRLW-1)*65536
824
	mov	edx,[sc.work];[color_tbl+4*5]
843
	mov	edx,[sc.work];[color_tbl+4*5]
825
	or	cx,cx
844
	or	cx,cx
826
	jle	@f
845
	jle	@f
827
	mcall	13
846
	mcall	13
828
    @@:
847
    @@:
829
	mov	ecx,[top_ofs]
848
	mov	ecx,[top_ofs]
830
	add	ecx,[vscrl_top]
849
	add	ecx,[cur_tab.Editor.VScroll.Top] ;! ecx,[vscrl_top]
831
	add	ecx,[vscrl_size]
850
	add	ecx,[cur_tab.Editor.VScroll.Size] ;! ecx,[vscrl_size]
832
	add	ecx,SCRLW-1
851
	add	ecx,SCRLW-1
833
	mov	di,cx
852
	mov	di,cx
834
	shl	ecx,16
853
	shl	ecx,16
835
	mov	cx,word[bot_ofs]
854
	mov	cx,word[bot_ofs]
Line 913... Line 932...
913
	add	esp,4
932
	add	esp,4
914
	popad
933
	popad
915
;       inc     ecx
934
;       inc     ecx
Line 916... Line 935...
916
 
935
 
917
	push	ecx
936
	push	ecx
918
	mov	eax,[columns]
937
	mov	eax,[cur_tab.Editor.Columns] ;! eax,[columns]
919
	mov	ebx,[columns.scr]
938
	mov	ebx,[columns.scr]
920
	mov	ecx,[left_col]
939
	mov	ecx,[cur_tab.Editor.TopLeft.X] ;! ecx,[left_col]
921
	mov	edx,[p_info.client_box.width]
940
	mov	edx,[p_info.client_box.width]
922
	add	edx,-(SCRLW*3)
941
	add	edx,-(SCRLW*3)
923
	call	get_scroll_vars
942
	call	get_scroll_vars
924
	mov	[hscrl_top],eax
943
	mov	[cur_tab.Editor.HScroll.Top],eax ;! [hscrl_top],eax
925
	mov	[hscrl_size],ebx
944
	mov	[cur_tab.Editor.HScroll.Size],ebx ;! [hscrl_size],ebx
Line 926... Line 945...
926
	pop	ecx
945
	pop	ecx
927
 
946
 
928
	mov	ebx,eax
947
	mov	ebx,eax
929
	add	ebx,1+SCRLW
948
	add	ebx,1+SCRLW
Line 930... Line 949...
930
	shl	ebx,16
949
	shl	ebx,16
931
	mov	bx,word[hscrl_size]
950
	mov	bx,word[cur_tab.Editor.HScroll.Size] ;! bx,word[hscrl_size]
932
 
951
 
933
;        mcall   13,,,[sc.work_button]
952
;        mcall   13,,,[sc.work_button]
Line 942... Line 961...
942
	call	draw_3d_panel
961
	call	draw_3d_panel
943
	popad
962
	popad
944
;!!!!!!!!!!!!!!!!!!
963
;!!!!!!!!!!!!!!!!!!
Line 945... Line 964...
945
 
964
 
946
	mov	ebx,(1+SCRLW)*65536
965
	mov	ebx,(1+SCRLW)*65536
947
	mov	bx,word[hscrl_top]
966
	mov	bx,word[cur_tab.Editor.HScroll.Top] ;! bx,word[hscrl_top]
948
	mcall	13,,,[sc.work];[color_tbl+4*5]
967
	mcall	13,,,[sc.work];[color_tbl+4*5]
949
	mov	ebx,1+SCRLW
968
	mov	ebx,1+SCRLW
950
	add	ebx,[hscrl_top]
969
	add	ebx,[cur_tab.Editor.HScroll.Top] ;! ebx,[hscrl_top]
951
	add	ebx,[hscrl_size]
970
	add	ebx,[cur_tab.Editor.HScroll.Size] ;! ebx,[hscrl_size]
952
	mov	di,bx
971
	mov	di,bx
953
	shl	ebx,16
972
	shl	ebx,16
954
	mov	bx,word[p_info.client_box.width]
973
	mov	bx,word[p_info.client_box.width]
955
	sub	bx,di
974
	sub	bx,di
Line 976... Line 995...
976
	mcall	38,,,[cl_3d_inset]
995
	mcall	38,,,[cl_3d_inset]
977
;------------------------------------------------
996
;------------------------------------------------
978
  .exit:
997
  .exit:
979
	popad
998
	popad
980
	ret
999
	ret
-
 
1000
}
981
endf
1001
endf
Line 982... Line 1002...
982
 
1002
 
983
;-----------------------------------------------------------------------------
1003
;-----------------------------------------------------------------------------
984
func get_next_part ;//////////////////////////////////////////////////////////
1004
func get_next_part ;//////////////////////////////////////////////////////////
Line 989... Line 1009...
989
; Output:
1009
; Output:
990
;  ECX = color
1010
;  ECX = color
991
;  EDX = string
1011
;  EDX = string
992
;  ESI = length
1012
;  ESI = length
993
;-----------------------------------------------------------------------------
1013
;-----------------------------------------------------------------------------
994
	cmp	[asm_mode],0
1014
	cmp	[cur_tab.Editor.AsmMode],0 ;! [asm_mode],0
995
	je	.plain.text
1015
	je	.plain.text
996
	xor	ebx,ebx
1016
	xor	ebx,ebx
997
	mov	edx,ecx
1017
	mov	edx,ecx
998
	add	esi,ecx
1018
	add	esi,ecx
999
	mov	edi,symbols
1019
	mov	edi,symbols
Line 1097... Line 1117...
1097
	mov	eax,[color_tbl+4*0]
1117
	mov	eax,[color_tbl+4*0]
1098
	ret
1118
	ret
1099
endf
1119
endf
Line 1100... Line 1120...
1100
 
1120
 
1101
;-----------------------------------------------------------------------------
1121
;-----------------------------------------------------------------------------
1102
func writepos ;///// WRITE POSITION //////////////////////////////////////////
1122
func draw_statusbar ;///// WRITE POSITION ////////////////////////////////////
1103
;-----------------------------------------------------------------------------
1123
;-----------------------------------------------------------------------------
1104
	cmp	[do_not_draw],1  ; return if drawing is not permitted
1124
	cmp	[do_not_draw],1  ; return if drawing is not permitted
1105
	jae	.exit
1125
	jae	.exit
Line -... Line 1126...
-
 
1126
	pusha
-
 
1127
 
-
 
1128
	mov	ecx,[p_info.client_box.height-2]
-
 
1129
	mov	cx,word[p_info.client_box.height]
-
 
1130
	sub	ecx,STATH*65536+STATH
1106
	pusha
1131
	mcall	38,[p_info.client_box.width],,[sc.frame];[cl_3d_pushed]
Line 1107... Line 1132...
1107
 
1132
 
1108
;       mcall   9,p_info,-1
1133
;       mcall   9,p_info,-1
1109
 
1134
 
Line 1114... Line 1139...
1114
;        add     ebx,[left_ofs-2]
1139
;        add     ebx,[left_ofs-2]
1115
;        add     ebx,[left_ofs]
1140
;        add     ebx,[left_ofs]
1116
	mcall	38,<6*13,6*13>,,[cl_3d_inset]
1141
	mcall	38,<6*13,6*13>,,[cl_3d_inset]
Line 1117... Line 1142...
1117
 
1142
 
-
 
1143
	pushad
1118
	pushad
1144
	add	ecx,1*65536
1119
;       sub     ebx,(6*13+1)*65536-1
1145
;       sub     ebx,(6*13+1)*65536-1
1120
;       sub     ebx,[left_ofs]
1146
;       sub     ebx,[left_ofs]
1121
	mov	cx,STATH+1
1147
	mov	cx,STATH
1122
	mcall	13,<0,6*13>,,[cl_3d_normal]
1148
	mcall	13,<0,6*13>,,[cl_3d_normal]
1123
	mcall	,<6*13+1,6*(s_modified.size+2)-1>
1149
	mcall	,<6*13+1,6*(s_modified.size+2)-1>
1124
	mov	ebx,(6*(s_modified.size+15)+1)*65536
1150
	mov	ebx,(6*(s_modified.size+15)+1)*65536
1125
	mov	bx,word[p_info.client_box.width]
1151
	mov	bx,word[p_info.client_box.width]
Line 1131... Line 1157...
1131
	mcall
1157
	mcall
Line 1132... Line 1158...
1132
 
1158
 
1133
	and	ecx,0x0000FFFF
1159
	and	ecx,0x0000FFFF
Line 1134... Line 1160...
1134
	push	ecx
1160
	push	ecx
1135
 
1161
 
1136
	mov	eax,[pos.y]
1162
	mov	eax,[cur_tab.Editor.Caret.Y] ;! eax,[pos.y]
1137
	inc	eax
1163
	inc	eax
1138
	mov	ecx,10
1164
	mov	ecx,10
1139
	mov	edi,p_info+0x100;htext2.pos1
1165
	mov	edi,p_info+0x100;htext2.pos1
1140
	cld
1166
	cld
1141
	call	uint2str
1167
	call	uint2str
1142
	mov	al,','
1168
	mov	al,','
1143
	stosb
1169
	stosb
1144
	mov	eax,[pos.x]
1170
	mov	eax,[cur_tab.Editor.Caret.X] ;! eax,[pos.x]
Line 1145... Line 1171...
1145
	inc	eax
1171
	inc	eax
Line 1154... Line 1180...
1154
;       add     ebx,[left_ofs-2]
1180
;       add     ebx,[left_ofs-2]
1155
	add	ebx,(1+6*6+3)*65536-STATH/2-3
1181
	add	ebx,(1+6*6+3)*65536-STATH/2-3
1156
	sub	ebx,edi
1182
	sub	ebx,edi
1157
	mcall	4,,[sc.work_text],p_info+0x100
1183
	mcall	4,,[sc.work_text],p_info+0x100
Line 1158... Line 1184...
1158
 
1184
 
1159
	cmp	[modified],0
1185
	cmp	[cur_tab.Editor.Modified],0 ;! [modified],0
1160
	je	@f
1186
	je	@f
1161
	and	ebx,0x0000FFFF
1187
	and	ebx,0x0000FFFF
1162
;       add     ebx,[left_ofs-2]
1188
;       add     ebx,[left_ofs-2]
1163
	add	ebx,(1+12*6+12+1)*65536
1189
	add	ebx,(1+12*6+12+1)*65536
Line 1174... Line 1200...
1174
 
1200
 
1175
  .exit:
1201
  .exit:
1176
	ret
1202
	ret
Line 1177... Line -...
1177
endf
-
 
1178
 
-
 
1179
;-----------------------------------------------------------------------------
-
 
1180
func print_text ;/////////////////////////////////////////////////////////////
-
 
1181
;-----------------------------------------------------------------------------
-
 
1182
	pusha
-
 
1183
;        mov     ebx,(LBTNW+5+2)*65536
-
 
1184
	mov	bx,word[p_info.box.width]
-
 
1185
;        sub     bx,LBTNW+RBTNW+10+3
-
 
1186
	mov	ecx,[ya-2]
-
 
1187
;        mov     cx,ABTNH+1
-
 
1188
	mcall	13,,,[sc.work]
-
 
1189
;        mov     ebx,(LBTNW+5+2+4)*65536+ABTNH/2-3
-
 
1190
	add	ebx,[ya]
-
 
1191
	mov	eax,[p_info.box.width]
-
 
1192
;        sub     eax,LBTNW+RBTNW+10+8
-
 
1193
	push	eax
-
 
1194
	cdq
-
 
1195
	mov	ecx,6
-
 
1196
	div	ecx
-
 
1197
	cmp	eax,PATHL
-
 
1198
	jbe	@f
-
 
1199
	mov	eax,PATHL
-
 
1200
    @@: mov	esi,eax
-
 
1201
	mcall	4,,[color_tbl+0],[addr]
-
 
1202
 
-
 
1203
	mov	eax,[ya]
-
 
1204
	mov	ebx,eax
-
 
1205
;        add     eax,ABTNH/2-6
-
 
1206
	shl	eax,16
-
 
1207
	add	eax,ebx
-
 
1208
;        add     eax,ABTNH/2-6+11
-
 
1209
	mov	ecx,eax
-
 
1210
	imul	eax,[temp],6
-
 
1211
	pop	ebx
-
 
1212
	cmp	eax,ebx
-
 
1213
	jae	@f
-
 
1214
;        add     eax,LBTNW+5+2+4
-
 
1215
	mov	ebx,eax
-
 
1216
	shl	eax,16
-
 
1217
	add	ebx,eax
-
 
1218
	mcall	38,,,[color_tbl+0]
-
 
1219
 
-
 
1220
    @@: popa
-
 
1221
	ret
-
 
1222
endf
1203
endf
1223
 
1204
 
-
 
1205
func draw_framerect ; ebx,ecx,edx
-
 
1206
	push	ebx ecx
-
 
1207
	; x1 = esp+6
-
 
1208
	; x2 = esp+4 (width)
Line 1224... Line 1209...
1224
func draw_framerect ; ebx,ecx
1209
	; y1 = esp+2
1225
	push	ebx ecx
1210
	; y2 = esp+0 (height)
1226
 
1211
 
1227
	add	bx,[esp+6]
1212
	add	bx,[esp+6]
1228
	mov	cx,[esp+2]
1213
	mov	cx,[esp+2]
1229
	dec	ebx
1214
	dec	ebx
1230
	mcall	38,,,[cl_3d_inset]
1215
	mcall	38
1231
	add	cx,[esp]
1216
	add	cx,[esp]
1232
	rol	ecx,16
1217
	rol	ecx,16
Line 1244... Line 1229...
1244
	rol	ebx,16
1229
	rol	ebx,16
1245
	add	bx,[esp+4]
1230
	add	bx,[esp+4]
1246
	sub	ebx,0x00010001
1231
	sub	ebx,0x00010001
1247
	mcall
1232
	mcall
Line 1248... Line 1233...
1248
 
1233
 
1249
	add	esp,8
1234
	pop	ecx ebx
1250
	ret
1235
	ret
1251
endf
1236
endf