Rev 595 | Rev 629 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 595 | Rev 617 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | ;----------------------------------------------------------------------------- |
1 | ;----------------------------------------------------------------------------- |
2 | func flush_cur_tab ;///// SAVE CURRENT TAB DATA TO CONTROL /////////////////// |
2 | proc flush_cur_tab ;///// SAVE CURRENT TAB DATA TO CONTROL /////////////////// |
3 | ;----------------------------------------------------------------------------- |
3 | ;----------------------------------------------------------------------------- |
4 | ; EBP = TABITEM* |
4 | ; EBP = TABITEM* |
5 | ;----------------------------------------------------------------------------- |
5 | ;----------------------------------------------------------------------------- |
6 | push ecx esi edi |
6 | push ecx esi edi |
7 | mov esi,cur_tab |
7 | mov esi,cur_tab |
Line 9... | Line 9... | ||
9 | mov ecx,sizeof.TABITEM/4 |
9 | mov ecx,sizeof.TABITEM/4 |
10 | cld |
10 | cld |
11 | rep movsd |
11 | rep movsd |
12 | pop edi esi ecx |
12 | pop edi esi ecx |
13 | ret |
13 | ret |
14 | endf |
14 | endp |
Line 15... | Line 15... | ||
15 | 15 | ||
16 | ;----------------------------------------------------------------------------- |
16 | ;----------------------------------------------------------------------------- |
17 | func set_cur_tab ;///// SET SPECIFIED TAB CURRENT (FOCUS IT) ///////////////// |
17 | proc set_cur_tab ;///// SET SPECIFIED TAB CURRENT (FOCUS IT) ///////////////// |
18 | ;----------------------------------------------------------------------------- |
18 | ;----------------------------------------------------------------------------- |
19 | ; EBP = TABITEM* |
19 | ; EBP = TABITEM* |
20 | ;----------------------------------------------------------------------------- |
20 | ;----------------------------------------------------------------------------- |
21 | push ecx esi edi |
21 | push ecx esi edi |
Line 28... | Line 28... | ||
28 | rep movsd |
28 | rep movsd |
29 | mov [tab_bar.Current.Ptr],ebp |
29 | mov [tab_bar.Current.Ptr],ebp |
30 | ; call update_caption |
30 | ; call update_caption |
31 | pop edi esi ecx |
31 | pop edi esi ecx |
32 | ret |
32 | ret |
33 | endf |
33 | endp |
Line 34... | Line 34... | ||
34 | 34 | ||
35 | ;----------------------------------------------------------------------------- |
35 | ;----------------------------------------------------------------------------- |
36 | func make_tab_visible ;///// MAKE SPECIFIED TAB VISIBLE IF IT'S OFFSCREEN //// |
36 | proc make_tab_visible ;///// MAKE SPECIFIED TAB VISIBLE IF IT'S OFFSCREEN //// |
37 | ;----------------------------------------------------------------------------- |
37 | ;----------------------------------------------------------------------------- |
38 | call flush_cur_tab |
38 | call flush_cur_tab |
39 | imul eax,[tab_bar.Items.Left],sizeof.TABITEM |
39 | imul eax,[tab_bar.Items.Left],sizeof.TABITEM |
40 | add eax,[tab_bar.Items] |
40 | add eax,[tab_bar.Items] |
Line 62... | Line 62... | ||
62 | cdq |
62 | cdq |
63 | mov ebx,sizeof.TABITEM |
63 | mov ebx,sizeof.TABITEM |
64 | div ebx |
64 | div ebx |
65 | @@: mov [tab_bar.Items.Left],eax |
65 | @@: mov [tab_bar.Items.Left],eax |
66 | ret |
66 | ret |
67 | endf |
67 | endp |
Line 68... | Line 68... | ||
68 | 68 | ||
69 | ;----------------------------------------------------------------------------- |
69 | ;----------------------------------------------------------------------------- |
70 | func create_tab ;///// ADD TAB TO THE END //////////////////////////////////// |
70 | proc create_tab ;///// ADD TAB TO THE END //////////////////////////////////// |
71 | ;----------------------------------------------------------------------------- |
71 | ;----------------------------------------------------------------------------- |
Line 72... | Line 72... | ||
72 | push eax ecx esi edi |
72 | push eax ecx esi edi |
73 | 73 | ||
74 | inc [tab_bar.Items.Count] |
74 | inc [tab_bar.Items.Count] |
75 | imul ebx,[tab_bar.Items.Count],sizeof.TABITEM |
75 | imul ebx,[tab_bar.Items.Count],sizeof.TABITEM |
76 | mov eax,[tab_bar.Items] |
76 | mov eax,[tab_bar.Items] |
77 | mov ecx,eax |
77 | mov ecx,eax |
78 | call mem.ReAlloc |
78 | stdcall mem.ReAlloc,eax,ebx |
79 | mov [tab_bar.Items],eax |
79 | mov [tab_bar.Items],eax |
80 | sub ecx,eax |
80 | sub ecx,eax |
81 | sub [tab_bar.Current.Ptr],ecx |
81 | sub [tab_bar.Current.Ptr],ecx |
Line 85... | Line 85... | ||
85 | @@: lea ebp,[eax+ebx-sizeof.TABITEM] |
85 | @@: lea ebp,[eax+ebx-sizeof.TABITEM] |
86 | call set_cur_tab |
86 | call set_cur_tab |
Line 87... | Line 87... | ||
87 | 87 | ||
88 | mov eax,1024 |
88 | mov eax,1024 |
89 | mov [cur_editor.Lines.Size],eax |
89 | mov [cur_editor.Lines.Size],eax |
90 | call mem.Alloc |
90 | stdcall mem.Alloc,eax |
91 | mov [cur_editor.Lines],eax |
91 | mov [cur_editor.Lines],eax |
92 | mov [cur_editor.Lines.Count],1 |
92 | mov [cur_editor.Lines.Count],1 |
93 | mov [cur_editor.Columns.Count],1 |
93 | mov [cur_editor.Columns.Count],1 |
94 | xor eax,eax |
94 | xor eax,eax |
Line 129... | Line 129... | ||
129 | call update_caption |
129 | call update_caption |
130 | @@: |
130 | @@: |
131 | mov ebp,cur_tab |
131 | mov ebp,cur_tab |
132 | pop edi esi ecx eax |
132 | pop edi esi ecx eax |
133 | ret |
133 | ret |
134 | endf |
134 | endp |
Line 135... | Line 135... | ||
135 | 135 | ||
136 | ;----------------------------------------------------------------------------- |
136 | ;----------------------------------------------------------------------------- |
137 | func delete_tab ;///// DELETE SPECIFIED TAB ////////////////////////////////// |
137 | proc delete_tab ;///// DELETE SPECIFIED TAB ////////////////////////////////// |
138 | ;----------------------------------------------------------------------------- |
138 | ;----------------------------------------------------------------------------- |
139 | cmp [tab_bar.Default.Ptr],0 |
139 | cmp [tab_bar.Default.Ptr],0 |
140 | je @f |
140 | je @f |
141 | cmp ebp,[tab_bar.Default.Ptr] |
141 | cmp ebp,[tab_bar.Default.Ptr] |
Line 144... | Line 144... | ||
144 | sub [tab_bar.Default.Ptr],sizeof.TABITEM |
144 | sub [tab_bar.Default.Ptr],sizeof.TABITEM |
145 | jmp @f |
145 | jmp @f |
146 | .lp1: |
146 | .lp1: |
147 | mov [tab_bar.Default.Ptr],0 |
147 | mov [tab_bar.Default.Ptr],0 |
Line 148... | Line 148... | ||
148 | 148 | ||
149 | @@: mov eax,[ebp+TABITEM.Editor.Lines] |
- | |
150 | call mem.Free |
149 | @@: stdcall mem.Free,[ebp+TABITEM.Editor.Lines] |
151 | imul ecx,[tab_bar.Items.Count],sizeof.TABITEM |
150 | imul ecx,[tab_bar.Items.Count],sizeof.TABITEM |
152 | add ecx,[tab_bar.Items] |
151 | add ecx,[tab_bar.Items] |
153 | sub ecx,ebp |
152 | sub ecx,ebp |
154 | sub ecx,sizeof.TABITEM |
153 | sub ecx,sizeof.TABITEM |
Line 162... | Line 161... | ||
162 | jz .no_tabs |
161 | jz .no_tabs |
163 | imul ebx,[tab_bar.Items.Count],sizeof.TABITEM |
162 | imul ebx,[tab_bar.Items.Count],sizeof.TABITEM |
164 | push ebx |
163 | push ebx |
165 | mov eax,[tab_bar.Items] |
164 | mov eax,[tab_bar.Items] |
166 | mov ecx,eax |
165 | mov ecx,eax |
167 | call mem.ReAlloc |
166 | stdcall mem.ReAlloc,eax,ebx |
168 | mov [tab_bar.Items],eax |
167 | mov [tab_bar.Items],eax |
169 | sub ecx,eax |
168 | sub ecx,eax |
170 | sub ebp,ecx |
169 | sub ebp,ecx |
171 | cmp [tab_bar.Default.Ptr],0 |
170 | cmp [tab_bar.Default.Ptr],0 |
172 | je @f |
171 | je @f |
Line 186... | Line 185... | ||
186 | call draw_tabctl |
185 | call draw_tabctl |
187 | call draw_statusbar |
186 | call draw_statusbar |
188 | ret |
187 | ret |
Line 189... | Line 188... | ||
189 | 188 | ||
190 | .no_tabs: |
189 | .no_tabs: |
191 | mov eax,[tab_bar.Items] |
- | |
192 | call mem.Free |
190 | stdcall mem.Free,[tab_bar.Items] |
193 | xor eax,eax |
191 | xor eax,eax |
194 | mov [tab_bar.Items],eax |
192 | mov [tab_bar.Items],eax |
195 | mov [tab_bar.Current.Ptr],eax |
193 | mov [tab_bar.Current.Ptr],eax |
196 | mov [tab_bar.Default.Ptr],eax |
194 | mov [tab_bar.Default.Ptr],eax |
197 | ret |
195 | ret |
Line 198... | Line 196... | ||
198 | endf |
196 | endp |
199 | 197 | ||
200 | ;----------------------------------------------------------------------------- |
198 | ;----------------------------------------------------------------------------- |
Line 201... | Line 199... | ||
201 | func draw_tabctl ;///// DRAW TAB CONTROL ///////////////////////////////////// |
199 | proc draw_tabctl ;///// DRAW TAB CONTROL ///////////////////////////////////// |
202 | ;----------------------------------------------------------------------------- |
200 | ;----------------------------------------------------------------------------- |
203 | 201 | ||
Line 372... | Line 370... | ||
372 | jne .draw_tabs.inactive |
370 | jne .draw_tabs.inactive |
373 | push ebx ecx |
371 | push ebx ecx |
374 | call dword[esp+(8+4)+8+8] |
372 | call dword[esp+(8+4)+8+8] |
375 | mcall 13,,,[sc.work] |
373 | mcall 13,,,[sc.work] |
376 | pop ecx ebx |
374 | pop ecx ebx |
377 | mov edx,[color_tbl.text] |
375 | mov edx,[sc.work_text];[color_tbl.text] |
378 | .draw_tabs.inactive: |
376 | .draw_tabs.inactive: |
Line 379... | Line 377... | ||
379 | 377 | ||
380 | cmp ebp,[tab_bar.Default.Ptr] |
378 | cmp ebp,[tab_bar.Default.Ptr] |
381 | jne .draw_tabs.notdefault |
379 | jne .draw_tabs.notdefault |
Line 560... | Line 558... | ||
560 | ret |
558 | ret |
561 | .next_vert: |
559 | .next_vert: |
562 | movzx ecx,cx |
560 | movzx ecx,cx |
563 | lea edi,[edi+ecx+1] |
561 | lea edi,[edi+ecx+1] |
564 | ret |
562 | ret |
565 | endf |
563 | endp |
Line 566... | Line 564... | ||
566 | 564 | ||
567 | ;----------------------------------------------------------------------------- |
565 | ;----------------------------------------------------------------------------- |
568 | func get_tab_size ;///// GET TAB WIDTH /////////////////////////////////////// |
566 | proc get_tab_size ;///// GET TAB WIDTH /////////////////////////////////////// |
569 | ;----------------------------------------------------------------------------- |
567 | ;----------------------------------------------------------------------------- |
570 | ; EBP = TABITEM* |
568 | ; EBP = TABITEM* |
571 | ;----------------------------------------------------------------------------- |
569 | ;----------------------------------------------------------------------------- |
572 | push eax |
570 | push eax |
Line 584... | Line 582... | ||
584 | .lp1: call get_max_tab_width |
582 | .lp1: call get_max_tab_width |
585 | mov ebx,eax |
583 | mov ebx,eax |
586 | .lp2: mov ecx,TBARH-1 |
584 | .lp2: mov ecx,TBARH-1 |
587 | pop eax |
585 | pop eax |
588 | ret |
586 | ret |
589 | endf |
587 | endp |
Line 590... | Line 588... | ||
590 | 588 | ||
591 | ;----------------------------------------------------------------------------- |
589 | ;----------------------------------------------------------------------------- |
592 | func get_max_tab_width ;///// GET WIDTH OF LONGEST TAB /////////////////////// |
590 | proc get_max_tab_width ;///// GET WIDTH OF LONGEST TAB /////////////////////// |
593 | ;----------------------------------------------------------------------------- |
591 | ;----------------------------------------------------------------------------- |
594 | push ebx ecx ebp |
592 | push ebx ecx ebp |
595 | mov ecx,[tab_bar.Items.Count] |
593 | mov ecx,[tab_bar.Items.Count] |
596 | mov ebp,[tab_bar.Items] |
594 | mov ebp,[tab_bar.Items] |
Line 616... | Line 614... | ||
616 | @@: cmp [tab_bar.Default.Ptr],0 |
614 | @@: cmp [tab_bar.Default.Ptr],0 |
617 | je @f |
615 | je @f |
618 | add eax,13 |
616 | add eax,13 |
619 | @@: pop ebp ecx ebx |
617 | @@: pop ebp ecx ebx |
620 | ret |
618 | ret |
621 | endf |
619 | endp |
Line 622... | Line 620... | ||
622 | 620 | ||
623 | ;----------------------------------------------------------------------------- |
621 | ;----------------------------------------------------------------------------- |
624 | func get_hidden_tabitems_number ;///////////////////////////////////////////// |
622 | proc get_hidden_tabitems_number ;///////////////////////////////////////////// |
625 | ;----------------------------------------------------------------------------- |
623 | ;----------------------------------------------------------------------------- |
626 | mov al,[tab_bar.Style] |
624 | mov al,[tab_bar.Style] |
627 | dec al |
625 | dec al |
628 | dec al |
626 | dec al |
Line 674... | Line 672... | ||
674 | 672 | ||
675 | add esp,4 |
673 | add esp,4 |
676 | @@: pop ecx |
674 | @@: pop ecx |
677 | mov eax,ecx |
675 | mov eax,ecx |
678 | ret 8 |
676 | ret 8 |
Line 679... | Line 677... | ||
679 | endf |
677 | endp |
680 | 678 | ||
681 | ;----------------------------------------------------------------------------- |
679 | ;----------------------------------------------------------------------------- |
682 | func align_editor_in_tab ;///// ADJUST EDITOR POSITION TO FIT IN TAB ///////// |
680 | proc align_editor_in_tab ;///// ADJUST EDITOR POSITION TO FIT IN TAB ///////// |
683 | ;----------------------------------------------------------------------------- |
681 | ;----------------------------------------------------------------------------- |
684 | m2m [cur_editor.Bounds.Left],[tab_bar.Bounds.Left] |
682 | m2m [cur_editor.Bounds.Left],[tab_bar.Bounds.Left] |
685 | m2m [cur_editor.Bounds.Top],[tab_bar.Bounds.Top] |
683 | m2m [cur_editor.Bounds.Top],[tab_bar.Bounds.Top] |
Line 718... | Line 716... | ||
718 | ret |
716 | ret |
Line 719... | Line 717... | ||
719 | 717 | ||
720 | .tabs_on_right: |
718 | .tabs_on_right: |
721 | sub [cur_editor.Bounds.Right],ebx |
719 | sub [cur_editor.Bounds.Right],ebx |
722 | ret |
720 | ret |