Subversion Repositories Kolibri OS

Rev

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

Rev 824 Rev 987
1
diff16 'tp-tabctl.asm',0,$
1
diff16 'tp-tabctl.asm',0,$
2
 
2
 
3
;-----------------------------------------------------------------------------
3
;-----------------------------------------------------------------------------
4
proc flush_cur_tab ;///// SAVE CURRENT TAB DATA TO CONTROL ///////////////////
4
proc flush_cur_tab ;///// SAVE CURRENT TAB DATA TO CONTROL ///////////////////
5
;-----------------------------------------------------------------------------
5
;-----------------------------------------------------------------------------
6
; EBP = TABITEM*
6
; EBP = TABITEM*
7
;-----------------------------------------------------------------------------
7
;-----------------------------------------------------------------------------
8
	push	ecx esi edi
8
	push	ecx esi edi
9
	mov	edi,[tab_bar.Current.Ptr]
9
	mov	edi,[tab_bar.Current.Ptr]
10
	or	edi,edi
10
	or	edi,edi
11
	jz	@f
11
	jz	@f
12
	mov	esi,cur_tab
12
	mov	esi,cur_tab
13
	mov	ecx,sizeof.TABITEM/4
13
	mov	ecx,sizeof.TABITEM/4
14
	cld
14
	cld
15
	rep	movsd
15
	rep	movsd
16
    @@: pop	edi esi ecx
16
    @@: pop	edi esi ecx
17
	ret
17
	ret
18
endp
18
endp
19
 
19
 
20
;-----------------------------------------------------------------------------
20
;-----------------------------------------------------------------------------
21
proc set_cur_tab ;///// SET SPECIFIED TAB CURRENT (FOCUS IT) /////////////////
21
proc set_cur_tab ;///// SET SPECIFIED TAB CURRENT (FOCUS IT) /////////////////
22
;-----------------------------------------------------------------------------
22
;-----------------------------------------------------------------------------
23
; EBP = TABITEM*
23
; EBP = TABITEM*
24
;-----------------------------------------------------------------------------
24
;-----------------------------------------------------------------------------
25
	push	ecx esi edi
25
	push	ecx esi edi
26
	call	flush_cur_tab
26
	call	flush_cur_tab
27
	mov	esi,ebp
27
	mov	esi,ebp
28
	mov	edi,cur_tab
28
	mov	edi,cur_tab
29
	mov	ecx,sizeof.TABITEM/4
29
	mov	ecx,sizeof.TABITEM/4
30
	rep	movsd
30
	rep	movsd
31
	mov	[tab_bar.Current.Ptr],ebp
31
	mov	[tab_bar.Current.Ptr],ebp
32
;       call    update_caption
32
;       call    update_caption
33
	pop	edi esi ecx
33
	pop	edi esi ecx
34
	ret
34
	ret
35
endp
35
endp
36
 
36
 
37
;-----------------------------------------------------------------------------
37
;-----------------------------------------------------------------------------
38
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 ////
39
;-----------------------------------------------------------------------------
39
;-----------------------------------------------------------------------------
40
	call	flush_cur_tab
40
	call	flush_cur_tab
41
	imul	eax,[tab_bar.Items.Left],sizeof.TABITEM
41
	imul	eax,[tab_bar.Items.Left],sizeof.TABITEM
42
	add	eax,[tab_bar.Items]
42
	add	eax,[tab_bar.Items]
43
	cmp	eax,ebp
43
	cmp	eax,ebp
44
	jb	.go_right
44
	jb	.go_right
45
	ja	.go_left
45
	ja	.go_left
46
	ret
46
	ret
47
 
47
 
48
  .go_right:
48
  .go_right:
49
	push	ebp
49
	push	ebp
50
	call	get_hidden_tabitems_number
50
	call	get_hidden_tabitems_number
51
	cmp	ebp,[esp]
51
	cmp	ebp,[esp]
52
	ja	@f
52
	ja	@f
53
    @@: inc	[tab_bar.Items.Left]
53
    @@: inc	[tab_bar.Items.Left]
54
	call	get_hidden_tabitems_number
54
	call	get_hidden_tabitems_number
55
	cmp	ebp,[esp]
55
	cmp	ebp,[esp]
56
	jbe	@b
56
	jbe	@b
57
    @@: pop	ebp
57
    @@: pop	ebp
58
	ret
58
	ret
59
 
59
 
60
  .go_left:
60
  .go_left:
61
	mov	eax,ebp
61
	mov	eax,ebp
62
	sub	eax,[tab_bar.Items]
62
	sub	eax,[tab_bar.Items]
63
	jz	@f
63
	jz	@f
64
	cdq
64
	cdq
65
	mov	ebx,sizeof.TABITEM
65
	mov	ebx,sizeof.TABITEM
66
	div	ebx
66
	div	ebx
67
    @@: mov	[tab_bar.Items.Left],eax
67
    @@: mov	[tab_bar.Items.Left],eax
68
	ret
68
	ret
69
endp
69
endp
70
 
70
 
71
;-----------------------------------------------------------------------------
71
;-----------------------------------------------------------------------------
72
proc create_tab ;///// ADD TAB TO THE END ////////////////////////////////////
72
proc create_tab ;///// ADD TAB TO THE END ////////////////////////////////////
73
;-----------------------------------------------------------------------------
73
;-----------------------------------------------------------------------------
74
	push	eax ecx esi edi
74
	push	eax ecx esi edi
75
 
75
 
76
	inc	[tab_bar.Items.Count]
76
	inc	[tab_bar.Items.Count]
77
	imul	ebx,[tab_bar.Items.Count],sizeof.TABITEM
77
	imul	ebx,[tab_bar.Items.Count],sizeof.TABITEM
78
	mov	eax,[tab_bar.Items]
78
	mov	eax,[tab_bar.Items]
79
	mov	ecx,eax
79
	mov	ecx,eax
80
	stdcall mem.ReAlloc,eax,ebx
80
	stdcall mem.ReAlloc,eax,ebx
81
	mov	[tab_bar.Items],eax
81
	mov	[tab_bar.Items],eax
82
	sub	ecx,eax
82
	sub	ecx,eax
83
	sub	[tab_bar.Current.Ptr],ecx
83
	sub	[tab_bar.Current.Ptr],ecx
84
	cmp	[tab_bar.Default.Ptr],0
84
	cmp	[tab_bar.Default.Ptr],0
85
	je	@f
85
	je	@f
86
	sub	[tab_bar.Default.Ptr],ecx
86
	sub	[tab_bar.Default.Ptr],ecx
87
    @@: lea	ebp,[eax+ebx-sizeof.TABITEM]
87
    @@: lea	ebp,[eax+ebx-sizeof.TABITEM]
88
	call	set_cur_tab
88
	call	set_cur_tab
89
 
89
 
90
	mov	eax,1024
90
	mov	eax,1024
91
	mov	[cur_editor.Lines.Size],eax
91
	mov	[cur_editor.Lines.Size],eax
92
	stdcall mem.Alloc,eax
92
	stdcall mem.Alloc,eax
93
	mov	[cur_editor.Lines],eax
93
	mov	[cur_editor.Lines],eax
94
	mov	[cur_editor.Lines.Count],1
94
	mov	[cur_editor.Lines.Count],1
95
	mov	[cur_editor.Columns.Count],1
95
	mov	[cur_editor.Columns.Count],1
96
	xor	eax,eax
96
	xor	eax,eax
97
	mov	[cur_editor.TopLeft.X],eax
97
	mov	[cur_editor.TopLeft.X],eax
98
	mov	[cur_editor.TopLeft.Y],eax
98
	mov	[cur_editor.TopLeft.Y],eax
99
	mov	[cur_editor.Caret.X],eax
99
	mov	[cur_editor.Caret.X],eax
100
	mov	[cur_editor.Caret.Y],eax
100
	mov	[cur_editor.Caret.Y],eax
101
	mov	[cur_editor.SelStart.X],eax
101
	mov	[cur_editor.SelStart.X],eax
102
	mov	[cur_editor.SelStart.Y],eax
102
	mov	[cur_editor.SelStart.Y],eax
103
	mov	edi,[cur_editor.Lines]
103
	mov	edi,[cur_editor.Lines]
104
	add	edi,4
104
	add	edi,sizeof.EDITOR_LINE_DATA
105
	mov	ecx,10
105
	mov	ecx,10
106
	mov	[edi-4],ecx
106
	mov	[edi-sizeof.EDITOR_LINE_DATA+EDITOR_LINE_DATA.Size],ecx
107
	mov	[edi+10],eax
107
	mov	[edi+10],eax
108
	mov	al,' '
108
	mov	al,' '
109
	cld
109
	cld
110
	rep	stosb
110
	rep	stosb
111
 
111
 
112
	mov	esi,s_defname
112
	mov	esi,s_defname
113
	mov	edi,cur_editor.FilePath + 1
113
	mov	edi,cur_editor.FilePath + 1
114
	mov	ecx,s_defname.size
114
	mov	ecx,s_defname.size
115
	rep	movsb
115
	rep	movsb
116
	mov	[cur_editor.FileName],1
116
	mov	[cur_editor.FileName],1
117
 
117
 
118
	mov	[cur_editor.Modified],0
118
	mov	[cur_editor.Modified],0
119
	mov	[cur_editor.AsmMode],0
119
	mov	[cur_editor.AsmMode],0
120
 
120
 
121
	call	flush_cur_tab
121
	call	flush_cur_tab
122
	mov	ebp,[tab_bar.Current.Ptr]
122
	mov	ebp,[tab_bar.Current.Ptr]
123
	call	make_tab_visible
123
	call	make_tab_visible
124
	call	update_caption
124
	call	update_caption
125
	cmp	[do_not_draw],0
125
	cmp	[do_not_draw],0
126
	jne	@f
126
	jne	@f
127
	call	align_editor_in_tab
127
	call	align_editor_in_tab
128
	call	draw_editor
128
	call	draw_editor
129
	call	draw_tabctl
129
	call	draw_tabctl
130
	call	draw_statusbar
130
	call	draw_statusbar
131
	call	update_caption
131
	call	update_caption
132
    @@:
132
    @@:
133
	mov	ebp,cur_tab
133
	mov	ebp,cur_tab
134
	pop	edi esi ecx eax
134
	pop	edi esi ecx eax
135
	ret
135
	ret
136
endp
136
endp
137
 
137
 
138
;-----------------------------------------------------------------------------
138
;-----------------------------------------------------------------------------
139
proc delete_tab ;///// DELETE SPECIFIED TAB //////////////////////////////////
139
proc delete_tab ;///// DELETE SPECIFIED TAB //////////////////////////////////
140
;-----------------------------------------------------------------------------
140
;-----------------------------------------------------------------------------
141
	cmp	[tab_bar.Default.Ptr],0
141
	cmp	[tab_bar.Default.Ptr],0
142
	je	@f
142
	je	@f
143
	cmp	ebp,[tab_bar.Default.Ptr]
143
	cmp	ebp,[tab_bar.Default.Ptr]
144
	je	.lp1
144
	je	.lp1
145
	ja	@f
145
	ja	@f
146
	sub	[tab_bar.Default.Ptr],sizeof.TABITEM
146
	sub	[tab_bar.Default.Ptr],sizeof.TABITEM
147
	jmp	@f
147
	jmp	@f
148
  .lp1:
148
  .lp1:
149
	mov	[tab_bar.Default.Ptr],0
149
	mov	[tab_bar.Default.Ptr],0
150
 
150
 
151
    @@: stdcall mem.Free,[ebp+TABITEM.Editor.Lines]
151
    @@: stdcall mem.Free,[ebp+TABITEM.Editor.Lines]
152
	imul	ecx,[tab_bar.Items.Count],sizeof.TABITEM
152
	imul	ecx,[tab_bar.Items.Count],sizeof.TABITEM
153
	add	ecx,[tab_bar.Items]
153
	add	ecx,[tab_bar.Items]
154
	sub	ecx,ebp
154
	sub	ecx,ebp
155
	sub	ecx,sizeof.TABITEM
155
	sub	ecx,sizeof.TABITEM
156
	jle	@f
156
	jle	@f
157
	cld
157
	cld
158
	shr	ecx,2
158
	shr	ecx,2
159
	mov	edi,ebp
159
	mov	edi,ebp
160
	lea	esi,[edi+sizeof.TABITEM]
160
	lea	esi,[edi+sizeof.TABITEM]
161
	rep	movsd
161
	rep	movsd
162
    @@: dec	[tab_bar.Items.Count]
162
    @@: dec	[tab_bar.Items.Count]
163
	jz	.no_tabs
163
	jz	.no_tabs
164
	imul	ebx,[tab_bar.Items.Count],sizeof.TABITEM
164
	imul	ebx,[tab_bar.Items.Count],sizeof.TABITEM
165
	push	ebx
165
	push	ebx
166
	mov	eax,[tab_bar.Items]
166
	mov	eax,[tab_bar.Items]
167
	mov	ecx,eax
167
	mov	ecx,eax
168
	stdcall mem.ReAlloc,eax,ebx
168
	stdcall mem.ReAlloc,eax,ebx
169
	mov	[tab_bar.Items],eax
169
	mov	[tab_bar.Items],eax
170
	sub	ecx,eax
170
	sub	ecx,eax
171
	sub	ebp,ecx
171
	sub	ebp,ecx
172
	cmp	[tab_bar.Default.Ptr],0
172
	cmp	[tab_bar.Default.Ptr],0
173
	je	@f
173
	je	@f
174
	sub	[tab_bar.Default.Ptr],ecx
174
	sub	[tab_bar.Default.Ptr],ecx
175
    @@:
175
    @@:
176
	pop	ecx
176
	pop	ecx
177
	add	ecx,[tab_bar.Items]
177
	add	ecx,[tab_bar.Items]
178
	sub	ecx,ebp
178
	sub	ecx,ebp
179
	ja	@f
179
	ja	@f
180
	add	ebp,-sizeof.TABITEM
180
	add	ebp,-sizeof.TABITEM
181
 
181
 
182
    @@: mov	[tab_bar.Current.Ptr],0
182
    @@: mov	[tab_bar.Current.Ptr],0
183
	call	set_cur_tab
183
	call	set_cur_tab
184
	call	make_tab_visible
184
	call	make_tab_visible
185
	call	align_editor_in_tab
185
	call	align_editor_in_tab
186
	call	draw_editor
186
	call	draw_editor
187
	call	draw_tabctl
187
	call	draw_tabctl
188
	call	draw_statusbar
188
	call	draw_statusbar
189
	ret
189
	ret
190
 
190
 
191
  .no_tabs:
191
  .no_tabs:
192
	stdcall mem.Free,[tab_bar.Items]
192
	stdcall mem.Free,[tab_bar.Items]
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
endp
198
endp
199
 
199
 
200
;-----------------------------------------------------------------------------
200
;-----------------------------------------------------------------------------
201
proc draw_tabctl ;///// DRAW TAB CONTROL /////////////////////////////////////
201
proc 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,[sc.work_text];[color_tbl.text]
377
	mov	edx,[sc.work_text];[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
endp
565
endp
566
 
566
 
567
;-----------------------------------------------------------------------------
567
;-----------------------------------------------------------------------------
568
proc get_tab_size ;///// GET TAB WIDTH ///////////////////////////////////////
568
proc 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
endp
589
endp
590
 
590
 
591
;-----------------------------------------------------------------------------
591
;-----------------------------------------------------------------------------
592
proc get_max_tab_width ;///// GET WIDTH OF LONGEST TAB ///////////////////////
592
proc 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
endp
621
endp
622
 
622
 
623
;-----------------------------------------------------------------------------
623
;-----------------------------------------------------------------------------
624
proc get_hidden_tabitems_number ;/////////////////////////////////////////////
624
proc 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
endp
679
endp
680
 
680
 
681
;-----------------------------------------------------------------------------
681
;-----------------------------------------------------------------------------
682
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 /////////
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
endp
723
endp
724
>
724
>