Subversion Repositories Kolibri OS

Rev

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

Rev 1456 Rev 1457
Line 14... Line 14...
14
  dd file_name ; command line
14
  dd file_name ; command line
15
  dd sys_path
15
  dd sys_path
Line 16... Line 16...
16
 
16
 
17
MAX_COLOR_WORD_LEN equ 40
17
MAX_COLOR_WORD_LEN equ 40
18
maxChars equ 100002 ;(...+2)
18
maxChars equ 100002 ;(...+2)
19
BUF_SIZE equ 1000 ;bufer for copy|paste
19
BUF_SIZE equ 1000 ;buffer for copy|paste
Line 20... Line 20...
20
maxColWords equ 10000
20
maxSyntaxFileSize equ 410000
21
 
21
 
22
include '../../proc32.inc'
22
include '../../proc32.inc'
23
include '../../macros.inc'
23
include '../../macros.inc'
Line 24... Line 24...
24
include '../../develop/libraries/box_lib/load_lib.mac'
24
include '../../develop/libraries/box_lib/load_lib.mac'
25
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
25
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
26
 
26
 
27
include 'lang.inc'
-
 
28
include 't_data.inc'
27
include 'lang.inc'
29
include 'strlen.inc'
28
include 't_data.inc'
Line 30... Line 29...
30
include 't_work.inc' ;text work functions
29
include 'strlen.inc'
Line 31... Line 30...
31
include 't_draw.inc' ;draw main window functions
30
include 't_draw.inc' ;draw main window functions
32
include 't_button.inc'
31
include 't_button.inc' ;text work functions
33
 
32
 
Line -... Line 33...
-
 
33
@use_library
34
@use_library
34
 
35
 
35
align 4
36
align 4
36
start:
37
start:
-
 
38
  mcall 48,3,sc,sizeof.system_colors
37
  mcall 48,3,sc,sizeof.system_colors
39
 
38
 
40
  m2m [wScr.bckg_col],[sc.work]
39
  mov eax,[sc.work]
41
  m2m [wScr.frnt_col],[sc.work_button]
-
 
-
 
40
  mov [wScr.bckg_col],eax
-
 
41
  mov [hScr.bckg_col],eax
Line 42... Line 42...
42
  m2m [wScr.line_col],[sc.work_button_text]
42
  mov eax,[sc.work_button]
43
 
43
  mov [wScr.frnt_col],eax
44
  m2m [hScr.bckg_col],[sc.work]
44
  mov [hScr.frnt_col],eax
Line 73... Line 73...
73
	jz	@f
73
	jz	@f
74
	mcall -1 ;exit not correct
74
	mcall -1 ;exit not correct
75
@@:
75
@@:
Line 76... Line 76...
76
 
76
 
77
;---------------------------------------------------------------------
77
;---------------------------------------------------------------------
78
  stdcall ted_init, tedit0
78
  stdcall [ted_init], tedit0
79
  stdcall dword[tl_data_init], tree1
79
  stdcall dword[tl_data_init], tree1
Line 80... Line 80...
80
;---------------------------------------------------------------------
80
;---------------------------------------------------------------------
81
 
81
 
Line 172... Line 172...
172
  add eax,304
172
  add eax,304
173
  loop @b
173
  loop @b
174
.end_dir_init:
174
.end_dir_init:
Line 175... Line 175...
175
 
175
 
-
 
176
;--- load color option file ---
-
 
177
	mov ebx,dword[fn_col_option]
-
 
178
	copy_path ebx,fn_syntax_dir,file_name_rez,0x0
176
;--- load color option file ---
179
	copy_path file_name_rez,sys_path,file_name,0x0
Line 177... Line 180...
177
  stdcall InitColText, tedit0
180
	stdcall [ted_init_syntax_file], tedit0,run_file_70,file_name
178
 
181
 
179
;--- get cmd line ---
182
;--- get cmd line ---
180
  cmp byte[buf_cmd_lin+3],0 ;buf_cmd_lin
183
  cmp byte[buf_cmd_lin+3],0 ;buf_cmd_lin
Line 200... Line 203...
200
  mov edi,tedit0
203
  mov edi,tedit0
Line 201... Line 204...
201
 
204
 
202
  mcall 9,procinfo,-1
205
  mcall 9,procinfo,-1
Line 203... Line 206...
203
  stdcall EvSize,edi
206
  stdcall EvSize,edi
204
 
207
 
205
  mov eax,13 ;âåðõíèé ïðÿìîóãîëüíèê, äëÿ î÷èñòêè âåðõíåé ïàíåëè
208
  mov eax,13 ;¢¥àå­¨© ¯àאַ㣮«ì­¨ª, ¤«ï ®ç¨á⪨ ¢¥àå­¥© ¯ ­¥«¨
206
  xor ebx,ebx
209
  xor ebx,ebx
207
  mov ecx,ted_wnd_t
210
  mov ecx,ted_wnd_t
208
  mov bx,word [procinfo.client_box.width]
211
  mov bx,word [procinfo.client_box.width]
Line 232... Line 235...
232
    int 0x40
235
    int 0x40
233
  @@:
236
  @@:
Line 234... Line 237...
234
 
237
 
235
  cmp [err_ini0],1
238
  cmp [err_ini0],1
236
  je @f
239
  je @f
237
    stdcall draw_main_win, tedit0
240
    stdcall [ted_draw], tedit0
Line 238... Line 241...
238
  @@:
241
  @@:
Line 239... Line 242...
239
 
242
 
Line 261... Line 264...
261
  stdcall [edit_box_mouse], dword edit1
264
  stdcall [edit_box_mouse], dword edit1
Line 262... Line 265...
262
 
265
 
263
  test word [edit1.flags],10b;ed_focus ; ¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
266
  test word [edit1.flags],10b;ed_focus ; ¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
Line 264... Line -...
264
  jne still
-
 
265
 
-
 
266
;-----------------------------------------------
-
 
267
  cmp [hScr.delta2],0
-
 
268
  jne .horizontal
-
 
269
.vertical:
-
 
270
  mov eax,[wScr.max_area]
-
 
271
  cmp eax,[wScr.cur_area]
-
 
272
  jbe .horizontal
-
 
273
; mouse event for Vertical ScrollBar
-
 
274
  stdcall [scrollbar_ver_mouse], dword wScr
-
 
275
  mov eax,wScr.redraw
-
 
276
  xor ebx,ebx
-
 
277
  cmp [eax],ebx
-
 
278
  je @f
-
 
279
  mov [eax],ebx
267
  jne still
280
 
-
 
281
  stdcall draw_main_win, tedit0
-
 
282
  jmp still
-
 
283
@@:
-
 
284
  cmp [wScr.delta2],0
-
 
285
  jne still
-
 
286
.horizontal:
-
 
287
    mov   eax,[hScr.max_area]
-
 
288
    cmp   eax,[hScr.cur_area]
-
 
289
    jbe   .other
-
 
290
; mouse event for Horizontal ScrollBar
-
 
291
	push dword hScr
-
 
292
	call [scrollbar_hor_mouse]
-
 
293
	mov eax,hScr.redraw
-
 
294
	xor ebx,ebx
-
 
295
	cmp [eax],ebx
-
 
296
	je .other
-
 
297
	mov [eax],ebx
-
 
298
  stdcall draw_main_win, tedit0
-
 
299
  jmp still
-
 
300
.other:
-
 
301
  cmp [wScr.delta2],0
-
 
302
  jne still
-
 
303
  cmp [hScr.delta2],0
-
 
304
  jne still
-
 
Line 305... Line 268...
305
 
268
 
306
  stdcall mouse_wnd_main, tedit0
269
  stdcall [ted_mouse], tedit0
307
 
270
 
308
  cmp byte[tedit0.panel_id],TE_PANEL_FIND ;if not panel
271
  cmp byte[tedit0.panel_id],TED_PANEL_FIND ;if not panel
309
  jne @f
272
  jne @f
310
    stdcall [edit_box_mouse], dword edit2
273
    stdcall [edit_box_mouse], dword edit2
311
  @@:
274
  @@:
312
  cmp byte[tedit0.panel_id],TE_PANEL_SYNTAX ;if not panel
275
  cmp byte[tedit0.panel_id],TED_PANEL_SYNTAX ;if not panel
313
  jne .menu_bar_1 ;@f
276
  jne .menu_bar_1 ;@f
314
  stdcall [tl_mouse], tree1
277
  stdcall [tl_mouse], tree1
Line 322... Line 285...
322
  jne	.mnu_1
285
  jne	.mnu_1
323
  cmp [menu_data_1.cursor_out],dword 4
286
  cmp [menu_data_1.cursor_out],dword 4
324
  je	button.exit	
287
  je	button.exit	
325
  cmp [menu_data_1.cursor_out],dword 3
288
  cmp [menu_data_1.cursor_out],dword 3
326
  jne	@f
289
  jne	@f
327
    stdcall but_SaveFile, tedit0
290
    stdcall [ted_but_save_file], tedit0,run_file_70,[edit1.text]
328
  @@:
291
  @@:
329
  cmp [menu_data_1.cursor_out],dword 2
292
  cmp [menu_data_1.cursor_out],dword 2
330
  jne	@f
293
  jne	@f
331
    call but_OpenFile
294
    call ted_but_open_file
332
  @@:
295
  @@:
333
  cmp [menu_data_1.cursor_out],dword 1
296
  cmp [menu_data_1.cursor_out],dword 1
334
  jne	@f
297
  jne	@f
335
    call but_NewFile
298
    call ted_but_new_file
336
  @@:
299
  @@:
337
  ;cmp [menu_data_1.cursor_out],dword 0
300
  ;cmp [menu_data_1.cursor_out],dword 0
338
  ;jne @f
301
  ;jne @f
339
.mnu_1:
302
.mnu_1:
340
  jmp still
303
  jmp still
Line 355... Line 318...
355
endp
318
endp
Line 356... Line 319...
356
 
319
 
357
align 4
320
align 4
358
key:
321
key:
359
  mcall 66,3 ;66.3 ¯®«ãç¨âì á®áâ®ï­¨¥ ã¯à ¢«ïîé¨å ª« ¢¨è
322
  mcall 66,3 ;66.3 ¯®«ãç¨âì á®áâ®ï­¨¥ ã¯à ¢«ïîé¨å ª« ¢¨è
360
  xor ebx,ebx
323
  xor esi,esi
361
  mov ecx,1
324
  mov ecx,1
362
  test al,0x03 ;[Shift]
325
  test al,0x03 ;[Shift]
363
  jz @f
326
  jz @f
364
    mov cl,2
327
    mov cl,2
365
    or ebx,KM_SHIFT
328
    or esi,KM_SHIFT
366
  @@:
329
  @@:
367
  test al,0x0c ;[Ctrl]
330
  test al,0x0c ;[Ctrl]
368
  jz @f
331
  jz @f
369
    or ebx,KM_CTRL
332
    or esi,KM_CTRL
370
  @@:
333
  @@:
371
  test al,0x30 ;[Alt]
334
  test al,0x30 ;[Alt]
372
  jz @f
335
  jz @f
373
    mov cl,3
336
    mov cl,3
374
    or ebx,KM_ALT
337
    or esi,KM_ALT
375
  @@:
338
  @@:
376
  test al,0x80 ;[NumLock]
339
  test al,0x80 ;[NumLock]
377
  jz @f
340
  jz @f
378
    or ebx,KM_NUMLOCK
341
    or esi,KM_NUMLOCK
-
 
342
  @@:
379
  @@:
343
 
380
  mcall 26,2,,conv_tabl ;26.2 ¯®«ãç¨âì à áª« ¤ªã ª« ¢¨ âãàë
344
  mcall 26,2,,conv_tabl ;26.2 ¯®«ãç¨âì à áª« ¤ªã ª« ¢¨ âãàë
381
  mcall 2 ;¯®«ãç ¥¬ ª®¤ ­ ¦ â®© ª« ¢¨è¨
345
  mcall 2 ;¯®«ãç ¥¬ ª®¤ ­ ¦ â®© ª« ¢¨è¨
Line 382... Line 346...
382
  ;stdcall [tl_key], tree1 ;???
346
  ;stdcall [tl_key], tree1
383
 
347
 
384
  test word [edit1.flags],10b;ed_focus ; ¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
348
  test word [edit1.flags],10b;ed_focus ; ¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
385
  je @f
349
  je @f
Line 419... Line 383...
419
    stdcall KeyConvertToASCII, dword conv_tabl
383
    stdcall KeyConvertToASCII, dword conv_tabl
420
    stdcall [edit_box_key], dword edit2
384
    stdcall [edit_box_key], dword edit2
421
    jmp still
385
    jmp still
422
  @@:
386
  @@:
Line 423... Line 387...
423
 
387
 
424
  stdcall ted_key, tedit0, conv_tabl
388
  stdcall [ted_key], tedit0, conv_tabl,esi
Line -... Line 389...
-
 
389
  jmp still
425
  jmp still
390
 
426
 
391
align 4
427
button:
392
button:
428
;  cmp [menu_active],1 ;¥á«¨ ­ ¦ «¨ ¬¥­î, â® á­ ç «  ॠªæ¨ï ­  ¬¥­î
393
;  cmp [menu_active],1 ;¥á«¨ ­ ¦ «¨ ¬¥­î, â® á­ ç «  ॠªæ¨ï ­  ¬¥­î
429
;  jne @f ;mouse.menu_bar_1
394
;  jne @f ;mouse.menu_bar_1
430
;    mov [menu_active],0
395
;    mov [menu_active],0
Line 431... Line 396...
431
;    jmp still
396
;    jmp still
432
;  @@:
397
;  @@:
433
 
398
 
434
  mcall 17 ;¯®«ãç¨âì ª®¤ ­ ¦ â®© ª­®¯ª¨
399
  mcall 17 ;¯®«ãç¨âì ª®¤ ­ ¦ â®© ª­®¯ª¨
435
  cmp ah,3
400
  cmp ah,3
436
  jne @f
401
  jne @f
437
    call but_NewFile
402
    call ted_but_new_file
438
  @@:
403
  @@:
439
  cmp ah,4
404
  cmp ah,4
440
  jne @f
405
  jne @f
441
    call but_OpenFile
406
    call ted_but_open_file
442
  @@:
407
  @@:
443
  cmp ah,5
408
  cmp ah,5
444
  jne @f
409
  jne @f
445
    stdcall but_SaveFile, tedit0
410
    stdcall [ted_but_save_file], tedit0,run_file_70,[edit1.text]
446
  @@:
411
  @@:
447
  cmp ah,6
412
  cmp ah,6
448
  jne @f
413
  jne @f
449
    stdcall ted_but_select_word, tedit0
414
    stdcall [ted_but_select_word], tedit0
450
  @@:
415
  @@:
451
  cmp ah,7
416
  cmp ah,7
452
  jne @f
417
  jne @f
453
    stdcall ted_but_cut, tedit0
418
    stdcall [ted_but_cut], tedit0
454
  @@:
419
  @@:
455
  cmp ah,8
420
  cmp ah,8
456
  jne @f
421
  jne @f
457
    stdcall ted_but_copy, tedit0
422
    stdcall [ted_but_copy], tedit0
458
  @@:
423
  @@:
459
  cmp ah,9
424
  cmp ah,9
460
  jne @f
425
  jne @f
461
    stdcall ted_but_paste, tedit0
426
    stdcall [ted_but_paste], tedit0
462
  @@:
427
  @@:
463
  cmp ah,10
428
  cmp ah,10
464
  jne @f
429
  jne @f
465
    stdcall but_find, tedit0
430
    call ted_but_find
466
  @@:
431
  @@:
467
  cmp ah,11
432
  cmp ah,11
Line 472... Line 437...
472
  jne @f
437
  jne @f
473
    call but_find_key_w
438
    call but_find_key_w
474
  @@:
439
  @@:
475
  cmp ah,13
440
  cmp ah,13
476
  jne @f
441
  jne @f
477
    stdcall but_sumb_upper, tedit0
442
    stdcall [ted_but_sumb_upper], tedit0
478
  @@:
443
  @@:
479
  cmp ah,14
444
  cmp ah,14
480
  jne @f
445
  jne @f
481
    stdcall but_sumb_lover, tedit0
446
    stdcall [ted_but_sumb_lover], tedit0
482
  @@:
447
  @@:
483
  cmp ah,15
448
  cmp ah,15
484
  jne @f
449
  jne @f
485
    stdcall but_reverse, tedit0
450
    stdcall [ted_but_reverse], tedit0
486
  @@:
451
  @@:
487
  cmp ah,16
452
  cmp ah,16
488
  jne @f
453
  jne @f
489
    stdcall ted_but_undo, tedit0
454
    stdcall [ted_but_undo], tedit0
490
  @@:
455
  @@:
491
  cmp ah,17
456
  cmp ah,17
492
  jne @f
457
  jne @f
493
    stdcall ted_but_redo, tedit0
458
    stdcall [ted_but_redo], tedit0
494
  @@:
459
  @@:
495
  cmp ah,18
460
  cmp ah,18
496
  jne @f
461
  jne @f
497
    stdcall but_sumb_invis, tedit0
462
    stdcall but_sumb_invis, tedit0
498
  @@:
463
  @@:
Line 509... Line 474...
509
  jne @f
474
  jne @f
510
    stdcall ted_but_open_syntax, tedit0
475
    stdcall ted_but_open_syntax, tedit0
511
  @@:
476
  @@:
512
  cmp ah,201
477
  cmp ah,201
513
  jne @f
478
  jne @f
514
    stdcall but_FindText, tedit0
479
    stdcall [ted_but_find_next], tedit0
515
  @@:
480
  @@:
Line 516... Line 481...
516
 
481
 
517
  cmp ah,1
482
  cmp ah,1
518
  jne still
483
  jne still
519
.exit:
484
.exit:
520
  stdcall ted_can_save, tedit0
485
  stdcall [ted_can_save], tedit0
521
  cmp al,1
486
  cmp al,1
522
  jne @f
487
  jne @f
523
    stdcall [mb_create],msgbox_8,thread ;message: save changes in file?
488
    stdcall [mb_create],msgbox_8,thread ;message: save changes in file?
524
    jmp still
489
    jmp still
525
  @@:
490
  @@:
526
  mov ecx,[bmp_icon]
491
  mov ecx,[bmp_icon]
Line 527... Line 492...
527
  call mem_Free
492
  call mem_Free
528
 
493
 
529
  stdcall ted_delete, tedit0
494
  stdcall [ted_delete], tedit0
Line 530... Line 495...
530
  stdcall dword[tl_data_clear], tree1
495
  stdcall dword[tl_data_clear], tree1
531
  mcall -1 ;¢ë室 ¨§ ¯à®£à ¬¬ë
496
  mcall -1 ;¢ë室 ¨§ ¯à®£à ¬¬ë
Line 532... Line 497...
532
 
497
 
533
 
498
 
Line 534... Line 499...
534
 
499
 
535
txtErrIni0 db '¥ ®âªàë«áï ä ©« á ¨ª®­ª ¬¨',0
500
txtErrIni0 db '¥ ®âªàë«áï ä ©« á ¨ª®­ª ¬¨',0
Line 536... Line 501...
536
err_ini0 db 0
501
err_ini0 db 0