Subversion Repositories Kolibri OS

Rev

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

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