Rev 267 | Rev 297 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 267 | Rev 280 | ||
---|---|---|---|
Line 11... | Line 11... | ||
11 | sub cx,word[cur_editor.Bounds.Top] |
11 | sub cx,word[cur_editor.Bounds.Top] |
12 | inc ecx |
12 | inc ecx |
13 | mov edx,[cl_3d_inset] |
13 | mov edx,[cl_3d_inset] |
14 | call draw_framerect |
14 | call draw_framerect |
15 | @^ |
15 | |
16 | mov ebx,[cur_editor.Bounds.Left-2] |
16 | mov [cur_editor.Gutter.Visible],0 |
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] |
- | |
21 | mov ecx,[cur_editor.Bounds.Bottom-2] |
- | |
22 | mov cx,word[cur_editor.Bounds.Bottom] |
- | |
23 | mcall |
- | |
24 | mov bx,word[cur_editor.Bounds.Left] |
- | |
25 | mov cx,word[cur_editor.Bounds.Top] |
- | |
26 | mcall |
- | |
27 | mov ebx,[cur_editor.Bounds.Right-2] |
- | |
28 | mov bx,word[cur_editor.Bounds.Right] |
- | |
29 | mov cx,word[cur_editor.Bounds.Top] |
- | |
30 | mcall |
- | |
31 | ^@ |
- | |
32 | mov [cur_editor.Gutter.Visible],0 |
- | |
33 | test [options],OPTS_LINENUMS |
17 | test [options],OPTS_LINENUMS |
34 | jnz @f |
18 | jnz @f |
35 | xor eax,eax ;! mov eax,2+LCHGW |
19 | xor eax,eax ;! mov eax,2+LCHGW |
36 | jmp .lp1 |
20 | jmp .lp1 |
37 | @@: inc [cur_editor.Gutter.Visible] |
21 | @@: inc [cur_editor.Gutter.Visible] |
Line 47... | Line 31... | ||
47 | add eax,8 |
31 | add eax,8 |
48 | .lp1: mov [cur_editor.Gutter.Width],eax ;! [left_ofs],eax |
32 | .lp1: mov [cur_editor.Gutter.Width],eax ;! [left_ofs],eax |
49 | mov [left_ofs],eax |
33 | mov [left_ofs],eax |
50 | 34 | ||
Line -... | Line 35... | ||
- | 35 | mov eax,[cur_editor.Bounds.Right] |
|
- | 36 | sub eax,[cur_editor.Bounds.Left] |
|
- | 37 | sub eax,[cur_editor.Gutter.Width] |
|
- | 38 | sub eax,SCRLW+LCHGW+4 |
|
- | 39 | js .exit |
|
- | 40 | cdq |
|
- | 41 | mov ebx,6 |
|
- | 42 | div ebx |
|
- | 43 | mov [columns.scr],eax |
|
- | 44 | ||
- | 45 | mov eax,[cur_editor.Bounds.Bottom] |
|
- | 46 | sub eax,[cur_editor.Bounds.Top] |
|
- | 47 | ||
- | 48 | sub eax,SCRLW+3 |
|
- | 49 | js .exit |
|
- | 50 | cdq |
|
- | 51 | mov ebx,LINEH |
|
- | 52 | div ebx |
|
- | 53 | mov [lines.scr],eax |
|
- | 54 | ||
51 | call draw_editor_gutter |
55 | call draw_editor_gutter |
52 | call draw_editor_vscroll |
56 | call draw_editor_vscroll |
53 | call draw_editor_hscroll |
57 | call draw_editor_hscroll |
54 | call draw_editor_text |
58 | call draw_editor_text |
55 | call draw_editor_caret |
59 | call draw_editor_caret |
Line -... | Line 60... | ||
- | 60 | ||
56 | 61 | .exit: |
|
57 | ret |
62 | ret |
Line 58... | Line 63... | ||
58 | endf |
63 | endf |
59 | 64 | ||
Line 169... | Line 174... | ||
169 | mov ebx,[lines.scr] |
174 | mov ebx,[lines.scr] |
170 | mov ecx,[cur_editor.TopLeft.Y] |
175 | mov ecx,[cur_editor.TopLeft.Y] |
171 | mov edx,[cur_editor.Bounds.Bottom] |
176 | mov edx,[cur_editor.Bounds.Bottom] |
172 | sub edx,[cur_editor.Bounds.Top] |
177 | sub edx,[cur_editor.Bounds.Top] |
173 | add edx,-SCRLW*3+1 |
178 | add edx,-SCRLW*3;+1 |
174 | call get_scroll_vars |
179 | call get_scroll_vars |
175 | mov [cur_editor.VScroll.Top],eax |
180 | mov [cur_editor.VScroll.Top],eax |
176 | mov [cur_editor.VScroll.Size],ebx |
181 | mov [cur_editor.VScroll.Size],ebx |
177 | pop ebx |
182 | pop ebx |
178 | 183 | ||
Line 271... | Line 276... | ||
271 | mov eax,[cur_editor.Columns.Count] |
276 | mov eax,[cur_editor.Columns.Count] |
272 | mov ebx,[columns.scr] |
277 | mov ebx,[columns.scr] |
273 | mov ecx,[cur_editor.TopLeft.X] |
278 | mov ecx,[cur_editor.TopLeft.X] |
274 | mov edx,[cur_editor.Bounds.Right] |
279 | mov edx,[cur_editor.Bounds.Right] |
275 | add edx,-(SCRLW*3) |
280 | sub edx,[cur_editor.Bounds.Left] |
- | 281 | add edx,-(SCRLW*3) |
|
276 | call get_scroll_vars |
282 | call get_scroll_vars |
277 | mov [cur_editor.HScroll.Top],eax |
283 | mov [cur_editor.HScroll.Top],eax |
278 | mov [cur_editor.HScroll.Size],ebx |
284 | mov [cur_editor.HScroll.Size],ebx |
279 | pop ecx |
285 | pop ecx |
280 | 286 | ||
Line 327... | Line 333... | ||
327 | 333 | ||
Line 328... | Line 334... | ||
328 | ;----------------------------------------------------------------------------- |
334 | ;----------------------------------------------------------------------------- |
329 | func draw_editor_text ;///// DRAW EDITOR TEXT //////////////////////////////// |
335 | func draw_editor_text ;///// DRAW EDITOR TEXT //////////////////////////////// |
330 | ;----------------------------------------------------------------------------- |
336 | ;----------------------------------------------------------------------------- |
- | 337 | cmp [cur_editor.Lines],0 |
|
- | 338 | jne @f |
|
- | 339 | ret |
|
331 | mov eax,[cur_editor.Bounds.Bottom] |
340 | @@: mov eax,[cur_editor.Bounds.Bottom] |
332 | sub eax,[cur_editor.Bounds.Top] |
341 | sub eax,[cur_editor.Bounds.Top] |
333 | cmp eax,LINEH |
342 | cmp eax,LINEH |
334 | jge @f |
343 | jge @f |
335 | ret |
344 | ret |
336 | @@: |
345 | @@: |
Line 361... | Line 370... | ||
361 | jle .exit |
370 | jle .exit |
362 | add esp,-4 |
371 | add esp,-4 |
363 | 372 | ||
Line 364... | Line 373... | ||
364 | imul ebp,[cur_editor.TopLeft.X],6*65536 ;! ebp,[left_col],6*65536 |
373 | imul ebp,[cur_editor.TopLeft.X],6*65536 ;! ebp,[left_col],6*65536 |
365 | mov eax,[lines.scr] |
- | |
366 | sub eax,[cur_editor.Lines.Count] ;! eax,[lines] |
- | |
367 | mov [draw_blines],eax |
- | |
Line 368... | Line 374... | ||
368 | 374 | ||
Line 369... | Line 375... | ||
369 | .next_line: |
375 | .next_line: |
Line 681... | Line 687... | ||
681 | jg .next_line |
687 | jg .next_line |
682 | 688 | ||
Line 683... | Line 689... | ||
683 | .exit: |
689 | .exit: |
Line 684... | Line -... | ||
684 | - | ||
685 | cmp [draw_blines],0 |
- | |
686 | jl @f |
- | |
687 | mov ecx,[esp-8] |
- | |
688 | shl ecx,16 |
- | |
689 | mov cx,word[cur_editor.Bounds.Bottom] |
- | |
690 | sub cx,[esp-8] |
- | |
691 | add cx,-SCRLW |
690 | |
692 | mov eax,[cur_editor.Bounds.Left] |
691 | mov eax,[cur_editor.Bounds.Left] |
693 | add eax,[cur_editor.Gutter.Width] |
692 | add eax,[cur_editor.Gutter.Width] |
694 | inc eax |
693 | inc eax |
695 | mov ebx,eax |
694 | mov ebx,eax |
696 | shl ebx,16 |
695 | shl ebx,16 |
697 | mov bx,word[cur_editor.Bounds.Right] |
696 | mov bx,word[cur_editor.Bounds.Right] |
698 | sub bx,ax |
697 | sub bx,ax |
699 | add ebx,-SCRLW |
698 | add ebx,-SCRLW |
- | 699 | mov edx,[color_tbl+4*5] |
|
- | 700 | mov eax,13 |
|
- | 701 | mov ecx,[esp-8] |
|
- | 702 | add ecx,LINEH |
|
- | 703 | shl ecx,16 |
|
- | 704 | mov cx,word[cur_editor.Bounds.Bottom] |
|
- | 705 | sub cx,[esp-8] |
|
700 | mcall 13,,,[color_tbl+4*5] |
706 | add cx,-SCRLW-LINEH |
- | 707 | jle @f |
|
- | 708 | mcall |
|
- | 709 | @@: mov ecx,[cur_editor.Bounds.Top-2] |
|
- | 710 | mov cx,2 |
|
- | 711 | add ecx,0x00010000 |
|
- | 712 | mcall |
|
- | 713 | mov ebx,[cur_editor.Bounds.Right] |
|
- | 714 | mov ecx,[cur_editor.Bounds.Bottom] |
|
- | 715 | shl ebx,16 |
|
- | 716 | shl ecx,16 |
|
- | 717 | add ebx,-(SCRLW-1)*65536+SCRLW-1 |
|
- | 718 | add ecx,-(SCRLW-1)*65536+SCRLW-1 |
|
Line 701... | Line 719... | ||
701 | @@: |
719 | mcall |
702 | 720 | ||
703 | popad |
721 | popad |
704 | add esp,4 |
722 | add esp,4 |
Line 743... | Line 761... | ||
743 | loop .lp8 |
761 | loop .lp8 |
744 | @@: |
762 | @@: |
745 | ret |
763 | ret |
746 | endf |
764 | endf |
747 | 765 | ||
748 | 766 | ;----------------------------------------------------------------------------- |
|
- | 767 | func editor_realloc_lines ;///// ADD $DELTA$ TO LINES SIZE /////////////////// |
|
- | 768 | ;----------------------------------------------------------------------------- |
|
- | 769 | ; EAX = delta |
|
- | 770 | ;----------------------------------------------------------------------------- |
|
- | 771 | push ebx ecx |
|
- | 772 | mov ebx,[cur_editor.Lines.Size] |
|
- | 773 | add ebx,eax |
|
- | 774 | mov eax,[cur_editor.Lines] |
|
- | 775 | mov [cur_editor.Lines.Size],ebx |
|
- | 776 | mov ecx,eax |
|
- | 777 | call mem.ReAlloc |
|
- | 778 | mov [cur_editor.Lines],eax |
|
- | 779 | sub eax,ecx |
|
- | 780 | pop ecx ebx |
|
- | 781 | ret |
|
- | 782 | endf |
|
- | 783 | ||
- | 784 |