Subversion Repositories Kolibri OS

Rev

Rev 1008 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. diff16 'tp-button.asm',0,$
  2.  
  3. button:
  4.         mcall   17
  5.         cmp     al,0
  6.         jne     still
  7.         shr     eax,8
  8.  
  9.         cmp     [bot_mode],0
  10.         je      @f
  11.         mov     ebx,eax
  12.         mov     al,3
  13.         call    [bot_dlg_handler]
  14.         jmp     still.skip_write
  15.  
  16.     @@: mov     esi,accel_table2
  17.   .acc: cmp     eax,[esi]
  18.         jne     @f
  19.         call    dword[esi+4]
  20.         jmp     still.skip_write
  21.     @@: add     esi,8
  22.         cmp     byte[esi],0
  23.         jne     .acc
  24.  
  25.         cmp     eax,[tab_bar.Buttons.First]
  26.         jb      @f
  27.         cmp     eax,[tab_bar.Buttons.Last]
  28.         ja      @f
  29.  
  30.         ;// TAB CONTROL BUTTONS
  31.  
  32.         add     eax,-1000
  33.         imul    ebp,eax,sizeof.TABITEM
  34.         add     ebp,[tab_bar.Items]
  35.         cmp     ebp,[tab_bar.Current.Ptr]
  36.         je      @f
  37.         call    set_cur_tab
  38.         call    align_editor_in_tab
  39.         call    draw_editor
  40.         call    draw_statusbar
  41.         call    draw_tabctl
  42.         call    update_caption
  43.  
  44.     @@:
  45.         jmp     still.skip_write
  46.  
  47.   btn.vscroll_up:
  48.         dec     [cur_editor.TopLeft.Y]
  49.         jns     @f
  50.         inc     [cur_editor.TopLeft.Y]
  51.         ret
  52.     @@: call    editor_check_for_changes.direct
  53.         ret
  54.  
  55.   btn.vscroll_down:
  56.         inc     [cur_editor.TopLeft.Y]
  57.         mov     eax,[cur_editor.Lines.Count]
  58.         sub     eax,[lines.scr]
  59.         cmp     eax,[cur_editor.TopLeft.Y]
  60.         jge     @f
  61.         dec     [cur_editor.TopLeft.Y]
  62.         ret
  63.     @@: call    editor_check_for_changes.direct
  64.         ret
  65.  
  66.   btn.hscroll_up:
  67.         dec     [cur_editor.TopLeft.X]
  68.         jns     @f
  69.         inc     [cur_editor.TopLeft.X]
  70.         ret
  71.     @@: call    editor_check_for_changes.direct
  72.         ret
  73.  
  74.   btn.hscroll_down:
  75.         inc     [cur_editor.TopLeft.X]
  76.         mov     eax,[cur_editor.Columns.Count]
  77.         sub     eax,[columns.scr]
  78.         cmp     eax,[cur_editor.TopLeft.X]
  79.         jge     @f
  80.         dec     [cur_editor.TopLeft.X]
  81.         ret
  82.     @@: call    editor_check_for_changes.direct
  83.         ret
  84.  
  85.   btn.tabctl_right:
  86.         call    get_hidden_tabitems_number
  87.         or      eax,eax
  88.         jz      @f
  89.         inc     [tab_bar.Items.Left]
  90.         call    draw_tabctl
  91.     @@: ret
  92.   btn.tabctl_left:
  93.         dec     [tab_bar.Items.Left]
  94.         jns     @f
  95.         inc     [tab_bar.Items.Left]
  96.     @@: call    draw_tabctl
  97.         ret
  98.  
  99.   btn.debug_board:
  100.         call    open_debug_board
  101.         ret
  102.   btn.sysfuncs_txt:
  103.         call    open_sysfuncs_txt
  104.         ret
  105.  
  106. proc search
  107.         cld
  108.         mov     ecx,[cur_editor.Caret.Y]
  109.         mov     edx,ecx
  110.         call    get_line_offset
  111.         cmp     [esi+EDITOR_LINE_DATA.Size],0
  112.         je      .exit
  113.         call    get_real_length
  114.         add     esi,sizeof.EDITOR_LINE_DATA
  115.         or      eax,eax
  116.         jz      .end_line.2
  117.         mov     ecx,eax
  118.         sub     ecx,[cur_editor.Caret.X]
  119.         push    esi
  120.         add     esi,[cur_editor.Caret.X]
  121.         jmp     @f
  122.  
  123.   .next_line:
  124.         push    esi
  125.     @@: sub     ecx,[s_search.size]
  126.         inc     ecx
  127.  
  128.   .next_char:
  129.         dec     ecx
  130.         js      .end_line
  131.         xor     edi,edi
  132.  
  133.   .next_ok:
  134.         movzx   eax,byte[edi+esi]
  135.         movzx   ebx,byte[edi+s_search]
  136.  
  137.         cmp     al,$61
  138.         jb      @f
  139.         add     al,[eax+add_table-$61]
  140.     @@: cmp     bl,$61
  141.         jb      @f
  142.         add     bl,[ebx+add_table-$61]
  143.     @@:
  144.         cmp     al,bl
  145.         je      @f
  146.  
  147.         inc     esi
  148.         jmp     .next_char
  149.     @@:
  150.         inc     edi
  151.         cmp     edi,[s_search.size]
  152.         jne     .next_ok
  153.  
  154.   .found:
  155.         add     esp,4
  156.         mov     [cur_editor.Caret.Y],edx
  157.         mov     [cur_editor.SelStart.Y],edx
  158.         mov     ecx,edx
  159.         lea     eax,[esi-sizeof.EDITOR_LINE_DATA]
  160.         call    get_line_offset
  161.         sub     eax,esi
  162.         mov     [cur_editor.SelStart.X],eax
  163.         add     eax,[s_search.size]
  164.         mov     [cur_editor.Caret.X],eax
  165.         mov     [s_status],0
  166.         clc
  167.         ret
  168.  
  169.   .end_line:
  170.         pop     esi
  171.   .end_line.2:
  172.         mov     eax,[esi-sizeof.EDITOR_LINE_DATA+EDITOR_LINE_DATA.Size]
  173.         add     esi,eax
  174.         inc     edx
  175.         call    get_real_length
  176.         mov     ecx,eax
  177.         lodsd
  178.         add     esi,2
  179.         or      eax,eax
  180.         jnz     .next_line
  181.   .exit:
  182.         mov     [s_status],s_text_not_found
  183.         stc
  184.         ret
  185. endp
  186.