Rev 288 | Rev 327 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 288 | Rev 297 | ||
---|---|---|---|
Line 1... | Line -... | ||
1 | lsz s_defname,\ |
- | |
2 | en,<'Untitled',0>,\ |
- | |
3 | ru,<'Untitled',0>,\ |
- | |
4 | et,<'Nimetu',0> |
- | |
5 | - | ||
6 | ;----------------------------------------------------------------------------- |
- | |
7 | func flush_cur_tab ;///// SAVE CURRENT TAB DATA TO CONTROL /////////////////// |
1 | ;----------------------------------------------------------------------------- |
8 | ;----------------------------------------------------------------------------- |
2 | func flush_cur_tab ;///// SAVE CURRENT TAB DATA TO CONTROL /////////////////// |
9 | ; EBP = TABITEM* |
3 | ;----------------------------------------------------------------------------- |
10 | ;----------------------------------------------------------------------------- |
4 | ; EBP = TABITEM* |
11 | push ecx esi edi |
5 | ;----------------------------------------------------------------------------- |
Line 31... | Line 25... | ||
31 | mov edi,cur_tab |
25 | @@: mov esi,ebp |
32 | mov ecx,sizeof.TABITEM/4 |
26 | mov edi,cur_tab |
33 | rep movsd |
27 | mov ecx,sizeof.TABITEM/4 |
34 | mov [tab_bar.Current.Ptr],ebp |
28 | rep movsd |
35 | call update_caption |
29 | mov [tab_bar.Current.Ptr],ebp |
36 | pop edi esi ecx |
30 | ; call update_caption |
37 | ret |
31 | pop edi esi ecx |
38 | endf |
32 | ret |
39 | 33 | endf |
|
Line 40... | Line 34... | ||
40 | ;----------------------------------------------------------------------------- |
34 | |
41 | func make_tab_visible ;///// MAKE SPECIFIED TAB VISIBLE IF IT'S OFFSCREEN //// |
35 | ;----------------------------------------------------------------------------- |
42 | ;----------------------------------------------------------------------------- |
36 | func make_tab_visible ;///// MAKE SPECIFIED TAB VISIBLE IF IT'S OFFSCREEN //// |
- | 37 | ;----------------------------------------------------------------------------- |
|
43 | imul eax,[tab_bar.Items.Left],sizeof.TABITEM |
38 | call flush_cur_tab |
44 | add eax,[tab_bar.Items] |
39 | imul eax,[tab_bar.Items.Left],sizeof.TABITEM |
45 | cmp eax,ebp |
40 | add eax,[tab_bar.Items] |
46 | jb .go_right |
41 | cmp eax,ebp |
47 | ja .go_left |
42 | jb .go_right |
Line 50... | Line 45... | ||
50 | .go_right: |
45 | |
51 | push ebp |
46 | .go_right: |
52 | call get_hidden_tabitems_number |
47 | push ebp |
53 | cmp ebp,[esp] |
48 | call get_hidden_tabitems_number |
54 | ja .lp1 |
49 | cmp ebp,[esp] |
55 | @@: inc [tab_bar.Items.Left] |
50 | ja @f |
56 | call get_hidden_tabitems_number |
51 | @@: inc [tab_bar.Items.Left] |
57 | cmp ebp,[esp] |
52 | call get_hidden_tabitems_number |
58 | jbe @b |
53 | cmp ebp,[esp] |
59 | @@: inc [tab_bar.Items.Left] |
- | |
60 | .lp1: pop ebp |
54 | jbe @b |
61 | ret |
55 | @@: pop ebp |
Line 62... | Line 56... | ||
62 | 56 | ret |
|
63 | .go_left: |
57 | |
64 | mov eax,ebp |
58 | .go_left: |
65 | sub eax,[tab_bar.Items] |
59 | mov eax,ebp |
66 | jz @f |
60 | sub eax,[tab_bar.Items] |
67 | cwde |
61 | jz @f |
68 | mov ebx,sizeof.TABITEM |
62 | cdq |
69 | div ebx |
63 | mov ebx,sizeof.TABITEM |
70 | @@: mov [tab_bar.Items.Left],eax |
64 | div ebx |
71 | ret |
65 | @@: mov [tab_bar.Items.Left],eax |
Line 72... | Line 66... | ||
72 | endf |
66 | ret |
73 | 67 | endf |
|
74 | ;----------------------------------------------------------------------------- |
68 | |
75 | func create_tab ;///// ADD TAB TO THE END //////////////////////////////////// |
- | |
76 | ;----------------------------------------------------------------------------- |
69 | ;----------------------------------------------------------------------------- |
Line 77... | Line 70... | ||
77 | ; DEBUGF 1,"items count before addition: %d\n",[tab_bar.Items.Count] |
70 | func create_tab ;///// ADD TAB TO THE END //////////////////////////////////// |
78 | push eax ecx esi edi |
71 | ;----------------------------------------------------------------------------- |
79 | 72 | push eax ecx esi edi |
|
Line 89... | Line 82... | ||
89 | je @f |
82 | cmp [tab_bar.Default.Ptr],0 |
90 | sub [tab_bar.Default.Ptr],ecx |
83 | je @f |
91 | @@: lea ebp,[eax+ebx-sizeof.TABITEM] |
84 | sub [tab_bar.Default.Ptr],ecx |
92 | call set_cur_tab |
85 | @@: lea ebp,[eax+ebx-sizeof.TABITEM] |
93 | call make_tab_visible |
86 | call set_cur_tab |
94 | - | ||
Line 95... | Line 87... | ||
95 | mov eax,1024 |
87 | |
96 | mov [cur_editor.Lines.Size],eax |
88 | mov eax,1024 |
97 | call mem.Alloc |
89 | mov [cur_editor.Lines.Size],eax |
98 | mov [cur_editor.Lines],eax |
90 | call mem.Alloc |
Line 123... | Line 115... | ||
123 | mov [cur_editor.Modified],0 |
115 | |
124 | mov [cur_editor.AsmMode],0 |
116 | mov [cur_editor.Modified],0 |
Line 125... | Line 117... | ||
125 | 117 | mov [cur_editor.AsmMode],0 |
|
- | 118 | ||
- | 119 | call flush_cur_tab |
|
126 | call flush_cur_tab |
120 | mov ebp,[tab_bar.Current.Ptr] |
127 | call update_caption |
- | |
128 | ;call drawwindow |
121 | call make_tab_visible |
129 | cmp [do_not_draw],0 |
122 | call update_caption |
130 | jne @f |
123 | cmp [do_not_draw],0 |
131 | call align_editor_in_tab |
124 | jne @f |
132 | call draw_editor |
125 | call align_editor_in_tab |
133 | call draw_tabctl |
126 | call draw_editor |
- | 127 | call draw_tabctl |
|
134 | call draw_statusbar |
128 | call draw_statusbar |
135 | @@: |
129 | call update_caption |
136 | mov ebp,cur_tab |
130 | @@: |
137 | pop edi esi ecx eax |
131 | mov ebp,cur_tab |
138 | ret |
132 | pop edi esi ecx eax |
Line 139... | Line 133... | ||
139 | endf |
133 | ret |
140 | 134 | endf |
|
141 | ;----------------------------------------------------------------------------- |
135 | |
142 | func delete_tab ;///// DELETE SPECIFIED TAB ////////////////////////////////// |
- | |
143 | ;----------------------------------------------------------------------------- |
136 | ;----------------------------------------------------------------------------- |
144 | ; DEBUGF 1,"items count before deletion: %d\n",[tab_bar.Items.Count] |
137 | func delete_tab ;///// DELETE SPECIFIED TAB ////////////////////////////////// |
145 | cmp [tab_bar.Default.Ptr],0 |
138 | ;----------------------------------------------------------------------------- |
146 | je @f |
139 | cmp [tab_bar.Default.Ptr],0 |
147 | cmp ebp,[tab_bar.Default.Ptr] |
140 | je @f |
Line 186... | Line 179... | ||
186 | 179 | add ebp,-sizeof.TABITEM |
|
Line 187... | Line 180... | ||
187 | @@: mov [tab_bar.Current.Ptr],0 |
180 | |
188 | call set_cur_tab |
181 | @@: mov [tab_bar.Current.Ptr],0 |
189 | call make_tab_visible |
182 | call set_cur_tab |
190 | ;call drawwindow |
- | |
191 | call align_editor_in_tab |
183 | call make_tab_visible |
192 | call draw_editor |
184 | call align_editor_in_tab |
193 | call draw_tabctl |
185 | call draw_editor |
194 | call draw_statusbar |
186 | call draw_tabctl |
195 | ret |
187 | call draw_statusbar |
Line 380... | Line 372... | ||
380 | push ebx ecx |
372 | jne .draw_tabs.inactive |
381 | call dword[esp+(8+4)+8+8] |
373 | push ebx ecx |
382 | mcall 13,,,[sc.work] |
374 | call dword[esp+(8+4)+8+8] |
383 | pop ecx ebx |
375 | mcall 13,,,[sc.work] |
384 | mov edx,[color_tbl+4*0] |
376 | pop ecx ebx |
385 | .draw_tabs.inactive: |
377 | mov edx,[color_tbl.text] |
386 | 378 | .draw_tabs.inactive: |
|
Line 387... | Line 379... | ||
387 | cmp ebp,[tab_bar.Default.Ptr] |
379 | |
388 | jne .draw_tabs.notdefault |
380 | cmp ebp,[tab_bar.Default.Ptr] |
389 | push ebx ecx edx |
381 | jne .draw_tabs.notdefault |
Line 538... | Line 530... | ||
538 | dec ecx |
530 | add ebx,1*65536-2 |
539 | ret |
531 | dec ecx |
540 | 532 | ret |
|
Line 541... | Line 533... | ||
541 | .check_horz: |
533 | |
542 | lea eax,[ebx-1] |
534 | .check_horz: |
543 | add eax,esi |
- | |
544 | sub eax,[tab_bar.Bounds.Right] |
535 | lea eax,[esi+ebx-1] |
545 | jge .check.dontfit |
536 | sub eax,[tab_bar.Bounds.Right] |
546 | add eax,SCRLW*2+2 |
537 | jge .check.dontfit |
547 | jl .check.fit |
538 | add eax,SCRLW*2+2 |
548 | cmp dword[esp+4],1 |
539 | jl .check.fit |
549 | jbe .check.fit |
540 | cmp dword[esp+4],1 |
550 | .check.dontfit: |
541 | jbe .check.fit |
551 | stc |
542 | .check.dontfit: |
552 | ret |
543 | stc |
553 | .check_vert: |
544 | ret |
554 | lea eax,[ecx-1] |
545 | .check_vert: |
555 | add eax,edi |
- | |
556 | sub eax,[tab_bar.Bounds.Bottom] |
546 | lea eax,[edi+ecx-1] |
557 | jge .check.dontfit |
547 | sub eax,[tab_bar.Bounds.Bottom] |
558 | add eax,SCRLW+2 |
548 | jge .check.dontfit |
559 | jl .check.fit |
549 | add eax,SCRLW+2 |
560 | cmp dword[esp+4],1 |
550 | jl .check.fit |
Line 582... | Line 572... | ||
582 | cmp [tab_bar.Style],3 |
572 | push eax |
583 | jae .lp1 |
573 | cmp [tab_bar.Style],3 |
584 | lea eax,[ebp+TABITEM.Editor.FilePath] |
574 | jae .lp1 |
585 | add eax,[ebp+TABITEM.Editor.FileName] |
575 | lea eax,[ebp+TABITEM.Editor.FilePath] |
586 | call strlen |
576 | add eax,[ebp+TABITEM.Editor.FileName] |
- | 577 | cmp byte[eax],0 |
|
- | 578 | jne @f |
|
- | 579 | int3 |
|
- | 580 | @@: |
|
587 | imul ebx,eax,6 |
581 | call strlen |
588 | add ebx,9 |
582 | imul ebx,eax,6 |
589 | cmp ebp,[tab_bar.Default.Ptr] |
583 | add ebx,9 |
590 | jne .lp2 |
584 | cmp ebp,[tab_bar.Default.Ptr] |
591 | add ebx,13 |
585 | jne .lp2 |
Line 656... | Line 650... | ||
656 | inc esi |
650 | mov esi,[tab_bar.Bounds.Left] |
657 | mov edi,[tab_bar.Bounds.Top] |
651 | inc esi |
658 | inc edi |
652 | mov edi,[tab_bar.Bounds.Top] |
659 | mov ecx,[tab_bar.Items.Count] |
653 | inc edi |
660 | imul ebp,[tab_bar.Items.Left],sizeof.TABITEM |
654 | mov ecx,[tab_bar.Items.Count] |
661 | add ebp,[tab_bar.Items] |
655 | mov ebx,[tab_bar.Items.Left] |
- | 656 | imul ebp,ebx,sizeof.TABITEM |
|
662 | mov eax,ecx |
657 | add ebp,[tab_bar.Items] |
663 | sub eax,[tab_bar.Items.Left] |
658 | push ecx |
664 | push eax |
- | |
665 | @@: push ecx |
659 | sub [esp],ebx |
666 | 660 | @@: push ecx |
|
Line 667... | Line 661... | ||
667 | call get_tab_size |
661 | |
Line 668... | Line 662... | ||
668 | 662 | call get_tab_size |