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