Subversion Repositories Kolibri OS

Rev

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

Rev 296 Rev 306
Line -... Line 1...
-
 
1
;  01.02.2007 ¤®à ¡®âª  edit_box, ¨á¯à ¢¨« ¡ £¨.
1
;  26.01.2007 ­®à¬ «ì­ ï à ¡®â  ª®¬¯ ­¥­â  ¨á¯à ¢¨« äãªæ¨î .check_offset
2
;  26.01.2007 ­®à¬ «ì­ ï à ¡®â  ª®¬¯ ­¥­â  ¨á¯à ¢¨« äãªæ¨î .check_offset
2
;  24.01.2007 ¯®ä¨ªá¥« ¡ £¨ ¢ë§¢ ­ë¥ ­¥ ¯à ¢¨«ì­ë¬ ª®¤®¬ )).
3
;  24.01.2007 ¯®ä¨ªá¥« ¡ £¨ ¢ë§¢ ­ë¥ ­¥ ¯à ¢¨«ì­ë¬ ª®¤®¬ )).
3
;  22.01.2007 ¨§¡ ¢¨«áï ®â £«îª®¢ ¯à¨ à ¡®â¥ á ¢ë¤¥«¥­¨¥¬ ¨ 㤠«¥­¨¥, ª®à४⭠ï à ¡®â  ª« ¢¨è¥© del & backspase
4
;  22.01.2007 ¨§¡ ¢¨«áï ®â £«îª®¢ ¯à¨ à ¡®â¥ á ¢ë¤¥«¥­¨¥¬ ¨ 㤠«¥­¨¥, ª®à४⭠ï à ¡®â  ª« ¢¨è¥© del & backspase
4
;  20.01.2007 ॠ«¨§®¢ « ¢ë¤¥«¥­¨¥ ⥪áâ  ¯® shift
5
;  20.01.2007 ॠ«¨§®¢ « ¢ë¤¥«¥­¨¥ ⥪áâ  ¯® shift
5
;  12.12.2006 ॠ«¨§®¢ « ¯®¤¤¥à¦ªã ª­®¯ª¨ insert ¨ ᥣ®¤ï ª®¬¯®­¥­â ¯®ç⨠ࠡ®â ¥â!!!!
6
;  12.12.2006 ॠ«¨§®¢ « ¯®¤¤¥à¦ªã ª­®¯ª¨ insert ¨ ᥣ®¤ï ª®¬¯®­¥­â ¯®ç⨠ࠡ®â ¥â!!!!
Line 125... Line 126...
125
	jae	@F
126
	jae	@F
126
	mov	esi,eax		;çâ®¡ë ­¥ ¢ë室¨âì §  ¯à¥¤¥«ë íªà ­ 
127
	mov	esi,eax		;çâ®¡ë ­¥ ¢ë室¨âì §  ¯à¥¤¥«ë íªà ­ 
127
;--- à¨á㥬 ⥪áâ ---
128
;--- à¨á㥬 ⥪áâ ---
128
@@: 	mov	eax,4
129
@@: 	mov	eax,4
129
	mov	ebx,ed_left
130
	mov	ebx,ed_left
-
 
131
	mov	edx,ed_offset
130
	add	ebx,2
132
	add	ebx,2
131
	shl	ebx,16
133
	shl	ebx,16
132
	mov	bx,ed_top
134
	mov	bx,ed_top
133
	add	ebx,4
135
	add	ebx,4
134
	mov	ecx,ed_text_color
136
	mov	ecx,ed_text_color
135
	mov	edx,ed_offset
-
 
136
	add	edx,ed_text
137
	add	edx,ed_text
137
	int	0x40
138
	int	0x40
138
ret
139
ret
139
;----------------------------------------------------------
140
;----------------------------------------------------------
140
;--- ¯à®æ¥¤ãà  ¯à®à¨á®¢ª¨ ä®­  ----------------------------
141
;--- ¯à®æ¥¤ãà  ¯à®à¨á®¢ª¨ ä®­  ----------------------------
141
;¢å®¤­ë¥ ¤ ­­ë¥
142
;¢å®¤­ë¥ ¤ ­­ë¥
142
;eax
143
;eax
143
;edx - color
144
;edx - color
144
;----------------------------------------------------------
145
;----------------------------------------------------------
145
.draw_bg_eax:
146
.draw_bg_eax:
146
;pusha
-
 
147
	mov	ecx,ed_top
147
	mov	ecx,ed_top
148
	add	ecx,1
148
	add	ecx,1
149
	shl	ecx,16
149
	shl	ecx,16
150
	mov	cx,13
150
	mov	cx,13
151
	mov	eax,13
151
	mov	eax,13
152
	int	0x40
152
	int	0x40
153
;popa
-
 
154
ret
153
ret
Line 155... Line 154...
155
 
154
 
156
	jmp	@f
155
	jmp	@f
157
.draw_bg:
-
 
158
;pusha
156
.draw_bg:
159
	mov	ebx,ed_left
157
	mov	ebx,ed_left
160
	add	ebx,1
158
	add	ebx,1
161
	shl	ebx,16
159
	shl	ebx,16
162
	mov	bx,ed_width
160
	mov	bx,ed_width
Line 163... Line 161...
163
	sub	ebx,1
161
	sub	ebx,1
164
 
162
 
-
 
163
@@:
165
@@:
164
	mov	ecx,ed_top
166
	mov	ecx,ed_top
165
	mov	eax,13
-
 
166
	add	ecx,1
167
	add	ecx,1
167
	shl	ecx,16
168
	shl	ecx,16
168
	mov	edx,ed_color
169
	mov	cx,ed_height
-
 
170
	sub	ecx,1
-
 
171
 
-
 
172
	mov	edx,ed_color
169
	mov	cx,ed_height
173
	mov	eax,13
-
 
174
	int	0x40
170
	sub	ecx,1
Line 175... Line 171...
175
;popa
171
        int	0x40
176
ret
172
ret
177
 
173
 
178
;----------------------------------------------------------
174
;----------------------------------------------------------
179
;--- ¯à®æ¥¤ãà  ¯®«ã祭¨ï ª®«¨ç¥á⢠ ᨬ¢®«®¢ ¢ ⥪ã饩 é¨à¨­¥ ª®¬¯®­¥­â  --------------
-
 
180
;----------------------------------------------------------
175
;--- ¯à®æ¥¤ãà  ¯®«ã祭¨ï ª®«¨ç¥á⢠ ᨬ¢®«®¢ ¢ ⥪ã饩 é¨à¨­¥ ª®¬¯®­¥­â  --------------
-
 
176
;----------------------------------------------------------
181
.get_n:
177
.get_n:
182
	xor	edx,edx   ;१ã«ìâ â à á¯®«®£ ¥âáï ¢ ¯ à¥ edx:eax ¢ eax - ®áâ â®ª
178
	mov	eax,ed_width	;¯®«ã祬 è¨à¨­ã ª®¬¯®­¥­â 
183
	mov	eax,ed_width	;¯®«ã祬 è¨à¨­ã ª®¬¯®­¥­â 
179
	xor	edx,edx   ;१ã«ìâ â à á¯®«®£ ¥âáï ¢ ¯ à¥ edx:eax ¢ eax - ®áâ â®ª
184
	sub	eax,4		;¢ëç⨬ 4
180
	sub	eax,4		;¢ëç⨬ 4
Line 208... Line 204...
208
 
204
 
209
	lea     ebx,[ebx*2+ebx]
205
	lea     ebx,[ebx*2+ebx]
210
	shl     ebx,1
206
	shl     ebx,1
211
	;imul	ebx,6
207
	;imul	ebx,6
-
 
208
	add	bx,ed_left
212
	add	bx,ed_left
209
	mov	ecx,ed_top
-
 
210
	inc	ebx
213
	inc	ebx
211
	add	ecx,2
214
	mov	ebp,ebx
-
 
215
	;push	bx
212
	mov	ebp,ebx
216
	shl	ebx,16
213
	shl	ebx,16
217
	mov	bx,bp
-
 
218
	;pop	bx
-
 
219
	mov	ecx,ed_top
-
 
220
	add	ecx,2
214
	mov	bx,bp
Line 221... Line 215...
221
	mov	ebp,ecx
215
	mov	ebp,ecx
222
	
216
	
223
	shl	ecx,16
217
	shl	ecx,16
Line 430... Line 424...
430
	cmp	ah,'9'
424
	cmp	ah,'9'
431
	ja	.no_figure
425
	ja	.no_figure
Line 432... Line 426...
432
 
426
 
433
 
427
 
434
;¯à®¢¥àª  ­  shift
428
;¯à®¢¥àª  ­  shift
435
	test	word ed_flags,ed_shift_on
429
@@:	test	word ed_flags,ed_shift_on
436
	je	@f
430
	je	@f
437
	;‚室­ë¥ ¤ ­­ë¥ edx=ed_size;ecx=ed_pos
431
	;‚室­ë¥ ¤ ­­ë¥ edx=ed_size;ecx=ed_pos
438
	push	eax
432
	push	eax
Line 463... Line 457...
463
	jmp	.no_figure
457
	jmp	.no_figure
464
.insert_1:
458
.insert_1:
465
	or	word ed_flags,ed_insert
459
	or	word ed_flags,ed_insert
466
        jmp	.no_figure
460
        jmp	.no_figure
467
.ins_v:
461
.ins_v:
468
	pop	eax edi
-
 
469
	dec	dword ed_size    ;processing is insert
462
	dec	dword [ebp+38];ed_size    ;processing is insert
470
	push	edi eax
-
 
471
	sub	esi,ecx
463
	sub	esi,ecx
472
	add	esi,ebx
464
	add	esi,ebx
473
        mov	edi,esi
465
        mov	edi,esi
474
	jmp	.In_k
466
	jmp	.In_k
475
@@:     ; ᤢ¨£ ¥¬ ᨬ¢®«ë ¯®á«¥ ªãàá®à  ¢¯à ¢®
467
@@:     ; ᤢ¨£ ¥¬ ᨬ¢®«ë ¯®á«¥ ªãàá®à  ¢¯à ¢®
Line 528... Line 520...
528
	mov	ecx,ed_pos
520
	mov	ecx,ed_pos
529
	test	ecx,ecx
521
	test	ecx,ecx
530
	jnz	.del_bac
522
	jnz	.del_bac
531
        test	word ed_flags,ed_shift_on
523
        test	word ed_flags,ed_shift_on
532
        jne	.bac_del
524
        jne	.bac_del
533
	
-
 
534
	;jmp	@b
-
 
535
 
-
 
536
	popa
525
	popa
537
	ret
526
	ret
538
.del_bac:
527
.del_bac:
539
	cmp	edx,ecx	;if ed_pos=ed_size
528
	cmp	edx,ecx	;if ed_pos=ed_size
540
	je	@f
529
	je	@f
Line 560... Line 549...
560
.draw_all2:
549
.draw_all2:
561
	and    word ed_flags,ed_shift_cl
550
	and    word ed_flags,ed_shift_cl
562
	call	.clear_cursor
551
	call	.clear_cursor
563
	call	.check_offset
552
	call	.check_offset
564
;;;;;;;;;;;;;;;
553
;;;;;;;;;;;;;;;
565
	cmp	eax,0
554
	test	eax,eax
566
	je      @f
555
	jne      @f
567
	call	.draw_bg
556
	call	.draw_bg
568
	ret
557
	ret
569
;;;;;;;;;;;;;;;
558
;;;;;;;;;;;;;;;
570
@@:	call	.get_n
559
@@:	call	.get_n
571
	push	eax
560
	push	eax
Line 735... Line 724...
735
 
724
 
736
        ;- 㤠«¥­¨¥ ᨬ¢®« 
725
        ;- 㤠«¥­¨¥ ᨬ¢®« 
737
	;‚室­ë¥ ¤ ­­ë¥ edx=ed_size;ecx=ed_pos
726
	;‚室­ë¥ ¤ ­­ë¥ edx=ed_size;ecx=ed_pos
738
.del_char:
727
.del_char:
739
	mov     esi,ed_text
-
 
740
 
-
 
741
 
728
	mov     esi,ed_text
742
        test	word ed_flags,ed_shift_on
729
        test	word ed_flags,ed_shift_on
743
        je	@f
730
        je	@f
744
	mov	eax,dword ed_shift_pos
731
	mov	eax,dword ed_shift_pos
745
	mov	ebx,esi
732
	mov	ebx,esi
Line 863... Line 850...
863
;popa
850
;popa
864
;ret
851
;ret
865
;.blur:
852
;.blur:
866
;pusha
853
;pusha
867
._blur:
854
._blur:
-
 
855
	test	word ed_flags,ed_always_focus
-
 
856
	jne	@f
868
	btr	word ed_flags,1 ; ¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
857
	btr	word ed_flags,1 ; ¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
869
	jnc     @f
858
	jnc     @f
870
	call	.clear_cursor
859
	call	.clear_cursor
871
	call	.draw_border
860
	call	.draw_border
872
@@:
861
@@:
Line 886... Line 875...
886
;@@:
875
;@@:
887
;popa
876
;popa
888
;ret
877
;ret
889
}
878
}
890
ed_figure_only=1000000000000000b
879
ed_figure_only=1000000000000000b
-
 
880
ed_always_focus=100000000000000b
891
ed_focus=10b
881
ed_focus=10b
892
ed_shift_on=1000b
882
ed_shift_on=1000b
893
ed_shift=100b
883
ed_shift=100b
894
ed_shift_cl=1111111111110011b
884
ed_shift_cl=1111111111110011b
895
macro draw_edit_boxes start,end
885
macro draw_edit_boxes start,end
Line 966... Line 956...
966
	ror	eax,16
956
	ror	eax,16
967
	mov	ed_blur_border_color,eax
957
	mov	ed_blur_border_color,eax
968
	add	edi,ed_struc_size
958
	add	edi,ed_struc_size
969
	loop	@b
959
	loop	@b
970
}
960
}
971
961
 
-
 
962
macro draw_edit_box ed_ptr
-
 
963
{
-
 
964
        mov     edi,ed_ptr
-
 
965
        call    edit_box.draw
-
 
966
}
-
 
967
 
-
 
968
macro mouse_edit_box ed_ptr
-
 
969
{
-
 
970
        mov     edi,ed_ptr
-
 
971
        call    edit_box.mouse
-
 
972
}
-
 
973
 
-
 
974
macro key_edit_box ed_ptr
-
 
975
{
-
 
976
        mov     edi,ed_ptr
-
 
977
        call    edit_box.key
-
 
978
}
-
 
979
972
980