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 155... Line 155...
155
	push	eax
155
	push	eax
156
	mov	eax,ebx
156
	mov	eax,ebx
157
	cdq;xor     edx,edx
157
	cdq;xor     edx,edx
158
	mov	ecx,LINEH
158
	mov	ecx,LINEH
159
	idiv	ecx
159
	idiv	ecx
160
    @@: add	eax,[cur_tab.Editor.TopLeft.Y] ;! eax,[top_line]
160
    @@: add	eax,[cur_editor.TopLeft.Y] ;! eax,[top_line]
161
	mov	ebx,eax
161
	mov	ebx,eax
162
	pop	eax
162
	pop	eax
163
	cdq;xor     edx,edx
163
	cdq;xor     edx,edx
164
	mov	ecx,6
164
	mov	ecx,6
165
	idiv	ecx
165
	idiv	ecx
166
    @@: add	eax,[cur_tab.Editor.TopLeft.X] ;! eax,[left_col]
166
    @@: add	eax,[cur_editor.TopLeft.X] ;! eax,[left_col]
Line 167... Line 167...
167
 
167
 
168
	cmp	eax,[cur_tab.Editor.Columns] ;! eax,[columns]
168
	cmp	eax,[cur_editor.Columns.Count] ;! eax,[columns]
169
	jl	@f
169
	jl	@f
170
	mov	eax,[cur_tab.Editor.Columns] ;! eax,[columns]
170
	mov	eax,[cur_editor.Columns.Count] ;! eax,[columns]
171
    @@: cmp	ebx,[cur_tab.Editor.Lines] ;! ebx,[lines]
171
    @@: cmp	ebx,[cur_editor.Lines.Count] ;! ebx,[lines]
172
	jl	@f
172
	jl	@f
173
	mov	ebx,[cur_tab.Editor.Lines] ;! ebx,[lines]
173
	mov	ebx,[cur_editor.Lines.Count] ;! ebx,[lines]
174
	dec	ebx
174
	dec	ebx
175
    @@:
175
    @@:
176
	cmp	[cur_tab.Editor.Caret.X],eax ;! [pos.x],eax
176
	cmp	[cur_editor.Caret.X],eax ;! [pos.x],eax
177
	jne	.change_cur_pos
177
	jne	.change_cur_pos
178
	cmp	[cur_tab.Editor.Caret.Y],ebx ;! [pos.y],ebx
178
	cmp	[cur_editor.Caret.Y],ebx ;! [pos.y],ebx
Line 179... Line 179...
179
	je	still.skip_write
179
	je	still.skip_write
180
 
180
 
181
  .change_cur_pos:
181
  .change_cur_pos:
182
	mov	[cur_tab.Editor.Caret.X],eax ;! [pos.x],eax
182
	mov	[cur_editor.Caret.X],eax ;! [pos.x],eax
183
	mov	eax,[cur_tab.Editor.Caret.Y] ;! eax,[pos.y]
183
	mov	eax,[cur_editor.Caret.Y] ;! eax,[pos.y]
184
	mov	[cur_tab.Editor.Caret.Y],ebx ;! [pos.y],ebx
184
	mov	[cur_editor.Caret.Y],ebx ;! [pos.y],ebx
185
	call	check_cur_vis_inv
185
	call	check_cur_vis_inv
186
	jc	.check_ldown
186
	jc	.check_ldown
187
;        cmp     eax,ebx
187
;        cmp     eax,ebx
Line 211... Line 211...
211
	sub	ebx,[top_ofs]
211
	sub	ebx,[top_ofs]
212
	sub	ebx,SCRLW;!!!!!!!!!!!!!!+1
212
	sub	ebx,SCRLW;!!!!!!!!!!!!!!+1
213
;       sub     ebx,[__rc+0x4]
213
;       sub     ebx,[__rc+0x4]
214
	cmp	[vscrl_capt],0
214
	cmp	[vscrl_capt],0
215
	jge	.vcaptured
215
	jge	.vcaptured
216
	mov	eax,[cur_tab.Editor.VScroll.Top] ;! eax,[vscrl_top]
216
	mov	eax,[cur_editor.VScroll.Top] ;! eax,[vscrl_top]
217
	cmp	ebx,eax
217
	cmp	ebx,eax
218
	jb	.center_vcapture
218
	jb	.center_vcapture
219
	add	eax,[cur_tab.Editor.VScroll.Size] ;! eax,[vscrl_size]
219
	add	eax,[cur_editor.VScroll.Size] ;! eax,[vscrl_size]
220
	cmp	ebx,eax
220
	cmp	ebx,eax
221
	jae	.center_vcapture
221
	jae	.center_vcapture
222
	mov	eax,ebx
222
	mov	eax,ebx
223
	sub	eax,[cur_tab.Editor.VScroll.Top] ;! eax,[vscrl_top]
223
	sub	eax,[cur_editor.VScroll.Top] ;! eax,[vscrl_top]
224
	dec	eax
224
	dec	eax
225
	mov	[vscrl_capt],eax
225
	mov	[vscrl_capt],eax
226
	dec	ebx
226
	dec	ebx
227
	jmp	.vcaptured
227
	jmp	.vcaptured
228
  .center_vcapture:
228
  .center_vcapture:
229
	mov	eax,[cur_tab.Editor.VScroll.Size] ;! eax,[vscrl_size]
229
	mov	eax,[cur_editor.VScroll.Size] ;! eax,[vscrl_size]
230
	shr	eax,1
230
	shr	eax,1
231
	mov	[vscrl_capt],eax
231
	mov	[vscrl_capt],eax
232
  .vcaptured:
232
  .vcaptured:
233
	sub	ebx,[vscrl_capt]
233
	sub	ebx,[vscrl_capt]
234
	jns	@f
234
	jns	@f
235
	xor	ebx,ebx
235
	xor	ebx,ebx
236
    @@: mov	[mouse_captured],1
236
    @@: mov	[mouse_captured],1
237
	mov	eax,[bot_ofs]
237
	mov	eax,[bot_ofs]
238
	sub	eax,[top_ofs]
238
	sub	eax,[top_ofs]
239
	sub	eax,[cur_tab.Editor.VScroll.Size] ;! eax,[vscrl_size]
239
	sub	eax,[cur_editor.VScroll.Size] ;! eax,[vscrl_size]
240
	sub	eax,SCRLW*3-2
240
	sub	eax,SCRLW*3-2
241
	cmp	eax,ebx
241
	cmp	eax,ebx
242
	jge	@f
242
	jge	@f
243
	mov	ebx,eax
243
	mov	ebx,eax
244
    @@:
244
    @@:
245
	mov	[cur_tab.Editor.VScroll.Top],ebx ;! [vscrl_top],ebx
245
	mov	[cur_editor.VScroll.Top],ebx ;! [vscrl_top],ebx
246
	mov	eax,[cur_tab.Editor.Lines] ;! eax,[lines]
246
	mov	eax,[cur_editor.Lines.Count] ;! eax,[lines]
247
	sub	eax,[lines.scr]
247
	sub	eax,[lines.scr]
248
	imul	ebx
248
	imul	ebx
249
	mov	ebx,[bot_ofs]
249
	mov	ebx,[bot_ofs]
250
	sub	ebx,[top_ofs]
250
	sub	ebx,[top_ofs]
251
	sub	ebx,SCRLW*3-2	      ;**
251
	sub	ebx,SCRLW*3-2	      ;**
252
	sub	ebx,[cur_tab.Editor.VScroll.Size] ;! ebx,[vscrl_size]
252
	sub	ebx,[cur_editor.VScroll.Size] ;! ebx,[vscrl_size]
253
	idiv	ebx
253
	idiv	ebx
254
	cmp	eax,[cur_tab.Editor.TopLeft.Y] ;! eax,[top_line]
254
	cmp	eax,[cur_editor.TopLeft.Y] ;! eax,[top_line]
255
	je	still.skip_write
255
	je	still.skip_write
256
	mov	[cur_tab.Editor.TopLeft.Y],eax ;! [top_line],eax
256
	mov	[cur_editor.TopLeft.Y],eax ;! [top_line],eax
257
	call	check_bottom_right
257
	call	check_bottom_right
258
	call	draw_file
258
	call	draw_file
259
	jmp	still.skip_write
259
	jmp	still.skip_write
Line 260... Line 260...
260
 
260
 
Line 272... Line 272...
272
	mov	ebx,eax
272
	mov	ebx,eax
273
	sub	ebx,(5+SCRLW+1)
273
	sub	ebx,(5+SCRLW+1)
274
;       sub     ebx,[__rc+0x0]
274
;       sub     ebx,[__rc+0x0]
275
	cmp	[hscrl_capt],0
275
	cmp	[hscrl_capt],0
276
	jge	.hcaptured
276
	jge	.hcaptured
277
	mov	eax,[cur_tab.Editor.HScroll.Top] ;! eax,[hscrl_top]
277
	mov	eax,[cur_editor.HScroll.Top] ;! eax,[hscrl_top]
278
	cmp	ebx,eax
278
	cmp	ebx,eax
279
	jl	.center_hcapture
279
	jl	.center_hcapture
280
	add	eax,[cur_tab.Editor.HScroll.Size] ;! eax,[hscrl_size]
280
	add	eax,[cur_editor.HScroll.Size] ;! eax,[hscrl_size]
281
	cmp	ebx,eax
281
	cmp	ebx,eax
282
	jge	.center_hcapture
282
	jge	.center_hcapture
283
	mov	eax,ebx
283
	mov	eax,ebx
284
	sub	eax,[cur_tab.Editor.HScroll.Top] ;! eax,[hscrl_top]
284
	sub	eax,[cur_editor.HScroll.Top] ;! eax,[hscrl_top]
285
	dec	eax
285
	dec	eax
286
	mov	[hscrl_capt],eax
286
	mov	[hscrl_capt],eax
287
	dec	ebx
287
	dec	ebx
288
	jmp	.hcaptured
288
	jmp	.hcaptured
289
  .center_hcapture:
289
  .center_hcapture:
290
	mov	eax,[cur_tab.Editor.HScroll.Size] ;! eax,[hscrl_size]
290
	mov	eax,[cur_editor.HScroll.Size] ;! eax,[hscrl_size]
291
	shr	eax,1
291
	shr	eax,1
292
	mov	[hscrl_capt],eax
292
	mov	[hscrl_capt],eax
293
  .hcaptured:
293
  .hcaptured:
294
	sub	ebx,[hscrl_capt]
294
	sub	ebx,[hscrl_capt]
295
	jns	@f
295
	jns	@f
296
	xor	ebx,ebx
296
	xor	ebx,ebx
297
    @@: mov	[mouse_captured],1
297
    @@: mov	[mouse_captured],1
298
	mov	eax,[p_info.box.width]
298
	mov	eax,[p_info.box.width]
299
	sub	eax,[cur_tab.Editor.HScroll.Size] ;! eax,[hscrl_size]
299
	sub	eax,[cur_editor.HScroll.Size] ;! eax,[hscrl_size]
300
	sub	eax,SCRLW*3+10+1
300
	sub	eax,SCRLW*3+10+1
301
	cmp	eax,ebx
301
	cmp	eax,ebx
302
	jge	@f
302
	jge	@f
303
	mov	ebx,eax
303
	mov	ebx,eax
304
    @@:
304
    @@:
305
	mov	[cur_tab.Editor.HScroll.Top],ebx ;! [hscrl_top],ebx
305
	mov	[cur_editor.HScroll.Top],ebx ;! [hscrl_top],ebx
306
	mov	eax,[cur_tab.Editor.Columns] ;! eax,[columns]
306
	mov	eax,[cur_editor.Columns.Count] ;! eax,[columns]
307
	sub	eax,[columns.scr]
307
	sub	eax,[columns.scr]
308
	imul	ebx
308
	imul	ebx
309
	mov	ebx,[p_info.box.width]
309
	mov	ebx,[p_info.box.width]
310
	sub	ebx,SCRLW*3+10+1	;**
310
	sub	ebx,SCRLW*3+10+1	;**
311
	sub	ebx,[cur_tab.Editor.HScroll.Size] ;! ebx,[hscrl_size]
311
	sub	ebx,[cur_editor.HScroll.Size] ;! ebx,[hscrl_size]
312
	idiv	ebx
312
	idiv	ebx
313
	cmp	eax,[cur_tab.Editor.TopLeft.X] ;! eax,[left_col]
313
	cmp	eax,[cur_editor.TopLeft.X] ;! eax,[left_col]
314
	je	still.skip_write
314
	je	still.skip_write
315
	mov	[cur_tab.Editor.TopLeft.X],eax ;! [left_col],eax
315
	mov	[cur_editor.TopLeft.X],eax ;! [left_col],eax
316
	call	check_bottom_right
316
	call	check_bottom_right
317
	call	draw_file
317
	call	draw_file
318
	jmp	still.skip_write
318
	jmp	still.skip_write
Line 319... Line 319...
319
 
319
 
Line 345... Line 345...
345
	mov	[hscrl_capt],eax
345
	mov	[hscrl_capt],eax
346
	mov	[body_capt],eax
346
	mov	[body_capt],eax
347
	mov	[mouse_captured],0
347
	mov	[mouse_captured],0
348
	mov	[just_from_popup],0
348
	mov	[just_from_popup],0
349
	jmp	still.skip_write
349
	jmp	still.skip_write
350
 
-
 
351
 
-
 
352
func setup_main_menu_popup
-
 
353
	mov	ebx,[p_info.box.left]
-
 
354
	add	ebx,[p_info.client_box.left]
-
 
355
    @@: dec	ecx
-
 
356
	jz	@f
-
 
357
	add	edx,8+1
-
 
358
	movzx	esi,byte[edx-1]
-
 
359
	add	edx,esi
-
 
360
	jmp	@b
-
 
361
    @@: movzx	ecx,word[edx+2]
-
 
362
	add	ebx,ecx
-
 
363
 
-
 
364
	mov	[eax+POPUP.x],bx
-
 
365
	mov	ebx,[p_info.box.top]
-
 
366
	add	ebx,[p_info.client_box.top]
-
 
367
	add	ebx,ATOPH-1
-
 
368
	mov	[eax+POPUP.y],bx
-
 
369
	mov	[POPUP_STACK],eax
-
 
370
	ret
-
 
371
endf
-
 
372
 
-
 
373
onshow:
-
 
374
 
-
 
375
  .file:
-
 
376
	or	byte[mm.File+3],0x01
-
 
377
	cmp	[f_info.length],0
-
 
378
	jne	@f
-
 
379
	and	byte[mm.File+3],0xFE
-
 
380
    @@: ret
-
 
381
 
-
 
382
  .edit:
-
 
383
	or	byte[mm.Edit+2],0x01
-
 
384
	cmp	[copy_size],0
-
 
385
	jne	@f
-
 
386
	and	byte[mm.Edit+2],0xFE
-
 
387
    @@: or	dword[mm.Edit+0],0x01000101
-
 
388
	cmp	[sel.selected],0
-
 
389
	jne	@f
-
 
390
	and	dword[mm.Edit+0],0xFEFFFEFE
-
 
391
    @@: ret
-
 
392
 
-
 
393
  .search:
-
 
394
	mov	byte[mm.Search+0],0
-
 
395
	;mov     byte[mm.Search+4],0
-
 
396
	ret
-
 
397
  .run:
-
 
398
	ret
-
 
399
  .recode:
-
 
400
	ret
-
 
401
  .options:
-
 
402
	mov	word[mm.Options+0],0
-
 
403
	mov	byte[mm.Options+5],0
-
 
404
	or	byte[mm.Options+2],0x02
-
 
405
	test	[options],OPTS_SECURESEL
-
 
406
	jnz	@f
-
 
407
	and	byte[mm.Options+2],0xFD
-
 
408
    @@: or	byte[mm.Options+3],0x02
-
 
409
	test	[options],OPTS_AUTOBRACES
-
 
410
	jnz	@f
-
 
411
	and	byte[mm.Options+3],0xFD
-
 
412
    @@: or	byte[mm.Options+4],0x02
-
 
413
	test	[options],OPTS_AUTOINDENT
-
 
414
	jnz	@f
-
 
415
	and	byte[mm.Options+4],0xFD
-
 
416
    @@: or	byte[mm.Options+6],0x02
-
 
417
	test	[options],OPTS_OPTIMSAVE
-
 
418
	jnz	@f
-
 
419
	and	byte[mm.Options+6],0xFD
-
 
420
    @@: or	byte[mm.Options+8],0x02
-
 
421
	test	[options],OPTS_LINENUMS
-
 
422
	jnz	@f
-
 
423
	and	byte[mm.Options+8],0xFD
-
 
424
    @@: ret
-
 
425
350