Subversion Repositories Kolibri OS

Rev

Rev 259 | Rev 280 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 259 Rev 267
Line 1... Line 1...
1
;-----------------------------------------------------------------------------
1
;-----------------------------------------------------------------------------
2
func draw_editor ;////////////////////////////////////////////////////////////
2
func draw_editor ;///// DRAW EDITOR //////////////////////////////////////////
3
;-----------------------------------------------------------------------------
3
;-----------------------------------------------------------------------------
Line 4... Line 4...
4
 
4
 
5
	mov	ebx,[cur_tab.Editor.Bounds.Left-2]
5
	mov	ebx,[cur_editor.Bounds.Left-2]
6
	mov	bx,word[cur_tab.Editor.Bounds.Right]
6
	mov	bx,word[cur_editor.Bounds.Right]
7
	sub	bx,word[cur_tab.Editor.Bounds.Left]
7
	sub	bx,word[cur_editor.Bounds.Left]
8
	inc	ebx
8
	inc	ebx
9
	mov	ecx,[cur_tab.Editor.Bounds.Top-2]
9
	mov	ecx,[cur_editor.Bounds.Top-2]
10
	mov	cx,word[cur_tab.Editor.Bounds.Bottom]
10
	mov	cx,word[cur_editor.Bounds.Bottom]
11
	sub	cx,word[cur_tab.Editor.Bounds.Top]
11
	sub	cx,word[cur_editor.Bounds.Top]
12
	inc	ecx
12
	inc	ecx
13
	mov	edx,[cl_3d_inset]
13
	mov	edx,[cl_3d_inset]
14
	call	draw_framerect
14
	call	draw_framerect
15
@^
15
@^
16
	mov	ebx,[cur_tab.Editor.Bounds.Left-2]
16
	mov	ebx,[cur_editor.Bounds.Left-2]
17
	mov	bx,word[cur_tab.Editor.Bounds.Right]
17
	mov	bx,word[cur_editor.Bounds.Right]
18
	mov	ecx,[cur_tab.Editor.Bounds.Top-2]
18
	mov	ecx,[cur_editor.Bounds.Top-2]
19
	mov	cx,word[cur_tab.Editor.Bounds.Top]
19
	mov	cx,word[cur_editor.Bounds.Top]
20
	mcall	38,,,[cl_3d_inset]
20
	mcall	38,,,[cl_3d_inset]
21
	mov	ecx,[cur_tab.Editor.Bounds.Bottom-2]
21
	mov	ecx,[cur_editor.Bounds.Bottom-2]
22
	mov	cx,word[cur_tab.Editor.Bounds.Bottom]
22
	mov	cx,word[cur_editor.Bounds.Bottom]
23
	mcall
23
	mcall
24
	mov	bx,word[cur_tab.Editor.Bounds.Left]
24
	mov	bx,word[cur_editor.Bounds.Left]
25
	mov	cx,word[cur_tab.Editor.Bounds.Top]
25
	mov	cx,word[cur_editor.Bounds.Top]
26
	mcall
26
	mcall
27
	mov	ebx,[cur_tab.Editor.Bounds.Right-2]
27
	mov	ebx,[cur_editor.Bounds.Right-2]
28
	mov	bx,word[cur_tab.Editor.Bounds.Right]
28
	mov	bx,word[cur_editor.Bounds.Right]
29
	mov	cx,word[cur_tab.Editor.Bounds.Top]
29
	mov	cx,word[cur_editor.Bounds.Top]
30
	mcall
30
	mcall
31
^@
31
^@
32
	mov	[cur_tab.Editor.Gutter.Visible],0
32
	mov	[cur_editor.Gutter.Visible],0
33
	test	[options],OPTS_LINENUMS
33
	test	[options],OPTS_LINENUMS
34
	jnz	@f
34
	jnz	@f
35
	xor	eax,eax ;! mov eax,2+LCHGW
35
	xor	eax,eax ;! mov eax,2+LCHGW
36
	jmp	.lp1
36
	jmp	.lp1
37
    @@: inc	[cur_tab.Editor.Gutter.Visible]
37
    @@: inc	[cur_editor.Gutter.Visible]
38
	mov	edi,p_info+100
38
	mov	edi,p_info+100
39
	mov	eax,[cur_tab.Editor.Lines] ;! eax,[lines]
39
	mov	eax,[cur_editor.Lines.Count] ;! eax,[lines]
40
	mov	ecx,10
40
	mov	ecx,10
41
	call	uint2str
41
	call	uint2str
42
	lea	eax,[edi-p_info-100]
42
	lea	eax,[edi-p_info-100]
43
	cmp	eax,3
43
	cmp	eax,3
44
	jae	@f
44
	jae	@f
45
	mov	eax,3
45
	mov	eax,3
46
    @@: imul	eax,6
46
    @@: imul	eax,6
47
	add	eax,8
47
	add	eax,8
48
  .lp1: mov	[cur_tab.Editor.Gutter.Width],eax ;! [left_ofs],eax
48
  .lp1: mov	[cur_editor.Gutter.Width],eax ;! [left_ofs],eax
Line 49... Line 49...
49
	mov	[left_ofs],eax
49
	mov	[left_ofs],eax
50
 
50
 
51
	call	draw_editor_gutter
51
	call	draw_editor_gutter
Line 57... Line 57...
57
	ret
57
	ret
58
endf
58
endf
Line 59... Line 59...
59
 
59
 
60
;-----------------------------------------------------------------------------
60
;-----------------------------------------------------------------------------
61
func draw_editor_gutter ;/////////////////////////////////////////////////////
61
func draw_editor_gutter ;///// DRAW EDITOR GUTTER (LEFT PANEL) ///////////////
62
;-----------------------------------------------------------------------------
62
;-----------------------------------------------------------------------------
63
	cmp	[cur_tab.Editor.Gutter.Visible],0
63
	cmp	[cur_editor.Gutter.Visible],0
Line 64... Line 64...
64
	je	.exit
64
	je	.exit
Line 65... Line 65...
65
 
65
 
66
	add	esp,-4*8*2
66
	add	esp,-4*8*2
67
 
67
 
68
	mov	ebx,[cur_tab.Editor.Bounds.Left-2]
68
	mov	ebx,[cur_editor.Bounds.Left-2]
69
	mov	bx,word[cur_tab.Editor.Gutter.Width]
69
	mov	bx,word[cur_editor.Gutter.Width]
70
	add	ebx,0x00010000
70
	add	ebx,0x00010000
71
	mov	ecx,[cur_tab.Editor.Bounds.Top-2]
71
	mov	ecx,[cur_editor.Bounds.Top-2]
72
	mov	cx,word[cur_tab.Editor.Bounds.Bottom]
72
	mov	cx,word[cur_editor.Bounds.Bottom]
73
	sub	cx,word[cur_tab.Editor.Bounds.Top]
73
	sub	cx,word[cur_editor.Bounds.Top]
74
	add	cx,-SCRLW
74
	add	cx,-SCRLW
Line 75... Line 75...
75
	add	ecx,0x00010000
75
	add	ecx,0x00010000
76
	dec	cx
76
	dec	cx
77
	mcall	13,,,[cl_3d_normal]
77
	mcall	13,,,[cl_3d_normal]
78
 
78
 
79
	add	bx,word[cur_tab.Editor.Bounds.Left]
79
	add	bx,word[cur_editor.Bounds.Left]
80
	push	bx
80
	push	bx
Line 81... Line 81...
81
	shl	ebx,16
81
	shl	ebx,16
82
	pop	bx
82
	pop	bx
83
	add	ecx,[cur_tab.Editor.Bounds.Top]
83
	add	ecx,[cur_editor.Bounds.Top]
84
	mcall	38,,,[cl_3d_inset]
84
	mcall	38,,,[cl_3d_inset]
85
 
85
 
86
	add	ebx,-2*65536
86
	add	ebx,-2*65536
87
	mov	bx,word[cur_tab.Editor.Bounds.Top]
87
	mov	bx,word[cur_editor.Bounds.Top]
88
	add	bx,3
88
	add	bx,3
89
	mov	edi,[sc.work_text]
89
	mov	edi,[sc.work_text]
90
	mov	ecx,[cur_tab.Editor.TopLeft.Y]
90
	mov	ecx,[cur_editor.TopLeft.Y]
Line 104... Line 104...
104
	mcall	4,,edi
104
	mcall	4,,edi
105
	popad
105
	popad
106
	add	ebx,LINEH
106
	add	ebx,LINEH
107
	inc	ecx
107
	inc	ecx
108
	cmp	ecx,[cur_tab.Editor.Lines]
108
	cmp	ecx,[cur_editor.Lines.Count]
109
	jg	@f
109
	jg	@f
110
	mov	esi,ecx
110
	mov	esi,ecx
111
	sub	esi,[cur_tab.Editor.TopLeft.Y]
111
	sub	esi,[cur_editor.TopLeft.Y]
112
	cmp	esi,[lines.scr]
112
	cmp	esi,[lines.scr]
113
	jbe	@b
113
	jbe	@b
114
    @@: add	esp,4*8*2
114
    @@: add	esp,4*8*2
115
 
115
 
Line 116... Line 116...
116
  .exit:
116
  .exit:
117
	ret
117
	ret
118
endf
118
endf
Line 119... Line 119...
119
 
119
 
120
;-----------------------------------------------------------------------------
120
;-----------------------------------------------------------------------------
121
func draw_editor_vscroll ;////////////////////////////////////////////////////
121
func draw_editor_vscroll ;///// DRAW EDITOR VERTICAL SCROLL BAR //////////////
122
;-----------------------------------------------------------------------------
-
 
123
;!!!!!!!!!!!!!!!!!!
122
;-----------------------------------------------------------------------------
124
	mov	ebx,[cur_tab.Editor.Bounds.Right]
123
	mov	ebx,[cur_editor.Bounds.Right]
125
	shl	ebx,16
124
	shl	ebx,16
126
	add	ebx,(-SCRLW)*65536+SCRLW
125
	add	ebx,(-SCRLW)*65536+SCRLW
127
	mov	ecx,[cur_tab.Editor.Bounds.Top-2]
126
	mov	ecx,[cur_editor.Bounds.Top-2]
128
	mov	cx,SCRLW
127
	mov	cx,SCRLW
129
	mcall	8,,,'UP' or 0x40000000
128
	mcall	8,,,'VSL' or 0x40000000
130
	pushad
129
	pushad
131
	sar	ebx,16
130
	sar	ebx,16
132
	sar	ecx,16
131
	sar	ecx,16
133
	push	ebx ecx SCRLW SCRLW
132
	push	ebx ecx SCRLW SCRLW
134
	call	draw_3d_panel
133
	call	draw_3d_panel
135
	popad
134
	popad
136
	mov	eax,8
-
 
Line 137... Line 135...
137
;!!!!!!!!!!!!!!!!!!
135
	mov	eax,8
138
 
136
 
139
	pushad
137
	pushad
140
	push	0x18
138
	push	0x18
141
	shr	ecx,16
139
	shr	ecx,16
142
	mov	bx,cx
140
	mov	bx,cx
143
	add	ebx,(SCRLW/2-2)*65536+SCRLW/2-3
141
	add	ebx,(SCRLW/2-2)*65536+SCRLW/2-3
144
	mcall	4,,[sc.work_text],esp,1
142
	mcall	4,,[sc.work_text],esp,1
Line 145... Line -...
145
	add	esp,4
-
 
146
	popad
143
	add	esp,4
147
 
144
	popad
148
;!!!!!!!!!!!!!!!!!!
145
 
149
	mov	ecx,[cur_tab.Editor.Bounds.Bottom]
146
	mov	ecx,[cur_editor.Bounds.Bottom]
150
	shl	ecx,16
147
	shl	ecx,16
151
	add	ecx,(-SCRLW*2)*65536+SCRLW
148
	add	ecx,(-SCRLW*2)*65536+SCRLW
152
	mcall	,,,'DN' or 0x40000000
149
	mcall	,,,'VSG' or 0x40000000
153
	pushad
150
	pushad
154
	sar	ebx,16
151
	sar	ebx,16
155
	sar	ecx,16
152
	sar	ecx,16
156
	push	ebx ecx SCRLW SCRLW
153
	push	ebx ecx SCRLW SCRLW
157
	call	draw_3d_panel
-
 
Line 158... Line 154...
158
	popad
154
	call	draw_3d_panel
159
	mov	eax,8
155
	popad
160
;!!!!!!!!!!!!!!!!!!
156
	mov	eax,8
161
 
157
 
Line 168... Line 164...
168
	add	esp,4
164
	add	esp,4
169
	popad
165
	popad
170
 
166
 
Line 171... Line 167...
171
	push	ebx
167
	push	ebx
172
	mov	eax,[cur_tab.Editor.Lines]
168
	mov	eax,[cur_editor.Lines.Count]
173
	mov	ebx,[lines.scr]
169
	mov	ebx,[lines.scr]
174
	mov	ecx,[cur_tab.Editor.TopLeft.Y]
170
	mov	ecx,[cur_editor.TopLeft.Y]
175
	mov	edx,[cur_tab.Editor.Bounds.Bottom]
171
	mov	edx,[cur_editor.Bounds.Bottom]
176
	sub	edx,[cur_tab.Editor.Bounds.Top]
172
	sub	edx,[cur_editor.Bounds.Top]
177
	add	edx,-SCRLW*3+1
173
	add	edx,-SCRLW*3+1
178
	call	get_scroll_vars
174
	call	get_scroll_vars
179
	mov	[cur_tab.Editor.VScroll.Top],eax
175
	mov	[cur_editor.VScroll.Top],eax
180
	mov	[cur_tab.Editor.VScroll.Size],ebx
176
	mov	[cur_editor.VScroll.Size],ebx
181
	pop	ebx
177
	pop	ebx
Line 182... Line 178...
182
 
178
 
183
	mov	ecx,eax
179
	mov	ecx,eax
184
	add	ecx,[cur_tab.Editor.Bounds.Top]
180
	add	ecx,[cur_editor.Bounds.Top]
Line 185... Line -...
185
	add	ecx,SCRLW+1
-
 
186
 
181
	add	ecx,SCRLW+1
187
;!!!!!!!!!!!!!!!!!!
182
 
188
	pushad
183
	pushad
189
	sar	ebx,16
184
	sar	ebx,16
190
	push	ebx ecx SCRLW [cur_tab.Editor.VScroll.Size]
185
	push	ebx ecx SCRLW [cur_editor.VScroll.Size]
191
	dec	dword[esp]
186
	dec	dword[esp]
192
	call	draw_3d_panel
187
	call	draw_3d_panel
193
	popad
-
 
194
	mov	eax,13
188
	popad
Line 195... Line 189...
195
;!!!!!!!!!!!!!!!!!!
189
	mov	eax,13
196
	add	ebx,1*65536-1
190
	add	ebx,1*65536-1
197
 
191
 
198
	mov	ecx,[cur_tab.Editor.Bounds.Top-2]
192
	mov	ecx,[cur_editor.Bounds.Top-2]
199
	mov	cx,word[cur_tab.Editor.VScroll.Top]
193
	mov	cx,word[cur_editor.VScroll.Top]
200
	add	ecx,(SCRLW+1)*65536
194
	add	ecx,(SCRLW+1)*65536
201
	mov	edx,[sc.work]
195
	mov	edx,[sc.work]
202
	or	cx,cx
196
	or	cx,cx
203
	jle	@f
197
	jle	@f
204
	mcall	13
198
	mcall	13
205
    @@:
199
    @@:
206
	mov	ecx,[cur_tab.Editor.Bounds.Top]
200
	mov	ecx,[cur_editor.Bounds.Top]
207
	add	ecx,[cur_tab.Editor.VScroll.Top]
201
	add	ecx,[cur_editor.VScroll.Top]
208
	add	ecx,[cur_tab.Editor.VScroll.Size]
202
	add	ecx,[cur_editor.VScroll.Size]
209
	add	ecx,SCRLW+1
203
	add	ecx,SCRLW+1
210
	mov	di,cx
204
	mov	di,cx
211
	shl	ecx,16
205
	shl	ecx,16
212
	mov	cx,word[cur_tab.Editor.Bounds.Bottom]
206
	mov	cx,word[cur_editor.Bounds.Bottom]
213
	sub	cx,di
207
	sub	cx,di
214
	sub	cx,SCRLW*2;+1
208
	sub	cx,SCRLW*2;+1
215
	jle	@f
209
	jle	@f
216
	mcall
210
	mcall
217
    @@:
211
    @@:
218
	rol	ebx,16
212
	rol	ebx,16
219
	dec	bx
213
	dec	bx
220
	push	bx
214
	push	bx
221
	rol	ebx,16
215
	rol	ebx,16
222
	pop	bx
216
	pop	bx
223
	mov	ecx,[cur_tab.Editor.Bounds.Top-2]
217
	mov	ecx,[cur_editor.Bounds.Top-2]
Line 224... Line 218...
224
	mov	cx,word[cur_tab.Editor.Bounds.Bottom]
218
	mov	cx,word[cur_editor.Bounds.Bottom]
225
	add	ecx,(SCRLW)*65536-SCRLW*2-1
219
	add	ecx,(SCRLW)*65536-SCRLW*2-1
Line 226... Line 220...
226
	mcall	38,,,[cl_3d_inset]
220
	mcall	38,,,[cl_3d_inset]
227
 
221
 
228
	ret
222
	ret
229
endf
223
endf
230
 
224
 
231
;-----------------------------------------------------------------------------
225
;-----------------------------------------------------------------------------
232
func draw_editor_hscroll ;////////////////////////////////////////////////////
226
func draw_editor_hscroll ;///// DRAW EDITOR HORIZONTAL SCROLL BAR ////////////
233
;-----------------------------------------------------------------------------
227
;-----------------------------------------------------------------------------
234
	mov	ebx,[cur_tab.Editor.Bounds.Left-2]
228
	mov	ebx,[cur_editor.Bounds.Left-2]
235
	mov	bx,SCRLW
229
	mov	bx,SCRLW
236
	mov	ecx,[cur_tab.Editor.Bounds.Bottom]
230
	mov	ecx,[cur_editor.Bounds.Bottom]
237
	shl	ecx,16
231
	shl	ecx,16
238
	add	ecx,(-SCRLW)*65536+SCRLW
232
	add	ecx,(-SCRLW)*65536+SCRLW
239
	mcall	8,,,'LT' or 0x40000000
233
	mcall	8,,,'HSL' or 0x40000000
240
	pushad
234
	pushad
241
	sar	ebx,16
-
 
Line 242... Line 235...
242
	sar	ecx,16
235
	sar	ebx,16
243
	push	ebx ecx SCRLW SCRLW
236
	sar	ecx,16
244
	call	draw_3d_panel
237
	push	ebx ecx SCRLW SCRLW
245
	popad
238
	call	draw_3d_panel
246
;!!!!!!!!!!!!!!!!!!
239
	popad
247
 
240
 
248
	pushad
241
	pushad
249
	push	0x1B
242
	push	0x1B
Line 250... Line -...
250
	shr	ecx,16
-
 
251
	mov	bx,cx
243
	shr	ecx,16
252
	add	ebx,(SCRLW/2-2)*65536+SCRLW/2-3
244
	mov	bx,cx
253
	mcall	4,,[sc.work_text],esp,1
245
	add	ebx,(SCRLW/2-2)*65536+SCRLW/2-3
254
	add	esp,4
246
	mcall	4,,[sc.work_text],esp,1
255
	popad
247
	add	esp,4
256
 
248
	popad
257
;!!!!!!!!!!!!!!!!!!
249
 
258
	mov	ebx,[cur_tab.Editor.Bounds.Right]
250
	mov	ebx,[cur_editor.Bounds.Right]
259
	shl	ebx,16
251
	shl	ebx,16
260
	add	ebx,(-SCRLW*2)*65536+SCRLW
252
	add	ebx,(-SCRLW*2)*65536+SCRLW
261
	mcall	8,,,'RT' or 0x40000000
-
 
Line 262... Line 253...
262
	pushad
253
	mcall	8,,,'HSG' or 0x40000000
263
	sar	ebx,16
254
	pushad
264
	sar	ecx,16
255
	sar	ebx,16
265
	push	ebx ecx SCRLW SCRLW
256
	sar	ecx,16
Line 276... Line 267...
276
	add	esp,4
267
	add	esp,4
277
	popad
268
	popad
278
 
269
 
Line 279... Line 270...
279
	push	ecx
270
	push	ecx
280
	mov	eax,[cur_tab.Editor.Columns]
271
	mov	eax,[cur_editor.Columns.Count]
281
	mov	ebx,[columns.scr]
272
	mov	ebx,[columns.scr]
282
	mov	ecx,[cur_tab.Editor.TopLeft.X]
273
	mov	ecx,[cur_editor.TopLeft.X]
283
	mov	edx,[cur_tab.Editor.Bounds.Right]
274
	mov	edx,[cur_editor.Bounds.Right]
284
	add	edx,-(SCRLW*3)
275
	add	edx,-(SCRLW*3)
285
	call	get_scroll_vars
276
	call	get_scroll_vars
286
	mov	[cur_tab.Editor.HScroll.Top],eax
277
	mov	[cur_editor.HScroll.Top],eax
287
	mov	[cur_tab.Editor.HScroll.Size],ebx
278
	mov	[cur_editor.HScroll.Size],ebx
288
	pop	ecx
279
	pop	ecx
Line 289... Line 280...
289
 
280
 
290
	mov	ebx,eax
281
	mov	ebx,eax
291
	add	ebx,[cur_tab.Editor.Bounds.Left]
282
	add	ebx,[cur_editor.Bounds.Left]
292
	add	ebx,SCRLW+1
283
	add	ebx,SCRLW+1
293
	shl	ebx,16
284
	shl	ebx,16
Line 294... Line -...
294
	mov	bx,word[cur_tab.Editor.HScroll.Size]
-
 
295
 
285
	mov	bx,word[cur_editor.HScroll.Size]
296
;!!!!!!!!!!!!!!!!!!
286
 
297
	pushad
287
	pushad
298
	sar	ecx,16
288
	sar	ecx,16
299
	rol	ebx,16
289
	rol	ebx,16
300
	movsx	eax,bx
290
	movsx	eax,bx
301
	sar	ebx,16
291
	sar	ebx,16
302
	dec	ebx
292
	dec	ebx
303
	push	eax ecx ebx SCRLW
293
	push	eax ecx ebx SCRLW
304
	call	draw_3d_panel
-
 
305
	popad
294
	call	draw_3d_panel
Line 306... Line 295...
306
;!!!!!!!!!!!!!!!!!!
295
	popad
307
	add	ecx,1*65536-1
296
	add	ecx,1*65536-1
308
 
297
 
309
	mov	ebx,[cur_tab.Editor.Bounds.Left-2]
298
	mov	ebx,[cur_editor.Bounds.Left-2]
310
	mov	bx,word[cur_tab.Editor.Bounds.Left]
299
	mov	bx,word[cur_editor.Bounds.Left]
311
	mov	bx,word[cur_tab.Editor.HScroll.Top]
300
	mov	bx,word[cur_editor.HScroll.Top]
312
	add	ebx,(1+SCRLW)*65536
301
	add	ebx,(1+SCRLW)*65536
313
	mcall	13,,,[sc.work]
302
	mcall	13,,,[sc.work]
314
	mov	ebx,[cur_tab.Editor.Bounds.Left]
303
	mov	ebx,[cur_editor.Bounds.Left]
315
	add	ebx,1+SCRLW
304
	add	ebx,1+SCRLW
316
	add	ebx,[cur_tab.Editor.HScroll.Top]
305
	add	ebx,[cur_editor.HScroll.Top]
317
	add	ebx,[cur_tab.Editor.HScroll.Size]
306
	add	ebx,[cur_editor.HScroll.Size]
318
	mov	di,bx
307
	mov	di,bx
319
	shl	ebx,16
308
	shl	ebx,16
320
	mov	bx,word[cur_tab.Editor.Bounds.Right]
309
	mov	bx,word[cur_editor.Bounds.Right]
321
	sub	bx,di
310
	sub	bx,di
322
	sub	bx,SCRLW*2
311
	sub	bx,SCRLW*2
323
	jle	@f
312
	jle	@f
324
	mcall
313
	mcall
325
    @@:
314
    @@:
326
	mov	ebx,[cur_tab.Editor.Bounds.Left-2]
315
	mov	ebx,[cur_editor.Bounds.Left-2]
327
	mov	bx,word[cur_tab.Editor.Bounds.Right]
316
	mov	bx,word[cur_editor.Bounds.Right]
328
	add	ebx,(SCRLW)*65536-SCRLW*2-1
317
	add	ebx,(SCRLW)*65536-SCRLW*2-1
329
	rol	ecx,16
318
	rol	ecx,16
Line 336... Line 325...
336
	ret
325
	ret
337
endf
326
endf
Line 338... Line 327...
338
 
327
 
339
;-----------------------------------------------------------------------------
328
;-----------------------------------------------------------------------------
340
func draw_editor_text ;///////////////////////////////////////////////////////
329
func draw_editor_text ;///// DRAW EDITOR TEXT ////////////////////////////////
341
;-----------------------------------------------------------------------------
330
;-----------------------------------------------------------------------------
342
	mov	eax,[cur_tab.Editor.Bounds.Bottom]
331
	mov	eax,[cur_editor.Bounds.Bottom]
343
	sub	eax,[cur_tab.Editor.Bounds.Top]
332
	sub	eax,[cur_editor.Bounds.Top]
344
	cmp	eax,LINEH
333
	cmp	eax,LINEH
345
	jge	@f
334
	jge	@f
346
	ret
335
	ret
347
    @@:
336
    @@:
348
	call	init_sel_vars
337
	call	init_sel_vars
Line 349... Line 338...
349
	call	check_bottom_right
338
	call	check_bottom_right
Line 350... Line 339...
350
 
339
 
351
	pushad
340
	pushad
352
 
341
 
353
	mov	eax,[cur_tab.Editor.Bounds.Left]
342
	mov	eax,[cur_editor.Bounds.Left]
354
	add	eax,[cur_tab.Editor.Gutter.Width]
343
	add	eax,[cur_editor.Gutter.Width]
355
	add	eax,LCHGW+3
344
	add	eax,LCHGW+3
356
	mov	[left_ofs],eax
345
	mov	[left_ofs],eax
Line 357... Line 346...
357
	mov	eax,[cur_tab.Editor.Bounds.Top]
346
	mov	eax,[cur_editor.Bounds.Top]
358
	add	eax,3
347
	add	eax,3
Line 359... Line 348...
359
	mov	[top_ofs],eax
348
	mov	[top_ofs],eax
360
 
349
 
361
	mov	ebx,[top_ofs]
350
	mov	ebx,[top_ofs]
Line 362... Line 351...
362
	add	ebx,[left_ofs-2]
351
	add	ebx,[left_ofs-2]
363
 
352
 
364
	mov	ecx,[cur_tab.Editor.TopLeft.Y] ;! ecx,[top_line]
353
	mov	ecx,[cur_editor.TopLeft.Y] ;! ecx,[top_line]
365
	push	ecx
354
	push	ecx
366
	call	get_line_offset
355
	call	get_line_offset
367
 
356
 
Line 368... Line 357...
368
  .start:
357
  .start:
369
	add	esp,4
358
	add	esp,4
370
	mov	ecx,[lines.scr]
359
	mov	ecx,[lines.scr]
371
	or	ecx,ecx
360
	or	ecx,ecx
Line 372... Line 361...
372
	jle	.exit
361
	jle	.exit
Line 373... Line 362...
373
	add	esp,-4
362
	add	esp,-4
Line 374... Line 363...
374
 
363
 
375
	imul	ebp,[cur_tab.Editor.TopLeft.X],6*65536 ;! ebp,[left_col],6*65536
364
	imul	ebp,[cur_editor.TopLeft.X],6*65536 ;! ebp,[left_col],6*65536
376
	mov	eax,[lines.scr]
365
	mov	eax,[lines.scr]
377
	sub	eax,[cur_tab.Editor.Lines] ;! eax,[lines]
366
	sub	eax,[cur_editor.Lines.Count] ;! eax,[lines]
378
	mov	[draw_blines],eax
367
	mov	[draw_blines],eax
379
 
368
 
380
  .next_line:
369
  .next_line:
381
 
370
 
382
	push	ecx ebx
371
	push	ecx ebx
Line 405... Line 394...
405
  .lp1: mov	eax,[sel.begin.y]
394
  .lp1: mov	eax,[sel.begin.y]
406
	cmp	eax,[sel.end.y]
395
	cmp	eax,[sel.end.y]
407
	je	.lp5
396
	je	.lp5
408
  .lp2: mov	eax,[sel.begin.x]
397
  .lp2: mov	eax,[sel.begin.x]
409
	sub	eax,[cur_tab.Editor.TopLeft.X] ;! eax,[left_col]
398
	sub	eax,[cur_editor.TopLeft.X] ;! eax,[left_col]
410
	jle	.lp6.2
399
	jle	.lp6.2
411
	cmp	eax,[columns.scr]
400
	cmp	eax,[columns.scr]
412
	jge	.lp6
401
	jge	.lp6
413
	imul	eax,6
402
	imul	eax,6
414
	pushad
403
	pushad
415
	sub	bx,ax
404
	sub	bx,ax
Line 427... Line 416...
427
  .lp3: mov	eax,[sel.begin.y]
416
  .lp3: mov	eax,[sel.begin.y]
428
	cmp	eax,[sel.end.y]
417
	cmp	eax,[sel.end.y]
429
	je	.lp5
418
	je	.lp5
430
  .lp4: mov	eax,[sel.end.x]
419
  .lp4: mov	eax,[sel.end.x]
431
	sub	eax,[cur_tab.Editor.TopLeft.X] ;! eax,[left_col]
420
	sub	eax,[cur_editor.TopLeft.X] ;! eax,[left_col]
432
	jle	.lp6
421
	jle	.lp6
433
	cmp	eax,[columns.scr]
422
	cmp	eax,[columns.scr]
434
	jg	.lp6.2
423
	jg	.lp6.2
435
	imul	eax,6
424
	imul	eax,6
436
	pushad
425
	pushad
437
	sub	bx,ax
426
	sub	bx,ax
Line 446... Line 435...
446
	mov	edx,[color_tbl+4*7]
435
	mov	edx,[color_tbl+4*7]
447
	mov	bx,ax
436
	mov	bx,ax
448
	mov	[in_sel],3
437
	mov	[in_sel],3
449
	jmp	.lp6
438
	jmp	.lp6
450
  .lp5: mov	eax,[cur_tab.Editor.TopLeft.X] ;! eax,[left_col]
439
  .lp5: mov	eax,[cur_editor.TopLeft.X] ;! eax,[left_col]
451
	cmp	eax,[sel.begin.x]
440
	cmp	eax,[sel.begin.x]
452
	jge	.lp4
441
	jge	.lp4
453
	add	eax,[columns.scr]
442
	add	eax,[columns.scr]
454
	cmp	eax,[sel.end.x]
443
	cmp	eax,[sel.end.x]
455
	jl	.lp2
444
	jl	.lp2
456
	mov	eax,[sel.begin.x]
445
	mov	eax,[sel.begin.x]
457
	cmp	eax,[sel.end.x]
446
	cmp	eax,[sel.end.x]
458
	je	.lp6
447
	je	.lp6
459
	sub	eax,[cur_tab.Editor.TopLeft.X] ;! eax,[left_col]
448
	sub	eax,[cur_editor.TopLeft.X] ;! eax,[left_col]
460
	imul	eax,6
449
	imul	eax,6
461
	pushad
450
	pushad
462
	mov	ebx,[sel.end.x]
451
	mov	ebx,[sel.end.x]
463
	sub	ebx,[sel.begin.x]
452
	sub	ebx,[sel.begin.x]
464
	imul	ebx,6
453
	imul	ebx,6
465
	sal	ebx,16
454
	sal	ebx,16
Line 502... Line 491...
502
	test	eax,0x00020000
491
	test	eax,0x00020000
503
	jz	@f
492
	jz	@f
504
	mov	edx,[color_tbl+4*9]
493
	mov	edx,[color_tbl+4*9]
505
    @@: mov	ebx,[left_ofs]
494
    @@: mov	ebx,[left_ofs]
506
	add	ebx,-LCHGW-2;-4
495
 
-
 
496
	add	ebx,-LCHGW-2;-4
507
	shl	ebx,16
497
	shl	ebx,16
508
	mov	bx,LCHGW
498
	mov	bx,LCHGW
509
	mcall	13
499
	mcall	13
510
	popad
500
	popad
511
 
501
 
Line 528... Line 518...
528
	mov	ecx,eax
518
	mov	ecx,eax
529
 
519
 
Line 530... Line 520...
530
	push	esi ebx
520
	push	esi ebx
531
	mov	eax,ebx
521
	mov	eax,ebx
532
	sub	ebx,[cur_tab.Editor.TopLeft.X] ;! ebx,[left_col]
522
	sub	ebx,[cur_editor.TopLeft.X] ;! ebx,[left_col]
533
	cmp	ebx,[columns.scr]
523
	cmp	ebx,[columns.scr]
534
	jge	.skip_t
524
	jge	.skip_t
535
	add	ebx,esi
525
	add	ebx,esi
536
	jle	.skip_t
526
	jle	.skip_t
537
	mov	ebx,[esp+8+4*2] ;// 4*2=esi+ebx
527
	mov	ebx,[esp+8+4*2] ;// 4*2=esi+ebx
538
	sub	eax,[cur_tab.Editor.TopLeft.X] ;! eax,[left_col]
528
	sub	eax,[cur_editor.TopLeft.X] ;! eax,[left_col]
539
	jge	.qqq
529
	jge	.qqq
540
	sub	edx,eax
530
	sub	edx,eax
541
	add	esi,eax
531
	add	esi,eax
542
;       mov     eax,OLEFT*65536
532
;       mov     eax,OLEFT*65536
543
	xor	eax,eax
533
	xor	eax,eax
Line 551... Line 541...
551
	add	ebx,eax
541
	add	ebx,eax
552
 
542
 
Line 553... Line 543...
553
	mov	eax,[esp]   ; ebx
543
	mov	eax,[esp]   ; ebx
554
	add	eax,[esp+4] ; esi
544
	add	eax,[esp+4] ; esi
555
	sub	eax,[cur_tab.Editor.TopLeft.X] ;! eax,[left_col]
545
	sub	eax,[cur_editor.TopLeft.X] ;! eax,[left_col]
556
	sub	eax,[columns.scr]
546
	sub	eax,[columns.scr]
557
	jle	.qweqwe
547
	jle	.qweqwe
558
	sub	esi,eax
548
	sub	esi,eax
559
  .qweqwe:
549
  .qweqwe:
Line 575... Line 565...
575
  .ya1: mov	eax,esi
565
  .ya1: mov	eax,esi
576
	mov	esi,[sel.begin.x]
566
	mov	esi,[sel.begin.x]
577
	sub	esi,[esp]
567
	sub	esi,[esp]
578
	pushad
568
	pushad
579
	mov	ecx,[cur_tab.Editor.TopLeft.X] ;! ecx,[left_col]
569
	mov	ecx,[cur_editor.TopLeft.X] ;! ecx,[left_col]
580
	sub	ecx,[esp+4*8]
570
	sub	ecx,[esp+4*8]
581
	jle	@f
571
	jle	@f
582
	sub	esi,ecx
572
	sub	esi,ecx
583
	sub	[esp+4],ecx
573
	sub	[esp+4],ecx
584
    @@: sub	eax,esi
574
    @@: sub	eax,esi
585
	add	edx,esi
575
	add	edx,esi
Line 605... Line 595...
605
  .ya2: mov	eax,[sel.end.x]
595
  .ya2: mov	eax,[sel.end.x]
606
	sub	eax,[esp]
596
	sub	eax,[esp]
607
	push	ebx
597
	push	ebx
608
	mov	ebx,[esp+4]
598
	mov	ebx,[esp+4]
609
	sub	ebx,[cur_tab.Editor.TopLeft.X] ;! ebx,[left_col]
599
	sub	ebx,[cur_editor.TopLeft.X] ;! ebx,[left_col]
610
	jge	.ya2.1
600
	jge	.ya2.1
611
	add	eax,ebx
601
	add	eax,ebx
612
  .ya2.1:
602
  .ya2.1:
613
	pop	ebx
603
	pop	ebx
614
	pushad
604
	pushad
615
	mov	esi,eax
605
	mov	esi,eax
Line 637... Line 627...
637
	mov	esi,[sel.begin.x]
627
	mov	esi,[sel.begin.x]
638
	sub	esi,[esp]
628
	sub	esi,[esp]
639
	push	eax
629
	push	eax
640
	mov	eax,[esp+4]
630
	mov	eax,[esp+4]
641
	sub	eax,[cur_tab.Editor.TopLeft.X] ;! eax,[left_col]
631
	sub	eax,[cur_editor.TopLeft.X] ;! eax,[left_col]
642
	jge	.nt3.1
632
	jge	.nt3.1
643
	add	esi,eax
633
	add	esi,eax
644
  .nt3.1:
634
  .nt3.1:
645
	pop	eax
635
	pop	eax
646
	sub	eax,esi
636
	sub	eax,esi
647
	pushad
637
	pushad
Line 695... Line 685...
695
	cmp	[draw_blines],0
685
	cmp	[draw_blines],0
696
	jl	@f
686
	jl	@f
697
	mov	ecx,[esp-8]
687
	mov	ecx,[esp-8]
698
	shl	ecx,16
688
	shl	ecx,16
699
	mov	cx,word[cur_tab.Editor.Bounds.Bottom]
689
	mov	cx,word[cur_editor.Bounds.Bottom]
700
	sub	cx,[esp-8]
690
	sub	cx,[esp-8]
701
	add	cx,-SCRLW
691
	add	cx,-SCRLW
702
	mov	eax,[cur_tab.Editor.Bounds.Left]
692
	mov	eax,[cur_editor.Bounds.Left]
703
	add	eax,[cur_tab.Editor.Gutter.Width]
693
	add	eax,[cur_editor.Gutter.Width]
704
	inc	eax
694
	inc	eax
705
	mov	ebx,eax
695
	mov	ebx,eax
706
	shl	ebx,16
696
	shl	ebx,16
707
	mov	bx,word[cur_tab.Editor.Bounds.Right]
697
	mov	bx,word[cur_editor.Bounds.Right]
708
	sub	bx,ax
698
	sub	bx,ax
709
	add	ebx,-SCRLW
699
	add	ebx,-SCRLW
710
	mcall	13,,,[color_tbl+4*5]
700
	mcall	13,,,[color_tbl+4*5]
711
    @@:
701
    @@:
Line 715... Line 705...
715
	ret
705
	ret
716
endf
706
endf
717
 
707
 
Line 718... Line 708...
718
;-----------------------------------------------------------------------------
708
;-----------------------------------------------------------------------------
719
func draw_editor_caret ;//////////////////////////////////////////////////////
709
func draw_editor_caret ;///// DRAW EDITOR TEXT CARET /////////////////////////
720
;-----------------------------------------------------------------------------
710
;-----------------------------------------------------------------------------
721
	cmp	[bot_mode],0
711
	cmp	[bot_mode],0
722
	jne	@f
712
	jne	@f
723
	mov	ebx,[cur_tab.Editor.Caret.X]
713
	mov	ebx,[cur_editor.Caret.X]
724
	sub	ebx,[cur_tab.Editor.TopLeft.X]
714
	sub	ebx,[cur_editor.TopLeft.X]
725
	js	@f
715
	js	@f
726
	cmp	ebx,[columns.scr]
716
	cmp	ebx,[columns.scr]
727
	ja	@f
717
	ja	@f
728
	imul	ebx,6
718
	imul	ebx,6
729
	add	ebx,[left_ofs]
719
	add	ebx,[left_ofs]
730
	dec	ebx
720
	dec	ebx
731
	push	bx
721
	push	bx
732
	shl	ebx,16
722
	shl	ebx,16
733
	pop	bx
723
	pop	bx
734
	mov	eax,[cur_tab.Editor.Caret.Y]
724
	mov	eax,[cur_editor.Caret.Y]
735
	sub	eax,[cur_tab.Editor.TopLeft.Y]
725
	sub	eax,[cur_editor.TopLeft.Y]
736
	js	@f
726
	js	@f
737
	cmp	eax,[lines.scr]
727
	cmp	eax,[lines.scr]
738
	jge	@f
728
	jge	@f
739
	imul	eax,LINEH
729
	imul	eax,LINEH
740
	add	eax,[top_ofs]
730
	add	eax,[top_ofs]