Subversion Repositories Kolibri OS

Rev

Rev 617 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

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