Rev 617 | Rev 1008 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
824 | mikedld | 1 | diff16 'tp-button.asm',0,$ |
2 | |||
258 | mikedld | 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 |
||
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 | |||
267 | mikedld | 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 |
||
297 | mikedld | 42 | call update_caption |
267 | mikedld | 43 | |
44 | @@: |
||
258 | mikedld | 45 | jmp still.skip_write |
46 | |||
267 | mikedld | 47 | btn.vscroll_up: |
297 | mikedld | 48 | dec [cur_editor.TopLeft.Y] |
258 | mikedld | 49 | jns @f |
297 | mikedld | 50 | inc [cur_editor.TopLeft.Y] |
259 | mikedld | 51 | ret |
312 | mikedld | 52 | @@: call editor_check_for_changes.direct |
258 | mikedld | 53 | ret |
54 | |||
267 | mikedld | 55 | btn.vscroll_down: |
297 | mikedld | 56 | inc [cur_editor.TopLeft.Y] |
57 | mov eax,[cur_editor.Lines.Count] |
||
258 | mikedld | 58 | sub eax,[lines.scr] |
297 | mikedld | 59 | cmp eax,[cur_editor.TopLeft.Y] |
258 | mikedld | 60 | jge @f |
297 | mikedld | 61 | dec [cur_editor.TopLeft.Y] |
259 | mikedld | 62 | ret |
312 | mikedld | 63 | @@: call editor_check_for_changes.direct |
258 | mikedld | 64 | ret |
65 | |||
267 | mikedld | 66 | btn.hscroll_up: |
297 | mikedld | 67 | dec [cur_editor.TopLeft.X] |
258 | mikedld | 68 | jns @f |
297 | mikedld | 69 | inc [cur_editor.TopLeft.X] |
258 | mikedld | 70 | ret |
312 | mikedld | 71 | @@: call editor_check_for_changes.direct |
297 | mikedld | 72 | ret |
258 | mikedld | 73 | |
267 | mikedld | 74 | btn.hscroll_down: |
297 | mikedld | 75 | inc [cur_editor.TopLeft.X] |
76 | mov eax,[cur_editor.Columns.Count] |
||
258 | mikedld | 77 | sub eax,[columns.scr] |
297 | mikedld | 78 | cmp eax,[cur_editor.TopLeft.X] |
258 | mikedld | 79 | jge @f |
297 | mikedld | 80 | dec [cur_editor.TopLeft.X] |
259 | mikedld | 81 | ret |
312 | mikedld | 82 | @@: call editor_check_for_changes.direct |
258 | mikedld | 83 | ret |
84 | |||
267 | mikedld | 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 | |||
297 | mikedld | 99 | btn.debug_board: |
100 | call open_debug_board |
||
101 | ret |
||
102 | btn.sysfuncs_txt: |
||
103 | call open_sysfuncs_txt |
||
104 | ret |
||
258 | mikedld | 105 | |
617 | mikedld | 106 | proc search |
258 | mikedld | 107 | cld |
297 | mikedld | 108 | mov ecx,[cur_editor.Caret.Y] |
258 | mikedld | 109 | mov edx,ecx |
110 | call get_line_offset |
||
111 | cmp word[esi],0 |
||
112 | je .exit |
||
113 | call get_real_length |
||
114 | add esi,4 |
||
115 | or eax,eax |
||
116 | jz .end_line.2 |
||
117 | mov ecx,eax |
||
297 | mikedld | 118 | sub ecx,[cur_editor.Caret.X] |
258 | mikedld | 119 | push esi |
297 | mikedld | 120 | add esi,[cur_editor.Caret.X] |
258 | mikedld | 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 |
||
297 | mikedld | 156 | mov [cur_editor.Caret.Y],edx |
157 | mov [cur_editor.SelStart.Y],edx |
||
258 | mikedld | 158 | mov ecx,edx |
159 | lea eax,[esi-4] |
||
160 | call get_line_offset |
||
161 | sub eax,esi |
||
297 | mikedld | 162 | mov [cur_editor.SelStart.X],eax |
258 | mikedld | 163 | add eax,[s_search.size] |
297 | mikedld | 164 | mov [cur_editor.Caret.X],eax |
258 | mikedld | 165 | mov [s_status],0 |
166 | clc |
||
167 | ret |
||
168 | |||
169 | .end_line: |
||
170 | pop esi |
||
171 | .end_line.2: |
||
172 | movzx eax,word[esi-4] |
||
297 | mikedld | 173 | add esi,eax |
258 | mikedld | 174 | inc edx |
175 | call get_real_length |
||
176 | mov ecx,eax |
||
177 | lodsd |
||
178 | or eax,eax |
||
179 | jnz .next_line |
||
180 | .exit: |
||
181 | mov [s_status],s_text_not_found |
||
182 | stc |
||
183 | ret |
||
617 | mikedld | 184 | endp |