Subversion Repositories Kolibri OS

Rev

Rev 259 | Rev 280 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1.  
  2. sz s_defname,'Untitled',0
  3.  
  4. ;-----------------------------------------------------------------------------
  5. func flush_cur_tab ;///// SAVE CURRENT TAB DATA TO CONTROL ///////////////////
  6. ;-----------------------------------------------------------------------------
  7. ; EBP = TABITEM*
  8. ;-----------------------------------------------------------------------------
  9.         push    ecx esi edi
  10.         mov     esi,cur_tab
  11.         mov     edi,[tab_bar.Current.Ptr]
  12.         mov     ecx,sizeof.TABITEM/4
  13.         cld
  14.         rep     movsd
  15.         pop     edi esi ecx
  16.         ret
  17. endf
  18.  
  19. ;-----------------------------------------------------------------------------
  20. func set_cur_tab ;///// SET SPECIFIED TAB CURRENT (FOCUS IT) /////////////////
  21. ;-----------------------------------------------------------------------------
  22. ; EBP = TABITEM*
  23. ;-----------------------------------------------------------------------------
  24.         push    ecx esi edi
  25.         cmp     [tab_bar.Current.Ptr],0
  26.         je      @f
  27.         call    flush_cur_tab
  28.     @@: mov     esi,ebp
  29.         mov     edi,cur_tab
  30.         mov     ecx,sizeof.TABITEM/4
  31.         rep     movsd
  32.         mov     [tab_bar.Current.Ptr],ebp
  33.         call    update_caption
  34.         pop     edi esi ecx
  35.         ret
  36. endf
  37.  
  38. ;-----------------------------------------------------------------------------
  39. func make_tab_visible ;///// MAKE SPECIFIED TAB VISIBLE IF IT'S OFFSCREEN ////
  40. ;-----------------------------------------------------------------------------
  41.         push    ebp
  42.         imul    eax,[tab_bar.Items.Left],sizeof.TABITEM
  43.         add     eax,[tab_bar.Items]
  44.         cmp     eax,ebp
  45.         jb      .go_right
  46.         ja      .go_left
  47.         add     esp,4
  48.         ret
  49.  
  50.   .go_right:
  51.         call    get_hidden_tabitems_number
  52.         cmp     ebp,[esp]
  53.         ja      .lp1
  54.     @@: inc     [tab_bar.Items.Left]
  55.         call    get_hidden_tabitems_number
  56.         cmp     ebp,[esp]
  57.         jbe     @b
  58.     @@: inc     [tab_bar.Items.Left]
  59.   .lp1: pop     ebp
  60.         ret
  61.  
  62.   .go_left:
  63.         mov     eax,ebp
  64.         sub     eax,[tab_bar.Items]
  65.         jz      @f
  66.         cwde
  67.         mov     ebx,sizeof.TABITEM
  68.         div     ebx
  69.     @@: mov     [tab_bar.Items.Left],eax
  70.         add     esp,4
  71.         ret
  72. endf
  73.  
  74. ;-----------------------------------------------------------------------------
  75. func create_tab ;///// ADD TAB TO THE END ////////////////////////////////////
  76. ;-----------------------------------------------------------------------------
  77.         push    eax ecx esi edi
  78.  
  79.         inc     [tab_bar.Items.Count]
  80.         imul    ebx,[tab_bar.Items.Count],sizeof.TABITEM
  81.         mov     eax,[tab_bar.Items]
  82.         mov     ecx,eax
  83.         call    mem.ReAlloc
  84.         mov     [tab_bar.Items],eax
  85.         sub     ecx,eax
  86.         sub     [tab_bar.Current.Ptr],ecx
  87.         lea     ebp,[eax+ebx-sizeof.TABITEM]
  88.         call    set_cur_tab
  89.         call    make_tab_visible
  90.  
  91.         mov     eax,1024
  92.         call    mem.Alloc
  93.         mov     [cur_editor.Lines],eax
  94.         mov     [cur_editor.Lines.Count],1
  95.         mov     [cur_editor.Columns.Count],1
  96.         xor     eax,eax
  97.         mov     [cur_editor.TopLeft.X],eax
  98.         mov     [cur_editor.TopLeft.Y],eax
  99.         mov     [cur_editor.Caret.X],eax
  100.         mov     [cur_editor.Caret.Y],eax
  101.         mov     [cur_editor.SelStart.X],eax
  102.         mov     [cur_editor.SelStart.Y],eax
  103.         mov     edi,[cur_editor.Lines]
  104.         add     edi,4
  105.         mov     ecx,10
  106.         mov     [edi-4],ecx
  107.         mov     [edi+10],eax
  108.         mov     al,' '
  109.         cld
  110.         rep     stosb
  111.  
  112.         mov     esi,s_defname
  113.         mov     edi,cur_editor.FilePath
  114.         mov     ecx,s_defname.size
  115.         rep     movsb
  116.         mov     [cur_editor.FileName],0
  117.  
  118.         mov     [f_info.length],0
  119.         mov     [cur_editor.Modified],0
  120.         mov     [cur_editor.AsmMode],0
  121.  
  122.         call    flush_cur_tab
  123.         call    update_caption
  124.         call    drawwindow
  125.  
  126.         mov     ebp,cur_tab
  127.         pop     edi esi ecx eax
  128.         ret
  129. endf
  130.  
  131. ;-----------------------------------------------------------------------------
  132. func delete_tab ;///// DELETE SPECIFIED TAB //////////////////////////////////
  133. ;-----------------------------------------------------------------------------
  134.         mov     eax,[ebp+TABITEM.Editor.Lines]
  135.         call    mem.Free
  136.         imul    ecx,[tab_bar.Items.Count],sizeof.TABITEM
  137.         add     ecx,[tab_bar.Items]
  138.         sub     ecx,ebp
  139.         sub     ecx,sizeof.TABITEM
  140.         jle     @f
  141.         cld
  142.         shr     ecx,2
  143.         mov     edi,ebp
  144.         lea     esi,[edi+sizeof.TABITEM]
  145.         rep     movsd
  146.     @@: dec     [tab_bar.Items.Count]
  147.         jz      .no_tabs
  148.         imul    ebx,[tab_bar.Items.Count],sizeof.TABITEM
  149.         push    ebx
  150.         mov     eax,[tab_bar.Items]
  151.         mov     ecx,eax
  152.         call    mem.ReAlloc
  153.         mov     [tab_bar.Items],eax
  154.         sub     ecx,eax
  155.         sub     ebp,ecx
  156.  
  157.         pop     ecx
  158.         add     ecx,[tab_bar.Items]
  159.         sub     ecx,ebp
  160.         ja      @f
  161.         add     ebp,-sizeof.TABITEM
  162.  
  163.     @@: mov     [tab_bar.Current.Ptr],0
  164.         call    set_cur_tab
  165.         call    make_tab_visible
  166.         call    drawwindow
  167.         ret
  168.  
  169.   .no_tabs:
  170.         mov     eax,[tab_bar.Items]
  171.         call    mem.Free
  172.         mov     [tab_bar.Items],0
  173.         mov     [tab_bar.Current.Ptr],0
  174.         ret
  175. endf
  176.  
  177. ;-----------------------------------------------------------------------------
  178. func draw_tabctl ;///// DRAW TAB CONTROL /////////////////////////////////////
  179. ;-----------------------------------------------------------------------------
  180.  
  181.         dec     [tab_bar.Items.Left]
  182.         js      .lp1
  183.     @@: call    get_hidden_tabitems_number
  184.         or      eax,eax
  185.         jnz     .lp1
  186.         dec     [tab_bar.Items.Left]
  187.         jns     @b
  188.   .lp1: inc     [tab_bar.Items.Left]
  189.         mov     eax,[tab_bar.Items.Count]
  190.         cmp     [tab_bar.Items.Left],eax
  191.         jb      @f
  192.         dec     eax
  193.         mov     [tab_bar.Items.Left],eax
  194.     @@:
  195.  
  196.         mov     eax,8
  197.         mov     edx,[tab_bar.Buttons.First]
  198.     @@: cmp     edx,[tab_bar.Buttons.Last]
  199.         ja      @f
  200.         push    edx
  201.         or      edx,0x80000000
  202.         mcall
  203.         pop     edx
  204.         inc     edx
  205.         jmp     @b
  206.     @@:
  207.  
  208.         mov     ebx,[tab_bar.Bounds.Left-2]
  209.         mov     bx,word[tab_bar.Bounds.Right]
  210.         sub     bx,word[tab_bar.Bounds.Left]
  211.         inc     ebx
  212.         mov     ecx,[tab_bar.Bounds.Top-2]
  213.         mov     cx,word[tab_bar.Bounds.Bottom]
  214.         sub     cx,word[tab_bar.Bounds.Top]
  215.         inc     ecx
  216.         mov     edx,[cl_3d_normal]
  217.         call    draw_framerect
  218.  
  219.         mov     al,[tab_bar.Style]
  220.         dec     al
  221.         jz      .tabs_on_top
  222.         dec     al
  223.         jz      .tabs_on_bottom
  224.         dec     al
  225.         jz      .tabs_on_left
  226.         dec     al
  227.         jz      .tabs_on_right
  228.         ret
  229.  
  230.   .tabs_on_top:
  231.         add     ebx,1*65536-2
  232.         mov     ecx,[tab_bar.Bounds.Top-2]
  233.         xor     cx,cx
  234.         add     ecx,1*65536+TBARH
  235.         mcall   13
  236.         add     ecx,(TBARH-1)*65536-(TBARH-1)
  237.         mcall   ,,,[sc.work]
  238.         add     ecx,-1*65536+2
  239.         mov     edx,[cl_3d_inset]
  240.         call    draw_framerect
  241.  
  242.         mov     esi,[tab_bar.Bounds.Left]
  243.         inc     esi
  244.         mov     edi,[tab_bar.Bounds.Top]
  245.         inc     edi
  246.         push    .curr_top .check_horz .next_horz
  247.         call    .draw_tabs
  248.         ret
  249.  
  250.   .tabs_on_bottom:
  251.         add     ebx,1*65536-2
  252.         mov     ecx,[tab_bar.Bounds.Bottom-2]
  253.         xor     cx,cx
  254.         add     ecx,-TBARH*65536+TBARH
  255.         mcall   13
  256.         mov     cx,1
  257.         mcall   ,,,[sc.work]
  258.         add     ecx,-1*65536+2
  259.         mov     edx,[cl_3d_inset]
  260.         call    draw_framerect
  261.  
  262.         mov     esi,[tab_bar.Bounds.Left]
  263.         inc     esi
  264.         mov     edi,[tab_bar.Bounds.Bottom]
  265.         add     edi,-TBARH+1
  266.         push    .curr_bottom .check_horz .next_horz
  267.         call    .draw_tabs
  268.         ret
  269.  
  270.   .tabs_on_left:
  271.         call    get_max_tab_width
  272.         mov     ebx,[tab_bar.Bounds.Left-2]
  273.         mov     bx,ax
  274.         add     ebx,1*65536-1
  275.         add     ecx,1*65536-2
  276.         push    eax
  277.         mcall   13
  278.         pop     ebx
  279.         shl     ebx,16
  280.         add     ebx,1*65536+1
  281.         mcall   ,,,[sc.work]
  282.         add     ebx,-1*65536+2
  283.         mov     edx,[cl_3d_inset]
  284.         call    draw_framerect
  285.  
  286.         mov     esi,[tab_bar.Bounds.Left]
  287.         inc     esi
  288.         mov     edi,[tab_bar.Bounds.Top]
  289.         inc     edi
  290.         push    .curr_left .check_vert .next_vert
  291.         call    .draw_tabs
  292.         ret
  293.  
  294.   .tabs_on_right:
  295.         call    get_max_tab_width
  296.         push    eax
  297.         mov     ebx,[tab_bar.Bounds.Right-2]
  298.         mov     bx,ax
  299.         shl     eax,16
  300.         sub     ebx,eax
  301.         add     ecx,1*65536-2
  302.         mcall   13
  303.         add     ebx,-1*65536
  304.         mov     bx,1
  305.         mcall   ,,,[sc.work]
  306.         add     ebx,-1*65536+2
  307.         mov     edx,[cl_3d_inset]
  308.         call    draw_framerect
  309.  
  310.         mov     esi,[tab_bar.Bounds.Right]
  311.         pop     eax
  312.         sub     esi,eax
  313.         mov     edi,[tab_bar.Bounds.Top]
  314.         inc     edi
  315.         push    .curr_right .check_vert .next_vert
  316.         call    .draw_tabs
  317.         ret
  318.  
  319.  
  320.   .draw_tabs:
  321.         mov     ecx,[tab_bar.Items.Count]
  322.         mov     ebx,[tab_bar.Items.Left]
  323.         imul    ebp,ebx,sizeof.TABITEM
  324.         add     ebp,[tab_bar.Items]
  325.         push    ecx
  326.         sub     [esp],ebx
  327.         add     ebx,1000
  328.         mov     [tab_bar.Buttons.First],ebx
  329.         dec     ebx
  330.         mov     [tab_bar.Buttons.Last],ebx
  331.     @@: push    ecx
  332.  
  333.         call    get_tab_size
  334.  
  335.         call    dword[esp+(8+4)+4]
  336.         jc      .draw_tabs.dontfit
  337.  
  338.         rol     ebx,16
  339.         mov     bx,si
  340.         rol     ebx,16
  341.         rol     ecx,16
  342.         mov     cx,di
  343.         rol     ecx,16
  344.         mov     edx,[cl_3d_inset]
  345.         call    draw_framerect
  346.  
  347.         mov     edx,[sc.work_text]
  348.         cmp     ebp,[tab_bar.Current.Ptr]
  349.         jne     .draw_tabs.inactive
  350.         push    ebx ecx
  351.         call    dword[esp+(8+4)+8+8]
  352.         mcall   13,,,[sc.work]
  353.         pop     ecx ebx
  354.         mov     edx,[color_tbl+4*0]
  355.   .draw_tabs.inactive:
  356.  
  357.         push    ebx ecx esi edx
  358.         lea     eax,[ebp+TABITEM.Editor.FilePath]
  359.         add     eax,[ebp+TABITEM.Editor.FileName]
  360.         mov     edx,eax
  361.         call    strlen
  362.         mov     esi,eax
  363.         shr     ecx,16
  364.         mov     bx,cx
  365.         add     ebx,0x00050005
  366.         pop     ecx
  367.         mcall   4
  368.         pop     esi ecx ebx
  369.  
  370.         inc     [tab_bar.Buttons.Last]
  371.         cmp     ebp,[tab_bar.Current.Ptr]
  372.         je      .draw_tabs.active
  373.         push    ebx ecx
  374.         dec     ebx
  375.         dec     ecx
  376.         mov     edx,[tab_bar.Buttons.Last]
  377.         or      edx,0x40000000
  378.         mcall   8
  379.         pop     ecx ebx
  380.   .draw_tabs.active:
  381.  
  382.         call    dword[esp+(8+4)+0]
  383.         add     ebp,sizeof.TABITEM
  384.  
  385.         pop     ecx
  386.         dec     ecx
  387.         dec     dword[esp]
  388.         jnz     @b
  389.  
  390.         add     esp,4
  391.         or      ecx,ecx
  392.         jnz     @f
  393.  
  394.         ret     8
  395.  
  396.   .draw_tabs.dontfit:
  397.  
  398.         add     esp,8
  399.  
  400.     @@: mov     ebx,[tab_bar.Bounds.Right]
  401.         shl     ebx,16
  402.         mov     ecx,[tab_bar.Bounds.Bottom]
  403.         shl     ecx,16
  404.         add     ecx,(-SCRLW-1)*65536+SCRLW
  405.         call    get_max_tab_width
  406.         mov     edx,eax
  407.  
  408.         mov     al,[tab_bar.Style]
  409.         dec     al
  410.         jz      .scroll_on_top
  411.         dec     al
  412.         jz      .scroll_on_bottom
  413.         dec     al
  414.         jz      .scroll_on_left
  415.         dec     al
  416.         jz      .scroll_on_right
  417.         ret
  418.  
  419.   .scroll_on_top:
  420.         add     ebx,(-SCRLW*2-1)*65536+SCRLW
  421.         mov     ecx,[tab_bar.Bounds.Top]
  422.         shl     ecx,16
  423.         add     ecx,1*65536+SCRLW
  424.         jmp     .draw_tabs.draw_scroll
  425.   .scroll_on_bottom:
  426.         add     ebx,(-SCRLW*2-1)*65536+SCRLW
  427.         jmp     .draw_tabs.draw_scroll
  428.   .scroll_on_left:
  429.         mov     ebx,[tab_bar.Bounds.Left]
  430.         add     ebx,edx
  431.         shl     ebx,16
  432.         add     ebx,(-SCRLW*2)*65536+SCRLW
  433.         jmp     .draw_tabs.draw_scroll
  434.   .scroll_on_right:
  435.         shl     edx,16
  436.         sub     ebx,edx
  437.         add     ebx,SCRLW
  438.  
  439.   .draw_tabs.draw_scroll:
  440.         mcall   8,,,'TBG' or 0x40000000
  441.         push    ebx
  442.         add     ebx,SCRLW*65536
  443.         mcall   8,,,'TBL' or 0x40000000
  444.         pop     ebx
  445.         push    ebx ecx
  446.         sar     ebx,16
  447.         sar     ecx,16
  448.         push    ebx ecx SCRLW SCRLW
  449.         call    draw_3d_panel
  450.         add     ebx,SCRLW
  451.         push    ebx ecx SCRLW SCRLW
  452.         call    draw_3d_panel
  453.         pop     ecx ebx
  454.  
  455.         push    '<'
  456.         shr     ecx,16
  457.         mov     bx,cx
  458.         add     ebx,(SCRLW/2-2)*65536+SCRLW/2-3
  459.         mcall   4,,[sc.work_text],esp,1
  460.         add     ebx,0x00020000
  461.         mcall
  462.         add     ebx,(SCRLW-2)*65536
  463.         mov     byte[esp],'>'
  464.         mcall
  465.         add     ebx,0x00020000
  466.         mcall
  467.         add     esp,4
  468.  
  469.         ret     8
  470.  
  471.   .curr_left:
  472.         add     ebx,0x00010000
  473.         add     ecx,1*65536-2
  474.         ret
  475.   .curr_top:
  476.         add     ebx,1*65536-2
  477.         add     ecx,0x00010000
  478.         ret
  479.   .curr_right:
  480.         dec     ebx
  481.         add     ecx,1*65536-2
  482.         ret
  483.   .curr_bottom:
  484.         add     ebx,1*65536-2
  485.         dec     ecx
  486.         ret
  487.  
  488.   .check_horz:
  489.         lea     eax,[ebx-1]
  490.         add     eax,esi
  491.         sub     eax,[tab_bar.Bounds.Right]
  492.         jge     .check.dontfit
  493.         add     eax,SCRLW*2+2
  494.         jl      .check.fit
  495.         cmp     dword[esp+4],1
  496.         jbe     .check.fit
  497.   .check.dontfit:
  498.         stc
  499.         ret
  500.   .check_vert:
  501.         lea     eax,[ecx-1]
  502.         add     eax,edi
  503.         sub     eax,[tab_bar.Bounds.Bottom]
  504.         jge     .check.dontfit
  505.         add     eax,SCRLW+2
  506.         jl      .check.fit
  507.         cmp     dword[esp+4],1
  508.         ja      .check.dontfit
  509.   .check.fit:
  510.         clc
  511.         ret
  512.  
  513.   .next_horz:
  514.         movzx   ebx,bx
  515.         lea     esi,[esi+ebx+1]
  516.         ret
  517.   .next_vert:
  518.         movzx   ecx,cx
  519.         lea     edi,[edi+ecx+1]
  520.         ret
  521. endf
  522.  
  523. ;-----------------------------------------------------------------------------
  524. func get_tab_size ;///// GET TAB WIDTH ///////////////////////////////////////
  525. ;-----------------------------------------------------------------------------
  526. ; EBP = TABITEM*
  527. ;-----------------------------------------------------------------------------
  528.         push    eax
  529.         cmp     [tab_bar.Style],3
  530.         jae     .lp1
  531.         lea     eax,[ebp+TABITEM.Editor.FilePath]
  532.         add     eax,[ebp+TABITEM.Editor.FileName]
  533.         call    strlen
  534.         imul    ebx,eax,6
  535.         add     ebx,9
  536.         jmp     .lp2
  537.   .lp1: call    get_max_tab_width
  538.         mov     ebx,eax
  539.   .lp2: mov     ecx,TBARH-1
  540.         pop     eax
  541.         ret
  542. endf
  543.  
  544. ;-----------------------------------------------------------------------------
  545. func get_max_tab_width ;///// GET WIDTH OF LONGEST TAB ///////////////////////
  546. ;-----------------------------------------------------------------------------
  547.         push    ebx ecx ebp
  548.         mov     ecx,[tab_bar.Items.Count]
  549.         mov     ebp,[tab_bar.Items]
  550.         xor     ebx,ebx
  551.     @@: dec     ecx
  552.         js      @f
  553.  
  554.         lea     eax,[ebp+TABITEM.Editor.FilePath]
  555.         add     eax,[ebp+TABITEM.Editor.FileName]
  556.         call    strlen
  557.         imul    eax,6
  558.         add     eax,9
  559.  
  560.         add     ebp,sizeof.TABITEM
  561.         cmp     ebx,eax
  562.         jae     @b
  563.         mov     ebx,eax
  564.         jmp     @b
  565.     @@: mov     eax,ebx
  566.         cmp     eax,SCRLW*2+2
  567.         jae     @f
  568.         mov     eax,SCRLW*2+2
  569.     @@: pop     ebp ecx ebx
  570.         ret
  571. endf
  572.  
  573. ;-----------------------------------------------------------------------------
  574. func get_hidden_tabitems_number ;/////////////////////////////////////////////
  575. ;-----------------------------------------------------------------------------
  576.         mov     al,[tab_bar.Style]
  577.         dec     al
  578.         dec     al
  579.         jle     .tabs_horz
  580.         dec     al
  581.         dec     al
  582.         jle     .tabs_vert
  583.         ret
  584.  
  585.   .tabs_horz:
  586.         push    draw_tabctl.check_horz draw_tabctl.next_horz
  587.         call    .calc_tabs
  588.         ret
  589.  
  590.   .tabs_vert:
  591.         push    draw_tabctl.check_vert draw_tabctl.next_vert
  592.         call    .calc_tabs
  593.         ret
  594.  
  595.   .calc_tabs:
  596.         mov     esi,[tab_bar.Bounds.Left]
  597.         inc     esi
  598.         mov     edi,[tab_bar.Bounds.Top]
  599.         inc     edi
  600.         mov     ecx,[tab_bar.Items.Count]
  601.         mov     ebp,[tab_bar.Items]
  602.         imul    eax,[tab_bar.Items.Left],sizeof.TABITEM
  603.         add     ebp,eax
  604.         mov     eax,ecx
  605.         sub     eax,[tab_bar.Items.Left]
  606.         push    eax
  607.     @@: push    ecx
  608.  
  609.         call    get_tab_size
  610.  
  611.         call    dword[esp+(8+4)+4]
  612.         jc      .calc_tabs.dontfit
  613.  
  614.         call    dword[esp+(8+4)+0]
  615.         add     ebp,sizeof.TABITEM
  616.  
  617.         pop     ecx
  618.         dec     ecx
  619.         dec     dword[esp]
  620.         jnz     @b
  621.  
  622.         jmp     @f
  623.  
  624.   .calc_tabs.dontfit:
  625.  
  626.         add     esp,4
  627.     @@: pop     ecx
  628.         mov     eax,ecx
  629.         ret     8
  630. endf
  631.  
  632. ;-----------------------------------------------------------------------------
  633. func align_editor_in_tab ;///// ADJUST EDITOR POSITION TO FIT IN TAB /////////
  634. ;-----------------------------------------------------------------------------
  635.         m2m     [cur_editor.Bounds.Left],[tab_bar.Bounds.Left]
  636.         m2m     [cur_editor.Bounds.Top],[tab_bar.Bounds.Top]
  637.         m2m     [cur_editor.Bounds.Right],[tab_bar.Bounds.Right]
  638.         m2m     [cur_editor.Bounds.Bottom],[tab_bar.Bounds.Bottom]
  639.  
  640.         inc     [cur_editor.Bounds.Left]
  641.         inc     [cur_editor.Bounds.Top]
  642.         dec     [cur_editor.Bounds.Right]
  643.         dec     [cur_editor.Bounds.Bottom]
  644.  
  645.         call    get_max_tab_width
  646.         lea     ebx,[eax+1]
  647.  
  648.         mov     al,[tab_bar.Style]
  649.         dec     al
  650.         jz      .tabs_on_top
  651.         dec     al
  652.         jz      .tabs_on_bottom
  653.         dec     al
  654.         jz      .tabs_on_left
  655.         dec     al
  656.         jz      .tabs_on_right
  657.         ret
  658.  
  659.   .tabs_on_top:
  660.         add     [cur_editor.Bounds.Top],TBARH
  661.         ret
  662.  
  663.   .tabs_on_bottom:
  664.         sub     [cur_editor.Bounds.Bottom],TBARH
  665.         ret
  666.  
  667.   .tabs_on_left:
  668.         add     [cur_editor.Bounds.Left],ebx
  669.         ret
  670.  
  671.   .tabs_on_right:
  672.         sub     [cur_editor.Bounds.Right],ebx
  673.         ret
  674. endf
  675.