38,15 → 38,16 |
;----------------------------------------------------------------------------- |
func make_tab_visible ;///// MAKE SPECIFIED TAB VISIBLE IF IT'S OFFSCREEN //// |
;----------------------------------------------------------------------------- |
push ebp |
imul eax,[tab_bar.Items.Left],sizeof.TABITEM |
add eax,[tab_bar.Items] |
cmp eax,ebp |
jb .go_right |
ja .go_left |
add esp,4 |
ret |
|
.go_right: |
push ebp |
call get_hidden_tabitems_number |
cmp ebp,[esp] |
ja .lp1 |
66,6 → 67,7 |
mov ebx,sizeof.TABITEM |
div ebx |
@@: mov [tab_bar.Items.Left],eax |
add esp,4 |
ret |
endf |
|
72,7 → 74,6 |
;----------------------------------------------------------------------------- |
func create_tab ;///// ADD TAB TO THE END //////////////////////////////////// |
;----------------------------------------------------------------------------- |
; DEBUGF 1,"items count before addition: %d\n",[tab_bar.Items.Count] |
push eax ecx esi edi |
|
inc [tab_bar.Items.Count] |
83,15 → 84,11 |
mov [tab_bar.Items],eax |
sub ecx,eax |
sub [tab_bar.Current.Ptr],ecx |
cmp [tab_bar.Default.Ptr],0 |
je @f |
sub [tab_bar.Default.Ptr],ecx |
@@: lea ebp,[eax+ebx-sizeof.TABITEM] |
lea ebp,[eax+ebx-sizeof.TABITEM] |
call set_cur_tab |
call make_tab_visible |
|
mov eax,1024 |
mov [cur_editor.Lines.Size],eax |
call mem.Alloc |
mov [cur_editor.Lines],eax |
mov [cur_editor.Lines.Count],1 |
118,19 → 115,14 |
rep movsb |
mov [cur_editor.FileName],0 |
|
mov [f_info.length],0 |
mov [cur_editor.Modified],0 |
mov [cur_editor.AsmMode],0 |
|
call flush_cur_tab |
call update_caption |
;call drawwindow |
cmp [do_not_draw],0 |
jne @f |
call align_editor_in_tab |
call draw_editor |
call draw_tabctl |
call draw_statusbar |
@@: |
call drawwindow |
|
mov ebp,cur_tab |
pop edi esi ecx eax |
ret |
139,18 → 131,7 |
;----------------------------------------------------------------------------- |
func delete_tab ;///// DELETE SPECIFIED TAB ////////////////////////////////// |
;----------------------------------------------------------------------------- |
; DEBUGF 1,"items count before deletion: %d\n",[tab_bar.Items.Count] |
cmp [tab_bar.Default.Ptr],0 |
je @f |
cmp ebp,[tab_bar.Default.Ptr] |
je .lp1 |
ja @f |
sub [tab_bar.Default.Ptr],sizeof.TABITEM |
jmp @f |
.lp1: |
mov [tab_bar.Default.Ptr],0 |
|
@@: mov eax,[ebp+TABITEM.Editor.Lines] |
mov eax,[ebp+TABITEM.Editor.Lines] |
call mem.Free |
imul ecx,[tab_bar.Items.Count],sizeof.TABITEM |
add ecx,[tab_bar.Items] |
172,10 → 153,7 |
mov [tab_bar.Items],eax |
sub ecx,eax |
sub ebp,ecx |
cmp [tab_bar.Default.Ptr],0 |
je @f |
sub [tab_bar.Default.Ptr],ecx |
@@: |
|
pop ecx |
add ecx,[tab_bar.Items] |
sub ecx,ebp |
185,20 → 163,14 |
@@: mov [tab_bar.Current.Ptr],0 |
call set_cur_tab |
call make_tab_visible |
;call drawwindow |
call align_editor_in_tab |
call draw_editor |
call draw_tabctl |
call draw_statusbar |
call drawwindow |
ret |
|
.no_tabs: |
mov eax,[tab_bar.Items] |
call mem.Free |
xor eax,eax |
mov [tab_bar.Items],eax |
mov [tab_bar.Current.Ptr],eax |
mov [tab_bar.Default.Ptr],eax |
mov [tab_bar.Items],0 |
mov [tab_bar.Current.Ptr],0 |
ret |
endf |
|
382,26 → 354,6 |
mov edx,[color_tbl+4*0] |
.draw_tabs.inactive: |
|
cmp ebp,[tab_bar.Default.Ptr] |
jne .draw_tabs.notdefault |
push ebx ecx edx |
add ebx,3*65536 |
add ecx,(TBARH/2-6)*65536 |
mov bx,11 |
mov cx,bx |
call draw_framerect |
add ebx,1*65536-2 |
add ecx,1*65536-2 |
mcall 13,,,[sc.work] |
shr ebx,16 |
shr ecx,16 |
add ebx,2 |
add ecx,3 |
mov edx,[esp] |
call draw_check |
pop edx ecx ebx |
.draw_tabs.notdefault: |
|
push ebx ecx esi edx |
lea eax,[ebp+TABITEM.Editor.FilePath] |
add eax,[ebp+TABITEM.Editor.FileName] |
410,12 → 362,9 |
mov esi,eax |
shr ecx,16 |
mov bx,cx |
add ebx,5*65536+TBARH/2-4 |
add ebx,0x00050005 |
pop ecx |
cmp ebp,[tab_bar.Default.Ptr] |
jne .lp2 |
add ebx,13*65536 |
.lp2: mcall 4 |
mcall 4 |
pop esi ecx ebx |
|
inc [tab_bar.Buttons.Last] |
584,9 → 533,6 |
call strlen |
imul ebx,eax,6 |
add ebx,9 |
cmp ebp,[tab_bar.Default.Ptr] |
jne .lp2 |
add ebx,13 |
jmp .lp2 |
.lp1: call get_max_tab_width |
mov ebx,eax |
620,9 → 566,6 |
cmp eax,SCRLW*2+2 |
jae @f |
mov eax,SCRLW*2+2 |
@@: cmp [tab_bar.Default.Ptr],0 |
je @f |
add eax,13 |
@@: pop ebp ecx ebx |
ret |
endf |
655,8 → 598,9 |
mov edi,[tab_bar.Bounds.Top] |
inc edi |
mov ecx,[tab_bar.Items.Count] |
imul ebp,[tab_bar.Items.Left],sizeof.TABITEM |
add ebp,[tab_bar.Items] |
mov ebp,[tab_bar.Items] |
imul eax,[tab_bar.Items.Left],sizeof.TABITEM |
add ebp,eax |
mov eax,ecx |
sub eax,[tab_bar.Items.Left] |
push eax |