Subversion Repositories Kolibri OS

Rev

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

Rev 449 Rev 461
Line -... Line 1...
-
 
1
;  04.04.2007 ˆá¯à ¢«¥­® ã¯à ¢«¥­¨¥ ¬ë誮©, ¯à¨ 㤠«¥­¨¨ ¯®á«¥¤­¥£® ᨬ¢®«  ¢ ¡ãä¥à¥ ¯¨è¥âìáï 0 (ᯠᨡ® Mario79)
1
;  04.04.2007 Œ®¤¥à­¨§¨à®¢ « á¨á⥬㠢뤥«¥­¨ï, áãé¥á⢥­­® ¯¥à¥¤¥« ­® ã¯à ¢«¥­¨¥ ¨ ®¡à ¡®âª , ¤®¡ ¢«¥­­® ¡«®ª¨à®¢ ­¨ï ®¡à ¡®âª¨ ¤àã£¨å ¡®ªá®¢, ¢® ¢à¥¬ï ¢ë¤¥«¥­¨ï ¬ë誮© ⥪áâ , ¤«ï í⮣® ¢ ⥪á⠯ணࠬ¬ë ­¥®¡å®¤¨¬® ¤®¡ ¢¨âì ¨¤¥­â¨ä¨ª â®à ¡®ªá  â.¥. dd 0x0 ¨ ¢ ­¥£® ¡ã¤¥â ¯®¬¥é âìáï 㪠 â¥«ì ­  editbox
2
;  04.04.2007 Œ®¤¥à­¨§¨à®¢ « á¨á⥬㠢뤥«¥­¨ï, áãé¥á⢥­­® ¯¥à¥¤¥« ­® ã¯à ¢«¥­¨¥ ¨ ®¡à ¡®âª , ¤®¡ ¢«¥­­® ¡«®ª¨à®¢ ­¨ï ®¡à ¡®âª¨ ¤àã£¨å ¡®ªá®¢, ¢® ¢à¥¬ï ¢ë¤¥«¥­¨ï ¬ë誮© ⥪áâ , ¤«ï í⮣® ¢ ⥪á⠯ணࠬ¬ë ­¥®¡å®¤¨¬® ¤®¡ ¢¨âì ¨¤¥­â¨ä¨ª â®à ¡®ªá  â.¥. dd 0x0 ¨ ¢ ­¥£® ¡ã¤¥â ¯®¬¥é âìáï 㪠 â¥«ì ­  editbox
2
;  30.03.2007 ¥à¥¤¥« « ¯à®æ¥¤ãà㠢뤥«¥­¨ï, ⥯¥àì ⥪á⠢뤥«ï¥âáï ⮫쪮 ⮫쪮 ¬ë誮©
3
;  30.03.2007 ¥à¥¤¥« « ¯à®æ¥¤ãà㠢뤥«¥­¨ï, ⥯¥àì ⥪á⠢뤥«ï¥âáï ⮫쪮 ⮫쪮 ¬ë誮©
3
;  09.03.2007 „®¯¨á « ã¯à ¢«¥­¨¥ mouse + shift  ¢ë¤¥«¥­¨¥ ¨ ¯¥à¥¬¥é¥­¨¥
4
;  09.03.2007 „®¯¨á « ã¯à ¢«¥­¨¥ mouse + shift  ¢ë¤¥«¥­¨¥ ¨ ¯¥à¥¬¥é¥­¨¥
4
;  07.03.2007 „®¯¨á « ã¯à ¢«¥­¨¥ á shift home + end ãá¯à ¢¨« ­¥áª®«ìª® ¡ £®¢
5
;  07.03.2007 „®¯¨á « ã¯à ¢«¥­¨¥ á shift home + end ãá¯à ¢¨« ­¥áª®«ìª® ¡ £®¢
5
;  06.03.2007 ¥à¥¯¨á « ¯®«­®áâìî  «£®à¨â¬ ã¯à ¢«¥­¨ï shift
6
;  06.03.2007 ¥à¥¯¨á « ¯®«­®áâìî  «£®à¨â¬ ã¯à ¢«¥­¨ï shift
Line 53... Line 54...
53
;       call    edit_box.key
54
;       call    edit_box.key
54
;  ¥à¥¤ ¢ë§®¢®¬ ®¡à ¡®â稪  ¬ëè¨ á«¥¤ã¥â ¯à®¢¥à¨âì, ï¥âáï «¨ ®ª­®
55
;  ¥à¥¤ ¢ë§®¢®¬ ®¡à ¡®â稪  ¬ëè¨ á«¥¤ã¥â ¯à®¢¥à¨âì, ï¥âáï «¨ ®ª­®
55
;  ªâ¨¢­ë¬.
56
;  ªâ¨¢­ë¬.
56
;  …᫨ 饫箪 ¬ëè¨ ¡ë« ¯à®©§¢¥¤¥­ §  ¯à¥¤¥« ¬¨ edit box
57
;  …᫨ 饫箪 ¬ëè¨ ¡ë« ¯à®©§¢¥¤¥­ §  ¯à¥¤¥« ¬¨ edit box
57
; 䮪ãá â¥àï¥âáï.
58
; 䮪ãá â¥àï¥âáï.
-
 
59
;;;;;;;;;;;;;;;;;;
-
 
60
include 'editbox.mac'    ;¬ ªà®á ª®â®àë© ¤®«¦¥­ ®¡«¥£ç¨âì ¦¨§­ì :) ᯥ樠«ì­® ¤«ï editbox
-
 
61
;;;;;;;;;;;;;;;;;;
58
macro use_edit_box
62
macro use_edit_box
59
{
63
{
60
edit_box:
64
edit_box:
61
ed_width	equ [edi]		;è¨à¨­  ª®¬¯®­¥­â 
65
ed_width        equ [edi]               ;è¨à¨­  ª®¬¯®­¥­â 
62
ed_left 	equ [edi+4]             ;¯®«®¦¥­¨¥ ¯® ®á¨ å
66
ed_left         equ [edi+4]             ;¯®«®¦¥­¨¥ ¯® ®á¨ å
63
ed_top		equ [edi+8]             ;¯®«®¦¥­¨¥ ¯® ®á¨ ã
67
ed_top          equ [edi+8]             ;¯®«®¦¥­¨¥ ¯® ®á¨ ã
64
ed_color	equ [edi+12]		;梥â ä®­  ª®¬¯®­¥­â 
68
ed_color        equ [edi+12]            ;梥â ä®­  ª®¬¯®­¥­â 
-
 
69
shift_color	equ [edi+16]		;=0x6a9480
65
ed_focus_border_color	equ [edi+16]	;梥â à ¬ª¨ ª®¬¯®­¥­â 
70
ed_focus_border_color   equ [edi+20]    ;梥â à ¬ª¨ ª®¬¯®­¥­â 
66
ed_blur_border_color	equ [edi+20]    ;梥⠭¥  ªâ¨¢­®£® ª®¬¯®­¥­â 
71
ed_blur_border_color    equ [edi+24]    ;梥⠭¥  ªâ¨¢­®£® ª®¬¯®­¥­â 
67
ed_text_color	equ [edi+24]            ;梥â ⥪áâ 
72
ed_text_color   equ [edi+28]            ;梥â ⥪áâ 
68
ed_max		equ [edi+28]                    ;ª®«-¢® ᨬ¢®«®¢ ª®â®àë¥ ¬®¦­® ¬ ªá¨¬ «ì­® ¢¢¥áâ¨
73
ed_max          equ [edi+32]                    ;ª®«-¢® ᨬ¢®«®¢ ª®â®àë¥ ¬®¦­® ¬ ªá¨¬ «ì­® ¢¢¥áâ¨
69
ed_text 	equ [edi+32]                    ;㪠§ â¥«ì ­  ¡ãä¥à
74
ed_text         equ [edi+36]                    ;㪠§ â¥«ì ­  ¡ãä¥à
70
ed_flags	equ [edi+36]            ;ä« £¨
75
ed_flags        equ [edi+40]            ;ä« £¨
71
ed_size equ [edi+38]                    ;ª®«-¢® ᨬ¢®«®¢
76
ed_size equ [edi+42]                    ;ª®«-¢® ᨬ¢®«®¢
72
ed_pos	equ [edi+42]                    ;¯®§¨æ¨ï ªãàá®à 
77
ed_pos  equ [edi+46]                    ;¯®§¨æ¨ï ªãàá®à 
73
ed_offset	equ [edi+46]            ;ᬥ饭¨¥
78
ed_offset       equ [edi+50]            ;ᬥ饭¨¥
74
cl_curs_x	equ [edi+50]		;¯à¥¤ë¤ã饥 ª®®à¤¨­ â  ªãàá®à  ¯® å
79
cl_curs_x       equ [edi+54]            ;¯à¥¤ë¤ã饥 ª®®à¤¨­ â  ªãàá®à  ¯® å
75
cl_curs_y	equ [edi+54]		;¯à¥¤ë¤ã饥 ª®®à¤¨­ â  ªãàá®à  ¯® ã
80
cl_curs_y       equ [edi+58]            ;¯à¥¤ë¤ã饥 ª®®à¤¨­ â  ªãàá®à  ¯® ã
76
ed_shift_pos	equ [edi+58]            ;¯®«®¦¥­¨¥ ªãàá®à 
81
ed_shift_pos    equ [edi+62]            ;¯®«®¦¥­¨¥ ªãàá®à 
77
ed_shift_pos_old equ [edi+62]           ;áâ à®¥ ¯®«®¦¥­¨¥ ªãàá®à 
82
ed_shift_pos_old equ [edi+66]           ;áâ à®¥ ¯®«®¦¥­¨¥ ªãàá®à 
78
;==========================================================
83
;==========================================================
79
;=== ¯à®æ¥¤ãà  ¯à®à¨á®¢ª¨ =================================
84
;=== ¯à®æ¥¤ãà  ¯à®à¨á®¢ª¨ =================================
80
;==========================================================
85
;==========================================================
81
.draw:
86
.draw:
82
pusha
87
pusha
Line 95... Line 100...
95
	test	word ed_flags,ed_focus
100
        test    word ed_flags,ed_focus
96
	je	@f
101
        je     @f
97
	call	.draw_cursor
102
        call    .draw_cursor
98
@@:
103
@@:
99
	call	.draw_text
104
        call    .draw_text
100
popa
105
edit_ex
101
ret
106
 
-
 
107
;debug_func
102
;----------------------------------------------------------
108
;----------------------------------------------------------
103
;--- ¯à®æ¥¤ãà  ¯à®à¨á®¢ª¨ ¢ë¤¥«¥­®© ç á⨠-----------------
109
;--- ¯à®æ¥¤ãà  ¯à®à¨á®¢ª¨ ¢ë¤¥«¥­®© ç á⨠-----------------
104
;----------------------------------------------------------
110
;----------------------------------------------------------
105
.draw_shift:
111
.draw_shift:
106
	test	word ed_flags,ed_shift_bac ;ãáâ ­®¢ª  ä« £ , ¢ë¤¥«¥­­®© ®¡« áâ¨
112
        test    word ed_flags,ed_shift_bac ;ãáâ ­®¢ª  ä« £ , ¢ë¤¥«¥­­®© ®¡« áâ¨
107
	jz	@f
113
        jz      @f
108
        mov	ebp,shift_color
114
        mov     ebp,shift_color
109
        mov	ebx,dword	ed_shift_pos
115
        mov     ebx,dword       ed_shift_pos
110
	call	.sh_cl_
116
        call    .sh_cl_
111
@@:	ret
117
@@:     ret
112
 
-
 
113
 
-
 
114
;----------------------------------------------------------
118
;----------------------------------------------------------
115
;--- ¯à®æ¥¤ãà  ¯à®à¨á®¢ª¨ ⥪áâ  --------------------------
119
;--- ¯à®æ¥¤ãà  ¯à®à¨á®¢ª¨ ⥪áâ  --------------------------
116
;----------------------------------------------------------
120
;----------------------------------------------------------
117
.draw_text:
121
.draw_text:
118
;--- ¢ëç¨á«ï¥¬, ᪮«ìª® ¯®¬¥é ¥âáï ᨬ¢®«®¢ ---
122
;--- ¢ëç¨á«ï¥¬, ᪮«ìª® ¯®¬¥é ¥âáï ᨬ¢®«®¢ ---
Line 297... Line 301...
297
	jmp	.chk_d
301
        jmp     .chk_d
298
.add_8:	add	ebx,edx
302
.add_8: add     ebx,edx
299
.chk_d:	mov	ed_offset,ebx
303
.chk_d: mov     ed_offset,ebx
300
	call    .draw_bg
304
        call    .draw_bg
301
	and	word ed_flags,ed_offset_cl
305
        and     word ed_flags,ed_offset_cl
302
popa
-
 
303
	ret
306
edit_ex
304
@@:
307
@@:
305
	or	word ed_flags,ed_offset_fl
308
        or      word ed_flags,ed_offset_fl
306
popa
-
 
307
	ret
309
edit_ex
308
;==========================================================
310
;==========================================================
309
;=== ®¡à ¡®âª  ª« ¢¨ âãàë =================================
311
;=== ®¡à ¡®âª  ª« ¢¨ âãàë =================================
310
;==========================================================
312
;==========================================================
311
.key:
313
.key:
312
pusha
314
pusha
Line 379... Line 381...
379
	jae	.no_figure
381
        jae     .no_figure
380
@@:	mov	ebx, ed_pos
382
@@:     mov     ebx, ed_pos
381
	cmp	ebx,edx
383
        cmp     ebx,edx
382
	jl	@f ; ¥á«¨ ¬¥­ìè¥ ¨«¨ à ¢­®
384
        jl      @f ; ¥á«¨ ¬¥­ìè¥ ¨«¨ à ¢­®
383
.no_figure:
385
.no_figure:
384
	popa
-
 
385
	ret
386
edit_ex
386
.insert: test	word ed_flags,ed_insert	;not 	word ed_insert
387
.insert: test   word ed_flags,ed_insert ;not    word ed_insert
387
         je     .insert_1
388
         je     .insert_1
388
         and	word ed_flags,ed_insert_cl
389
         and    word ed_flags,ed_insert_cl
389
	jmp	.no_figure
390
        jmp     .no_figure
390
.insert_1:
391
.insert_1:
391
	or	word ed_flags,ed_insert
392
        or      word ed_flags,ed_insert
392
        jmp	.no_figure
393
        jmp     .no_figure
393
.ins_v:
394
.ins_v:
394
	dec	dword [ebp+38];ed_size    ;processing is insert
395
        dec     dword [ebp+42];ed_size    ;processing is insert
395
	sub	esi,ecx
396
        sub     esi,ecx
396
	add	esi,ebx
397
        add     esi,ebx
397
        mov	edi,esi
398
        mov     edi,esi
398
;clear
399
;clear
399
pusha
400
pusha
Line 412... Line 413...
412
	mov	edi,esi
413
        mov     edi,esi
Line 413... Line 414...
413
 
414
 
414
       	cmp 	ecx,ebx         ;…᫨ ã ­ á ¯®§¨æ¨ï ªãàá®à  = ⥪ã饬ã à §¬¥àã ­ ¯¥ç â ­­ëå ᨬ¢®«®¢ â.¥. ªãàá®à á⮨⠢ ª®­æ¥
415
        cmp     ecx,ebx         ;…᫨ ã ­ á ¯®§¨æ¨ï ªãàá®à  = ⥪ã饬ã à §¬¥àã ­ ¯¥ç â ­­ëå ᨬ¢®«®¢ â.¥. ªãàá®à á⮨⠢ ª®­æ¥
Line 415... Line 416...
415
	je	.In_k
416
        je      .In_k
416
 
417
 
417
	test	word [ebp+36],ed_insert ;IF insert is enable  â.ª. edi ¨§¬¥­¥­  ¤à¥á㥬 ç¥à¥§ ebp
418
        test    word [ebp+40],ed_insert ;IF insert is enable  â.ª. edi ¨§¬¥­¥­  ¤à¥á㥬 ç¥à¥§ ebp
418
	jne	.ins_v
419
        jne     .ins_v
419
;clear
420
;clear
420
pusha
421
pusha
Line 448... Line 449...
448
	mov	ecx,ed_pos
449
        mov     ecx,ed_pos
449
	cmp	edx,ecx
450
        cmp     edx,ecx
450
	jg	.bac_del
451
        jg      .bac_del
451
	test	word ed_flags,ed_shift_on
452
        test    word ed_flags,ed_shift_on
452
	jne	.del_bac
453
        jne     .del_bac
453
	popa
-
 
454
	ret
454
edit_ex
455
.bac_del:	
455
.bac_del:       
456
	call 	.del_char
456
        call    .del_char
457
	jmp 	.draw_all
457
        jmp     .draw_all
Line 458... Line 458...
458
        
458
        
459
;--- ­ ¦ â  ª« ¢¨è  backspace ---
459
;--- ­ ¦ â  ª« ¢¨è  backspace ---
460
.backspace:
460
.backspace:
461
	; ¯à®¢¥à塞, ªãàá®à ã «¥¢®£® ªà ï ?
-
 
462
	mov	edx,ed_size
461
        ; ¯à®¢¥à塞, ªãàá®à ã «¥¢®£® ªà ï ?
463
	mov	ecx,ed_pos
462
        mov     ecx,ed_pos
464
	test	ecx,ecx
463
        test    ecx,ecx
465
	jnz	.del_bac
464
        jnz     .del_bac
466
        test	word ed_flags,ed_shift_on
465
        test    word ed_flags,ed_shift_on
467
        jne	.bac_del
466
        jne     .bac_del
468
	popa
467
 
469
	ret
468
edit_ex
-
 
469
.del_bac:
470
.del_bac:
470
        mov     edx,ed_size
471
	cmp	edx,ecx	;if ed_pos=ed_size
471
        cmp     edx,ecx ;if ed_pos=ed_size
472
	je	@f
472
        je      @f
473
	dec	ecx
473
        dec     ecx
474
	call 	.del_char
474
        call    .del_char
475
@@:     test	word ed_flags,ed_shift_on
475
@@:     test    word ed_flags,ed_shift_on
476
        jne	.bac_del
476
        jne     .bac_del
477
	dec	 dword ed_pos
-
 
478
 
477
        dec      dword ed_pos
479
.draw_all:
478
.draw_all:
Line 480... Line 479...
480
       	push	.shift;.draw_cursor_text;eax
479
        push    .shift;.draw_cursor_text;eax
481
 
480
 
Line 676... Line 675...
676
	call	.sh_cl_  ;®ç¨á⪠ ¢ë¤¥«¥­®£® äà £¬¥­â 
675
        call    .sh_cl_  ;®ç¨á⪠ ¢ë¤¥«¥­®£® äà £¬¥­â 
677
	and	word ed_flags,ed_shift_cl ; ®ç¨á⪠ ®â ⮣® çâ® ã¡à «¨ ¢ë¤¥«¥­¨¥ 
676
        and     word ed_flags,ed_shift_cl ; ®ç¨á⪠ ®â ⮣® çâ® ã¡à «¨ ¢ë¤¥«¥­¨¥ 
678
	jmp     .draw_cursor_text
677
        jmp     .draw_cursor_text
679
@@:
678
@@:
680
        and	word ed_flags,ed_shift_off
679
        and     word ed_flags,ed_shift_off
681
	popa
-
 
682
	ret	
680
edit_ex
683
 
-
 
684
;¯à®¢¥àª  á®áâ®ï­¨ï shift ¡ë« «¨ ®­ ­ ¦ â à ­ìè¥?
681
;¯à®¢¥àª  á®áâ®ï­¨ï shift ¡ë« «¨ ®­ ­ ¦ â à ­ìè¥?
685
.sh_enable:
682
.sh_enable:
686
	test    word ed_flags,ed_shift
683
        test    word ed_flags,ed_shift
687
	jne	.sh_ext_en ;­ à¨á®¢ âì § ªà è¥­ë© ¯àאַ㣮«ì­¨ª
684
        jne     .sh_ext_en ;­ à¨á®¢ âì § ªà è¥­ë© ¯àאַ㣮«ì­¨ª
Line 752... Line 749...
752
;äã­ªæ¨ï ¢­¥á¥­¨ï 0 ¯®  ¤à¥áã ed_size+1
749
;äã­ªæ¨ï ¢­¥á¥­¨ï 0 ¯®  ¤à¥áã ed_size+1
753
.enable_null:
750
.enable_null:
754
        pusha
751
        pusha
755
        mov	eax,ed_size
752
        mov     eax,ed_size
756
	mov	ebx,ed_text
753
        mov     ebx,ed_text
-
 
754
	test	eax,eax
757
	add	eax,ebx
755
        add     eax,ebx
-
 
756
	jne	@f
758
	inc	eax
757
        inc     eax
759
	xor	ebx,ebx
758
@@:     xor     ebx,ebx
760
	mov 	[eax],bl
759
        mov     [eax],bl
761
	popa
-
 
762
	ret
760
edit_ex
763
;- 㤠«¥­¨¥ ᨬ¢®« 
761
;- 㤠«¥­¨¥ ᨬ¢®« 
764
;‚室­ë¥ ¤ ­­ë¥ edx=ed_size;ecx=ed_pos
762
;‚室­ë¥ ¤ ­­ë¥ edx=ed_size;ecx=ed_pos
765
.del_char:
763
.del_char:
766
	mov     esi,ed_text
764
        mov     esi,ed_text
767
        test	word ed_flags,ed_shift_on
765
        test    word ed_flags,ed_shift_on
Line 874... Line 872...
874
;;;;;;;;;;;;;;;;;;
872
;;;;;;;;;;;;;;;;;;
875
;;à®¢¥àª  ­ ¦ â «¨ shift
873
;;à®¢¥àª  ­ ¦ â «¨ shift
876
;;;;;;;;;;;;;;;;;;
874
;;;;;;;;;;;;;;;;;;
877
.check_shift:
875
.check_shift:
878
pusha   ;á®åà ­¨¬ ¢á¥ ॣ¨áâàë
876
pusha   ;á®åà ­¨¬ ¢á¥ ॣ¨áâàë
879
	xor	ecx,ecx
-
 
880
	inc	ecx
-
 
881
	mov	eax,66
877
        mcall   66,3,1
882
	mov	ebx,3
-
 
883
	int	0x40
-
 
884
	test	al,0x03
878
        test    al,0x03
885
	je	@f
879
        je      @f
886
        or      word ed_flags,ed_shift   ;ãáâ ­®¢¨¬ ä« £
880
        or      word ed_flags,ed_shift   ;ãáâ ­®¢¨¬ ä« £
887
@@:     popa	   ;¢®ááâ ­®¢¨¬ ॣ¨áâàë
-
 
888
	ret
881
@@:edit_ex
889
 
-
 
890
;==========================================================
882
;==========================================================
891
;=== ®¡à ¡®âª  ¬ëè¨ =======================================
883
;=== ®¡à ¡®âª  ¬ëè¨ =======================================
892
;==========================================================
884
;==========================================================
893
.mouse:
885
.mouse:
894
pusha
886
pusha
895
	mov	eax,dword [mouse_flag]
-
 
896
	test	eax,eax
-
 
897
	jz	@f
-
 
898
	cmp	eax,edi
-
 
899
	je	@f
887
;debug
900
 
-
 
901
	popa
-
 
902
	ret
-
 
903
;----------------------------------------------------------
888
;----------------------------------------------------------
904
;--- ¯®«ãç ¥¬ á®áâ®ï­¨¥ ª­®¯®ª ¬ëè¨ -----------------------
889
;--- ¯®«ãç ¥¬ á®áâ®ï­¨¥ ª­®¯®ª ¬ëè¨ -----------------------
905
;----------------------------------------------------------
890
;----------------------------------------------------------     
906
@@:     
-
 
907
	mov	eax,37
891
        mcall   37,2
908
	mov	ebx,2
-
 
909
	int	0x40
-
 
910
;----------------------------------------------------------
892
;----------------------------------------------------------
911
;--- ¯à®¢¥à塞 á®áâ®ï­¨¥ ----------------------------------
893
;--- ¯à®¢¥à塞 á®áâ®ï­¨¥ ----------------------------------
912
;----------------------------------------------------------
894
;----------------------------------------------------------
913
	test	eax,1
895
        test    eax,1              
914
	jnz	.mouse_left_button
896
        jnz     .mouse_left_button
915
        and	word ed_flags,ed_mouse_on_off
897
        and     word ed_flags,ed_mouse_on_off
916
	xor	ebx,ebx
898
        xor     ebx,ebx
917
	mov	dword [mouse_flag],ebx
899
        mov     dword [mouse_flag],ebx
918
	popa
900
edit_ex
919
	ret
901
.mouse_left_button:
920
;----------------------------------------------------------
902
;----------------------------------------------------------
921
;--- Ž¡à ¡®âª  .mouse_wigwag
903
;--- ¡«®ª¨à®¢ª  ®â 䮪ãá¨à®¢ª¨ ¢ ¤àã£¨å ¡®ªá å ¯à¨ ¯®¯ ¤ ­¨¨ ­  ­¨å ªãàá®à 
922
;----------------------------------------------------------
904
;----------------------------------------------------------
923
.mouse_wigwag:
-
 
924
	shr	eax,16
-
 
925
	or	word ed_flags,ed_shift_on+ed_shift
-
 
926
 
-
 
927
	mov	ecx,structure_of_potock
-
 
928
	mov	ebx,dword [ecx+34]
905
        mov     eax,dword [mouse_flag]
929
	add     ebx,ed_left
906
        test    eax,eax
930
	add	ebx,5
-
 
931
	cmp	eax,ebx
-
 
932
	jl	.left
-
 
933
	add	ebx,ed_width
907
        jz      @f
934
        cmp	eax,ebx
908
        cmp     eax,edi
935
        jg	.right
909
        je      @f
936
        jmp	._mvpos
910
        jmp     ._blur
937
 
-
 
938
.mouse_left_button:
-
 
939
;----------------------------------------------------------
911
;----------------------------------------------------------
940
;--- ¬®¤¨ä¨æ¨à㥬 ª®®à¤¨­ âë, â.¥. ¤®¡ ¢«ï¥¬ ª®®à¤¨­ âë ®ª­ .
912
;--- ¬®¤¨ä¨æ¨à㥬 ª®®à¤¨­ âë, â.¥. ¤®¡ ¢«ï¥¬ ª®®à¤¨­ âë ®ª­ .
941
;----------------------------------------------------------
913
;----------------------------------------------------------
942
        mov	eax,9
-
 
943
        mov 	ebx,structure_of_potock
914
@@:     mcall   9,structure_of_potock,-1
944
	or	ecx,-1
-
 
945
	int	0x40
-
 
946
;----------------------------------------------------------
915
;----------------------------------------------------------
947
;--- ¯®«ãç ¥¬ ª®®à¤¨­ âë ¬ëè¨ ®â­®á¨â¥«ì­® 0 â.¥ ¢á¥© ®¡« á⨠íªà ­ 
916
;--- ¯®«ãç ¥¬ ª®®à¤¨­ âë ¬ëè¨ ®â­®á¨â¥«ì­® 0 â.¥ ¢á¥© ®¡« á⨠íªà ­ 
948
;----------------------------------------------------------
917
;----------------------------------------------------------
949
	mov	eax,37
918
        mcall   37,0
950
	xor	ebx,ebx
-
 
951
	int	0x40
-
 
952
;----------------------------------------------------------
919
;----------------------------------------------------------
953
;--- € ­¥ 㤥ন¢ ¥¬ «¨ ¬ë ª« ¢¨èã ¬ë誨, ¯¥à¥¬¥é ï ªãàá®à, ¢® ¢á¥ à §­ë¥ áâ®à®­ë?
920
;--- € ­¥ 㤥ন¢ ¥¬ «¨ ¬ë ª« ¢¨èã ¬ë誨, ¯¥à¥¬¥é ï ªãàá®à, ¢® ¢á¥ à §­ë¥ áâ®à®­ë?
954
;----------------------------------------------------------
921
;----------------------------------------------------------
955
	mov	ecx,structure_of_potock
922
        mov     ecx,structure_of_potock
956
 	test	word ed_flags,ed_mouse_on
923
        test    word ed_flags,ed_mouse_on
Line 1012... Line 979...
1012
@@:     
979
@@:     
1013
 	test	word ed_flags,ed_mouse_on
980
        test    word ed_flags,ed_mouse_on
1014
	jne     @f
981
        jne     @f
Line 1015... Line 982...
1015
        
982
        
1016
        mov	dword ed_shift_pos,eax
983
        mov     dword ed_shift_pos,eax
1017
	or	word  ed_flags,ed_mous_adn_b;ed_mouse_on
984
        or      word  ed_flags,ed_mouse_on
-
 
985
        mov     dword ed_pos,eax
-
 
986
        mov     dword [mouse_flag],edi          ;ãáâ ­®¢¨¬ ¨¤¥­â¨ä¨ª â®à
1018
	mov	dword ed_pos,eax
987
        bts     word ed_flags,1                 ;ãáâ ­®¢ª  䮪ãá 
1019
	jmp	.m_sh
988
        jmp     .m_sh
1020
@@:
989
@@:             
1021
	cmp	eax,dword ed_shift_pos  ;¥á«¨ ¯®§¨æ¨¨ ­¥ ¨§¬¥­¨«¨áì
990
        cmp     eax,dword ed_shift_pos  ;¥á«¨ ¯®§¨æ¨¨ ­¥ ¨§¬¥­¨«¨áì
1022
	je	.mouse_ex
991
        je      .mouse_ex
1023
	mov	ed_pos,eax
992
        mov     ed_pos,eax
1024
        mov	ebp,dword shift_color
993
        mov     ebp,dword shift_color
1025
	mov	ebx,dword ed_shift_pos
994
        mov     ebx,dword ed_shift_pos
1026
	call	.sh_cl_
995
        call    .sh_cl_
1027
	or      word ed_flags,ed_mous_adn_b	;ãáâ ­®¢¨¬ ¡¨â çâ® ¬ë ¢ë¤¥«¨«¨ +shift_on +
-
 
1028
	mov	dword [mouse_flag],edi
996
        or      word ed_flags,ed_mous_adn_b     ;ãáâ ­®¢¨¬ ¡¨â çâ® ¬ë ¢ë¤¥«¨«¨ +shift_on +
1029
.m_sh:  call	.draw_text
997
.m_sh:  call    .draw_text
1030
	call	.draw_cursor
998
        call    .draw_cursor
1031
;----------------------------------------------------------
999
;----------------------------------------------------------
1032
;--- ¯à®æ¥¤ãà  ãáâ ­®¢ª¨ 䮪ãá  ---------------------------
1000
;--- ¯à®æ¥¤ãà  ãáâ ­®¢ª¨ 䮪ãá  ---------------------------
1033
;----------------------------------------------------------
-
 
1034
	bts	word ed_flags,1
-
 
1035
	jc	.mouse_ex
1001
;----------------------------------------------------------
1036
	jmp	.drc
1002
        jmp     .drc
1037
._blur:
1003
._blur:
1038
	test	word ed_flags,ed_always_focus
1004
        test    word ed_flags,ed_always_focus
1039
	jne	.mouse_ex
1005
        jne     .mouse_ex
Line 1043... Line 1009...
1043
	mov	ebp,ed_color
1009
        mov     ebp,ed_color
1044
	call	.clear_cursor
1010
        call    .clear_cursor
1045
.drc:	call	.draw_border
1011
.drc:   call    .draw_border
1046
.mouse_ex:
1012
.mouse_ex:
Line 1047... Line -...
1047
 
-
 
1048
popa
1013
 
1049
ret
1014
edit_ex
1050
;----------------------------------------------------------
1015
;----------------------------------------------------------
1051
;--- ¯à®æ¥¤ãà  à §¬ë¢ ­¨ï 䮪ãá  --------------------------
1016
;--- ¯à®æ¥¤ãà  à §¬ë¢ ­¨ï 䮪ãá  --------------------------
1052
;----------------------------------------------------------
1017
;----------------------------------------------------------
1053
;.blur:
1018
;.blur:
Line 1056... Line 1021...
1056
	;btr     ed_flags,1
1021
        ;btr     ed_flags,1
1057
	;jnc     @f
1022
        ;jnc     @f
1058
	;call    .draw_border
1023
        ;call    .draw_border
1059
	;call    .clear_cursor
1024
        ;call    .clear_cursor
1060
;@@:
1025
;@@:
-
 
1026
;edit_ex
-
 
1027
 
-
 
1028
;----------------------------------------------------------
-
 
1029
;--- Ž¡à ¡®âª  .mouse_wigwag
-
 
1030
;----------------------------------------------------------
-
 
1031
.mouse_wigwag:
-
 
1032
        shr     eax,16
-
 
1033
        or      word ed_flags,ed_shift_bac
-
 
1034
;;;;;;;;;;;;;;;;;;
-
 
1035
;;¯à®æ¥¤ãà  ®¡à ¡®âª¨ ¯®«®¦¥­¨ï ¢ë¤¥«¥­­®£® ⥪áâ , ª®£¤  ¯à®¨á室¨â ¢ë室 §  ¯à¥¤¥«ë editbox
-
 
1036
;;;;;;;;;;;;;;;;;;
-
 
1037
        mov     ecx,structure_of_potock
-
 
1038
        mov     ebx,dword [ecx+34]
-
 
1039
        add     ebx,ed_left
-
 
1040
        add     ebx,5
-
 
1041
 
-
 
1042
	cmp	eax,ebx
-
 
1043
	jb	.mleft
-
 
1044
 
-
 
1045
	add	ebx,ed_width
-
 
1046
	cmp	eax,ebx
-
 
1047
	ja	.mright	
-
 
1048
 
-
 
1049
	sub	ebx,ed_width
-
 
1050
 
-
 
1051
        xor     edx,edx
-
 
1052
        sub     eax,ebx ; ¢ëç⨬ ¨§ ª®®à¤¨­ â ¬ë誨 ¯® ®á¨ å ª®®à¤¨­ âë ¤® editbox ¯® ®á¨ å
-
 
1053
        mov     ebx,6
-
 
1054
        div     ebx
-
 
1055
;;;;;;;;;;;;;;;;;;
-
 
1056
;;¯à®æ¥¤ãà  ®¡à ¡®âª¨ ¯®«®¦¥­¨ï ¢ë¤¥«¥­­®£® ⥪áâ , ¢ ¯à¥¤¥« å ®¡« á⨠editbox
-
 
1057
;;;;;;;;;;;;;;;;;;
-
 
1058
;®«ã稫¨ ª®®à¤¨­ âë ¢ eax ¬ë誨, â.¥. ªã¤  ®­  ¯¥à¥¬¥á⨫ áì
-
 
1059
;¨á®¢ ­¨¥ § ªà è¥­ëå ¯àאַ㣮«ì­¨ª®¢ ¨ ®ç¨á⪠ ¨å
-
 
1060
	add	eax,ed_offset	;¤®¡ ¢¨¬ ᬥ饭¨¥
-
 
1061
	cmp	eax,dword ed_size	;¥á«¨ ¢ë諨 §  ¯à¥¤¥«ë, â® ­¨ç¥£® ­¥ ¤¥« âì
-
 
1062
	ja	.mwigvag
-
 
1063
.mdraw: 
-
 
1064
        mov     dword   ed_pos,eax ;á®åà ­¨¬ ­®¢®¥ §­ ç¥­¨¥
-
 
1065
;¨á®¢ ­¨¥ § ªà è¥­ëå ¯àאַ㣮«ì­¨ª®¢ ¨ ®ç¨á⪠ ¨å
-
 
1066
	mov     ecx,dword       ed_shift_pos
-
 
1067
        mov     ebx,dword       ed_shift_pos_old
-
 
1068
        mov     dword   ed_shift_pos_old,eax    ;¢­¥á¥¬ ­®¢®¥ §­ ç¥­¨¥ áâ à®© ¯®§¨æ¨¨ ªãàá®à 
-
 
1069
;¯à®¢¥àª  ¨ à¨á®¢ ­¨¥ § ªà è¥­ëå ®¡« á⥩
-
 
1070
        cmp     ecx,ebx         ;¢ëïá­ï¥¬ ªã¤  ¡ë«® ¤¢¨¦¥­¨¥ ­  ®¤¨­ è £ ­ § ¤
-
 
1071
        je      .m1_shem        ;¤¢¨¦¥­¨ï ­¥ ¡ë«® à ­¥¥ 
-
 
1072
        jb      .msmaller       ;¤¢¨¦¥­¨¥ ¡ë«® ->
-
 
1073
        cmp     ebx,eax         ;¤¢¨¦¥­¨¥ ¡ë«® ¤® í⮣® <- ¨ âãâ ¬ë ¯à®¢¥à塞 ᥩç á ªã¤  ¤¢¨¦¥­¨¥ ¯à®¨á室¨â
-
 
1074
        ja      .m1_shem        ;¥á«¨ ¡ë«® ¤¢¨¦¥­¨¥ <- â® ­ã¦­® § ªà á¨âì ®¡« áâì
-
 
1075
	je	.mwigvag	;¥á«¨ ¨§¬¥­¥­¨ï ­¥ ¡ë«®, â® ­¨ç¥£® ­¥ ¤¥« âì
-
 
1076
        mov     ebp,ed_color    ;âã⠭㦭® ®ç¨áâ¨âì ®¡« áâì c ed_pos ed_shift_pos_old
-
 
1077
;¢å®¤­ë¥ ¯ à ¬¥âàë ebp=color ebx=ed_shift_pos
-
 
1078
        call    .sh_cl_
-
 
1079
        jmp     .mwigvag
-
 
1080
.msmaller:
-
 
1081
        cmp     ebx,eax
-
 
1082
        jb      .m1_shem
-
 
1083
        mov     ebp,ed_color
-
 
1084
;¢å®¤­ë¥ ¯ à ¬¥âàë ebp=color ebx=ed_shift_pos
-
 
1085
        call    .sh_cl_
-
 
1086
        jmp     .mwigvag
-
 
1087
;alike  =
-
 
1088
.m1_shem: 
-
 
1089
        mov     ebp,shift_color
-
 
1090
;¢å®¤­ë¥ ¯ à ¬¥âàë ebp=color ebx=ed_shift_pos
-
 
1091
	mov	ebx,ecx
-
 
1092
        call    .sh_cl_
-
 
1093
        jmp     .mwigvag
-
 
1094
.mwigvag:
-
 
1095
        and     word ed_flags,ed_shift_mcl
-
 
1096
	jmp	.draw_cursor_text
1061
;popa
1097
;       popa
1062
;ret
1098
;       ret
-
 
1099
.mleft:
-
 
1100
	mov	eax,ed_pos
-
 
1101
	test	eax,eax
-
 
1102
	jz	.mwigvag
-
 
1103
	dec	eax
-
 
1104
	call	.check_offset
-
 
1105
	push	eax
-
 
1106
	mov	ebx,ed_shift_pos
-
 
1107
	mov	ebp,shift_color
-
 
1108
	call	.sh_cl_
-
 
1109
	pop	eax
-
 
1110
	jmp	.mdraw
-
 
1111
.mright:
-
 
1112
	mov	eax,ed_pos
-
 
1113
	mov	ebx,ed_size
-
 
1114
	cmp	eax,ebx
-
 
1115
	jae	.mwigvag
-
 
1116
	inc     eax
-
 
1117
	call	.check_offset
-
 
1118
	mov	ebx,ed_shift_pos
-
 
1119
	mov	ebp,shift_color
-
 
1120
	push	eax
-
 
1121
	call	.sh_cl_
-
 
1122
	pop	eax
-
 
1123
	jmp	.mdraw	
-
 
1124
 
1063
}
1125
}
1064
ed_figure_only= 1000000000000000b   ;®¤­¨ ᨬ¢®«ë 
1126
ed_figure_only= 1000000000000000b   ;®¤­¨ ᨬ¢®«ë 
1065
ed_always_focus= 100000000000000b
1127
ed_always_focus= 100000000000000b
1066
ed_focus=                     10b   ;䮪ãá ¯à¨«®¦¥­¨ï
1128
ed_focus=                     10b   ;䮪ãá ¯à¨«®¦¥­¨ï
1067
ed_shift_on=                1000b   ;¥á«¨ ­¥ ãáâ ­®¢«¥­ -§­ ç¨â ¢¯¥à¢ë¥ ­ ¦ â shift,¥á«¨ ¡ë« ãáâ ­®¢«¥­, §­ ç¨â ¬ë 㦥 çâ® - â® ¤¥« «¨ 㤥ন¢ ï shift
1129
ed_shift_on=                1000b   ;¥á«¨ ­¥ ãáâ ­®¢«¥­ -§­ ç¨â ¢¯¥à¢ë¥ ­ ¦ â shift,¥á«¨ ¡ë« ãáâ ­®¢«¥­, §­ ç¨â ¬ë 㦥 çâ® - â® ¤¥« «¨ 㤥ন¢ ï shift
Line 1069... Line 1131...
1069
ed_shift=                    100b   ;¢ª«îç ¥âáï ¯à¨ ­ ¦ â¨¨ ­  shift â.¥. ¥á«¨ ­ ¦¨¬ î
1131
ed_shift=                    100b   ;¢ª«îç ¥âáï ¯à¨ ­ ¦ â¨¨ ­  shift â.¥. ¥á«¨ ­ ¦¨¬ î
1070
ed_shift_off=   1111111111111011b
1132
ed_shift_off=   1111111111111011b
1071
ed_shift_bac=              10000b   ;¡¨â ¤«ï ®ç¨á⪨ ¢ë¤¥«¥­®£® shift â.¥. ¯à¨ ãáâ ­®¢ª¥ £®¢®à¨â çâ® ¥áâì ¢ë¤¥«¥­¨¥
1133
ed_shift_bac=              10000b   ;¡¨â ¤«ï ®ç¨á⪨ ¢ë¤¥«¥­®£® shift â.¥. ¯à¨ ãáâ ­®¢ª¥ £®¢®à¨â çâ® ¥áâì ¢ë¤¥«¥­¨¥
1072
ed_shift_bac_cl=1111111111101111b   ;®ç¨á⪠ ¯à¨ 㤠«¥­¨¨ ¢ë¤¥«¥­¨ï
1134
ed_shift_bac_cl=1111111111101111b   ;®ç¨á⪠ ¯à¨ 㤠«¥­¨¨ ¢ë¤¥«¥­¨ï
1073
ed_shift_cl=    1111111111100011b
1135
ed_shift_cl=    1111111111100011b
-
 
1136
ed_shift_mcl=   1111111111110011b
1074
ed_left_fl=               100000b
1137
ed_left_fl=               100000b
1075
ed_right_fl=    1111111111011111b
1138
ed_right_fl=    1111111111011111b
1076
ed_offset_fl=            1000000b
1139
ed_offset_fl=            1000000b
1077
ed_offset_cl=   1111111110111111b
1140
ed_offset_cl=   1111111110111111b
1078
ed_insert=              10000000b
1141
ed_insert=              10000000b
1079
ed_insert_cl=   1111111101111111b
1142
ed_insert_cl=   1111111101111111b
1080
ed_mouse_on =          100000000b
1143
ed_mouse_on =          100000000b
1081
ed_mous_adn_b=         100011000b
1144
ed_mous_adn_b=         100011000b
1082
ed_mouse_on_off=1111111011111111b
1145
ed_mouse_on_off=1111111011111111b
1083
ed_height=14 ; ¢ëá®â 
1146
ed_height=14 ; ¢ëá®â 
1084
shift_color=0x6a9480
-
 
1085
macro draw_edit_boxes start,end
1147
macro draw_edit_boxes start,end
1086
{
1148
{
1087
	mov	edi,start
1149
        mov     edi,start
1088
	mov	ecx,((end-start)/ed_struc_size)
1150
        mov     ecx,((end-start)/ed_struc_size)
1089
@@:
1151
@@:
Line 1109... Line 1171...
1109
@@:
1171
@@:
1110
	call	edit_box.key
1172
        call    edit_box.key
1111
	add	edi,ed_struc_size
1173
        add     edi,ed_struc_size
1112
	loop	@b
1174
        loop    @b
1113
}
1175
}
1114
ed_struc_size=66
1176
ed_struc_size=70
1115
struc  edit_box width,left,top,color,focus_border_color,\
1177
struc  edit_box width,left,top,color,shift_color,focus_border_color,\
1116
       blur_border_color,text_color,max,text,flags,size
1178
       blur_border_color,text_color,max,text,flags,size,pos
1117
{
1179
{
1118
.width dd width
1180
.width dd width
1119
.left dd left
1181
.left dd left
1120
.top dd top
1182
.top dd top
1121
.color dd color
1183
.color dd color
-
 
1184
.shift_color dd shift_color
1122
.focus_border_color dd focus_border_color
1185
.focus_border_color dd focus_border_color
1123
.blur_border_color dd blur_border_color
1186
.blur_border_color dd blur_border_color
1124
.text_color dd text_color
1187
.text_color dd text_color
1125
.max dd max
1188
.max dd max
1126
.text dd text
1189
.text dd text
1127
.flags dw flags+0
1190
.flags dw flags+0
1128
.size dd size+0
1191
.size dd size+0
1129
.pos dd 0
1192
.pos dd pos+0
1130
.offset dd 0
1193
.offset dd 0
1131
.cl_curs_x dd 0
1194
.cl_curs_x dd 0
1132
.cl_curs_y dd 0
1195
.cl_curs_y dd 0
1133
.shift   dd 0
1196
.shift   dd 0
1134
.shift_old   dd 0
1197
.shift_old   dd 0