Subversion Repositories Kolibri OS

Rev

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

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