Subversion Repositories Kolibri OS

Rev

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

Rev 8852 Rev 9568
Line 1... Line 1...
1
SCAN_LWIN_RELEASE = 0xDB
1
SCAN_LWIN_RELEASE = 0xDB
2
SCAN_RWIN_RELEASE = 0xDC
2
SCAN_RWIN_RELEASE = 0xDC
Line 3... Line 3...
3
 
3
 
4
align 16
4
align 16
5
edit_box:
-
 
6
.draw:
5
edit_box_draw:
7
	pushad
6
	pushad
8
	mov	edi,[esp+36]
7
	mov	edi,[esp+36]
9
	and	dword ed_text_color,17FFFFFFh
8
	and	dword ed_text_color,17FFFFFFh
10
	mov	ecx,ed_text_color
9
	mov	ecx,ed_text_color
Line 24... Line 23...
24
	mov	al, 16
23
	mov	al, 16
25
@@:
24
@@:
26
	mul	bl
25
	mul	bl
27
	add	eax,4
26
	add	eax,4
28
	mov	ed_height,eax
27
	mov	ed_height,eax
29
	call	.draw_border
28
	call	.border
30
.draw_bg_cursor_text:
29
.bg_cursor_text:
31
	;test    word ed_flags,ed_focus ; for unfocused controls =>
30
	;test    word ed_flags,ed_focus ; for unfocused controls =>
32
	;jz      .skip_offset           ; do not recalculate offset
31
	;jz      .skip_offset           ; do not recalculate offset
33
	call	.check_offset
32
	call	edit_box.check_offset
34
;.skip_offset:
33
;.skip_offset:
35
	call	.draw_bg
34
	call	edit_box_draw.bg
36
	test	word ed_flags,ed_focus ; do not draw selection(named shift)
35
	test	word ed_flags,ed_focus ; do not draw selection(named shift)
37
	jz	.draw_cursor_text      ;
36
	jz	.cursor_text      ;
38
	call	.draw_shift
37
	call	.shift
39
.draw_cursor_text:
38
.cursor_text:
40
	call	.draw_text
39
	call	.text
41
	test	word ed_flags,ed_focus ; and dosn`t draw cursor
40
	test	word ed_flags,ed_focus ; and dosn`t draw cursor
42
	jz	.editbox_exit
41
	jz	edit_box_exit
43
	call	.draw_cursor
42
	call	.cursor
44
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
43
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
45
;Ž¡é¨© ¢ë室 ¨§ editbox ¤«ï ¢á¥å ä㭪権 ¨ ¯®áâ ®¡à ¡®â稪®¢;;
44
;Ž¡é¨© ¢ë室 ¨§ editbox ¤«ï ¢á¥å ä㭪権 ¨ ¯®áâ ®¡à ¡®â稪®¢;;
46
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
45
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
47
.editbox_exit:
46
edit_box_exit:
48
	popad
47
	popad
49
	ret 4
48
	ret 4
Line 50... Line 49...
50
 
49
 
51
;==========================================================
50
;==========================================================
Line 54... Line 53...
54
align 16
53
align 16
55
edit_box_key:
54
edit_box_key:
56
	pushad
55
	pushad
57
	mov	edi,[esp+36]
56
	mov	edi,[esp+36]
58
	test	word ed_flags,ed_focus ; ¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
57
	test	word ed_flags,ed_focus ; ¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
59
	jz	edit_box.editbox_exit
58
	jz	edit_box_exit
60
	test	word ed_flags,ed_mouse_on or ed_disabled
59
	test	word ed_flags,ed_mouse_on or ed_disabled
61
	jnz	edit_box.editbox_exit
60
	jnz	edit_box_exit
62
;--------------------------------------
61
;--------------------------------------
63
; this code for Win-keys, works with
62
; this code for Win-keys, works with
64
; kernel SVN r.3356 or later
63
; kernel SVN r.3356 or later
65
	mcall	SF_KEYBOARD,SSF_GET_CONTROL_KEYS
64
	mcall	SF_KEYBOARD,SSF_GET_CONTROL_KEYS
66
	test	ah,$06	      ; LWin ($02) & RWin ($04)
65
	test	ah,$06	      ; LWin ($02) & RWin ($04)
67
	jnz	edit_box.editbox_exit
66
	jnz	edit_box_exit
68
;--------------------------------------
67
;--------------------------------------
69
;à®¢¥àª  ­ ¦ â shift ?
68
;à®¢¥àª  ­ ¦ â shift ?
70
	test	al,$03
69
	test	al,$03
71
	je	@f
70
	je	@f
72
	or	word ed_flags,ed_shift	 ;ãáâ ­®¢¨¬ ä« £ Shift
71
	or	word ed_flags,ed_shift	 ;ãáâ ­®¢¨¬ ä« £ Shift
Line 96... Line 95...
96
	je	edit_box_key.ctrl_c
95
	je	edit_box_key.ctrl_c
97
	cmp	ah,SCAN_CODE_V ; Ctrl + V
96
	cmp	ah,SCAN_CODE_V ; Ctrl + V
98
	je	edit_box_key.ctrl_v
97
	je	edit_box_key.ctrl_v
99
	cmp	ah,SCAN_CODE_A ; Ctrl + A
98
	cmp	ah,SCAN_CODE_A ; Ctrl + A
100
	je	edit_box_key.ctrl_a
99
	je	edit_box_key.ctrl_a
101
	jmp	edit_box.editbox_exit
100
	jmp	edit_box_exit
102
@@:
101
@@:
103
	cmp	ah,SCAN_CODE_SPACE
102
	cmp	ah,SCAN_CODE_SPACE
104
	ja	@F
103
	ja	@F
105
	cmp	al,ASCII_KEY_BACK
104
	cmp	al,ASCII_KEY_BACK
106
	jz	edit_box_key.backspace
105
	jz	edit_box_key.backspace
107
	cmp	ah,SCAN_CODE_ESCAPE
106
	cmp	ah,SCAN_CODE_ESCAPE
108
	jz	edit_box.editbox_exit
107
	jz	edit_box_exit
109
	cmp	ah,SCAN_CODE_TAB
108
	cmp	ah,SCAN_CODE_TAB
110
	jz	edit_box.editbox_exit
109
	jz	edit_box_exit
111
	cmp	ah,SCAN_CODE_RETURN
110
	cmp	ah,SCAN_CODE_RETURN
112
	jz	edit_box.editbox_exit
111
	jz	edit_box_exit
113
	jmp	.printable_character
112
	jmp	.printable_character
114
@@:
113
@@:
115
	cmp	ah,SCAN_CODE_DELETE
114
	cmp	ah,SCAN_CODE_DELETE
116
	ja	edit_box.editbox_exit
115
	ja	edit_box_exit
117
	cmp	ah,SCAN_CODE_HOME
116
	cmp	ah,SCAN_CODE_HOME
118
	jb	edit_box.editbox_exit
117
	jb	edit_box_exit
119
	cmp	ax,SCAN_CODE_CLEAR shl 8 + ASCII_KEY_CLEAR ; not operate numpad unlocked 5
118
	cmp	ax,SCAN_CODE_CLEAR shl 8 + ASCII_KEY_CLEAR ; not operate numpad unlocked 5
120
	jz	edit_box.editbox_exit
119
	jz	edit_box_exit
121
;here best place to filter up,down,pgup,pgdown
120
;here best place to filter up,down,pgup,pgdown
122
	cmp	al,ASCII_KEY_LEFT
121
	cmp	al,ASCII_KEY_LEFT
123
	jb	.printable_character
122
	jb	.printable_character
124
	and	eax,$F
123
	and	eax,$F
125
	mov	ebx,.unlock_numpad_filtration
124
	mov	ebx,.unlock_numpad_filtration
126
	jmp	dword[ebx+eax*4]
125
	jmp	dword[ebx+eax*4]
127
      .unlock_numpad_filtration       \
126
      .unlock_numpad_filtration       \
128
	     dd edit_box_key.left,    \ ; LEFT
127
	     dd edit_box_key.left,    \ ; LEFT
129
		edit_box.editbox_exit,\ ; DOWN
128
		edit_box_exit,\ ; DOWN
130
		edit_box.editbox_exit,\ ; UP
129
		edit_box_exit,\ ; UP
131
		edit_box_key.right,   \ ; RIGHT
130
		edit_box_key.right,   \ ; RIGHT
132
		edit_box_key.home,    \ ; HOME
131
		edit_box_key.home,    \ ; HOME
133
		edit_box_key.end,     \ ; END
132
		edit_box_key.end,     \ ; END
134
		edit_box_key.delete,  \ ; DELETE
133
		edit_box_key.delete,  \ ; DELETE
135
		edit_box.editbox_exit,\ ; PGDN
134
		edit_box_exit,\ ; PGDN
136
		edit_box.editbox_exit,\ ; PGUP
135
		edit_box_exit,\ ; PGUP
137
		edit_box_key.insert	; INSERT
136
		edit_box_key.insert	; INSERT
Line 138... Line 137...
138
 
137
 
139
.printable_character:
138
.printable_character:
140
	test	word ed_flags,ed_figure_only  ; ⮫쪮 æ¨äàë?
139
	test	word ed_flags,ed_figure_only  ; ⮫쪮 æ¨äàë?
141
	jz	@f
140
	jz	@f
142
	cmp	al,'0'
141
	cmp	al,'0'
143
	jb	edit_box.editbox_exit
142
	jb	edit_box_exit
144
	cmp	al,'9'
143
	cmp	al,'9'
145
	ja	edit_box.editbox_exit
144
	ja	edit_box_exit
146
@@:
145
@@:
147
; restore ascii code
146
; restore ascii code
Line 148... Line 147...
148
	rol	eax,8
147
	rol	eax,8
Line 177... Line 176...
177
	mov	ecx,ed_size
176
	mov	ecx,ed_size
178
	mov	edx, ed_max
177
	mov	edx, ed_max
179
	test	word ed_flags,ed_insert
178
	test	word ed_flags,ed_insert
180
	jne	@f
179
	jne	@f
181
	cmp	ecx,edx
180
	cmp	ecx,edx
182
	jae	edit_box.editbox_exit
181
	jae	edit_box_exit
183
@@:	mov	ebx, ed_pos
182
@@:	mov	ebx, ed_pos
184
	cmp	ebx,edx
183
	cmp	ebx,edx
185
	jnl	edit_box.editbox_exit
184
	jnl	edit_box_exit
186
	mov	ecx,ed_size
185
	mov	ecx,ed_size
187
	push	edi eax
186
	push	edi eax
188
	mov	ebp,edi
187
	mov	ebp,edi
189
	mov	esi,ed_text
188
	mov	esi,ed_text
190
	add	esi,ecx
189
	add	esi,ecx
Line 220... Line 219...
220
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
219
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
221
;Ž¡à ¡®âª  ª« ¢¨è insert,delete,backspace,home,end,left,right
220
;Ž¡à ¡®âª  ª« ¢¨è insert,delete,backspace,home,end,left,right
222
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
221
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
223
edit_box_key.insert:
222
edit_box_key.insert:
224
	xor	word ed_flags,ed_insert
223
	xor	word ed_flags,ed_insert
225
	jmp	edit_box.editbox_exit
224
	jmp	edit_box_exit
Line 226... Line 225...
226
 
225
 
227
edit_box_key.ins_v:
226
edit_box_key.ins_v:
228
	dec	dword bp_size
227
	dec	dword bp_size
229
	sub	esi,ecx
228
	sub	esi,ecx
Line 278... Line 277...
278
	mov	ed_size,ebx
277
	mov	ed_size,ebx
279
	mov	ebp,ed_color
278
	mov	ebp,ed_color
280
	call	edit_box.clear_cursor
279
	call	edit_box.clear_cursor
281
	call	edit_box.check_offset
280
	call	edit_box.check_offset
282
	and	word ed_flags,ed_shift_cl
281
	and	word ed_flags,ed_shift_cl
283
	jmp	edit_box.draw_bg
282
	jmp	edit_box_draw.bg
Line 284... Line 283...
284
 
283
 
285
@@:	dec	dword ed_size
284
@@:	dec	dword ed_size
286
edit_box_key.draw_all2:
285
edit_box_key.draw_all2:
287
	and	word ed_flags,ed_shift_cl
286
	and	word ed_flags,ed_shift_cl
Line 297... Line 296...
297
	test	ebx,ebx
296
	test	ebx,ebx
298
	jz	edit_box_key.sh_st_of
297
	jz	edit_box_key.sh_st_of
299
	or	word ed_flags,ed_left_fl
298
	or	word ed_flags,ed_left_fl
300
	call	edit_box_key.sh_first_sh
299
	call	edit_box_key.sh_first_sh
301
	dec	dword ed_pos
300
	dec	dword ed_pos
302
	call	edit_box.draw_bg
301
	call	edit_box_draw.bg
303
	call	edit_box.draw_shift
302
	call	edit_box_draw.shift
304
	call	edit_box_key.sh_enable
303
	call	edit_box_key.sh_enable
305
	jmp	edit_box.draw_cursor_text
304
	jmp	edit_box_draw.cursor_text
Line 306... Line 305...
306
 
305
 
307
;--- ­ ¦ â  ª« ¢¨è  right ---
306
;--- ­ ¦ â  ª« ¢¨è  right ---
308
edit_box_key.right:
307
edit_box_key.right:
309
	mov	ebx,ed_pos
308
	mov	ebx,ed_pos
310
	cmp	ebx,ed_size
309
	cmp	ebx,ed_size
311
	je	edit_box_key.sh_st_of
310
	je	edit_box_key.sh_st_of
312
	and	word ed_flags,ed_right_fl
311
	and	word ed_flags,ed_right_fl
313
	call	edit_box_key.sh_first_sh
312
	call	edit_box_key.sh_first_sh
314
	inc	dword ed_pos
313
	inc	dword ed_pos
315
	call	edit_box.draw_bg
314
	call	edit_box_draw.bg
316
	call	edit_box.draw_shift
315
	call	edit_box_draw.shift
317
	call	edit_box_key.sh_enable
316
	call	edit_box_key.sh_enable
Line 318... Line 317...
318
	jmp	edit_box.draw_cursor_text
317
	jmp	edit_box_draw.cursor_text
319
 
318
 
320
edit_box_key.home:
319
edit_box_key.home:
321
	mov	ebx,ed_pos
320
	mov	ebx,ed_pos
322
	test	ebx,ebx
321
	test	ebx,ebx
323
	jz	edit_box_key.sh_st_of
322
	jz	edit_box_key.sh_st_of
324
	call	edit_box_key.sh_first_sh
323
	call	edit_box_key.sh_first_sh
325
	xor	eax,eax
324
	xor	eax,eax
326
	mov	ed_pos,eax
325
	mov	ed_pos,eax
327
	call	edit_box.draw_bg
326
	call	edit_box_draw.bg
328
	call	edit_box.draw_shift
327
	call	edit_box_draw.shift
Line 329... Line 328...
329
	call	edit_box_key.sh_home_end
328
	call	edit_box_key.sh_home_end
330
	jmp	edit_box.draw_cursor_text
329
	jmp	edit_box_draw.cursor_text
331
 
330
 
332
;--- ­ ¦ â  ª« ¢¨è  end ---
331
;--- ­ ¦ â  ª« ¢¨è  end ---
333
edit_box_key.end:
332
edit_box_key.end:
334
	mov	ebx,ed_pos
333
	mov	ebx,ed_pos
335
	cmp	ebx,ed_size
334
	cmp	ebx,ed_size
336
	je	edit_box_key.sh_st_of
335
	je	edit_box_key.sh_st_of
337
	call	edit_box_key.sh_first_sh
336
	call	edit_box_key.sh_first_sh
338
	mov	eax,ed_size
337
	mov	eax,ed_size
339
	mov	ed_pos,eax
338
	mov	ed_pos,eax
340
	call	edit_box.draw_bg
339
	call	edit_box_draw.bg
341
	call	edit_box.draw_shift
340
	call	edit_box_draw.shift
342
	call	edit_box_key.sh_home_end
341
	call	edit_box_key.sh_home_end
343
	jmp	edit_box.draw_cursor_text
342
	jmp	edit_box_draw.cursor_text
344
;----------------------------------------
343
;----------------------------------------
345
StrInsert:
344
StrInsert:
Line 410... Line 409...
410
restore SrcCount
409
restore SrcCount
411
restore DstCount
410
restore DstCount
412
;----------------------------------------
411
;----------------------------------------
413
edit_box_key.ctrl_x:
412
edit_box_key.ctrl_x:
414
	test   word ed_flags,ed_shift_on
413
	test   word ed_flags,ed_shift_on
415
	jz     edit_box.editbox_exit
414
	jz     edit_box_exit
416
	push	dword 'X'  ; this value need below to determine which action is used
415
	push	dword 'X'  ; this value need below to determine which action is used
417
	jmp	edit_box_key.ctrl_c.pushed
416
	jmp	edit_box_key.ctrl_c.pushed
Line 418... Line 417...
418
 
417
 
419
edit_box_key.ctrl_c:
418
edit_box_key.ctrl_c:
420
	test   word ed_flags,ed_shift_on
419
	test   word ed_flags,ed_shift_on
421
	jz     edit_box.editbox_exit
420
	jz     edit_box_exit
422
	push	dword 'C'  ; this value need below to determine which action is used
421
	push	dword 'C'  ; this value need below to determine which action is used
423
.pushed:
422
.pushed:
424
; add memory area
423
; add memory area
425
	mov	ecx,ed_size
424
	mov	ecx,ed_size
Line 464... Line 463...
464
	mcall	SF_SYS_MISC,SSF_MEM_FREE
463
	mcall	SF_SYS_MISC,SSF_MEM_FREE
465
.exit:
464
.exit:
466
	pop	eax	   ; determine current action (ctrl+X or ctrl+C)
465
	pop	eax	   ; determine current action (ctrl+X or ctrl+C)
467
	cmp	eax, 'X'
466
	cmp	eax, 'X'
468
	je	edit_box_key.delete
467
	je	edit_box_key.delete
469
	jmp	edit_box.editbox_exit
468
	jmp	edit_box_exit
Line 470... Line 469...
470
 
469
 
471
edit_box_key.ctrl_v:
470
edit_box_key.ctrl_v:
472
	mcall	SF_CLIPBOARD,SSF_GET_SLOT_COUNT
471
	mcall	SF_CLIPBOARD,SSF_GET_SLOT_COUNT
473
; no slots of clipboard ?
472
; no slots of clipboard ?
Line 554... Line 553...
554
.no_valid_text:
553
.no_valid_text:
555
; remove unnecessary memory area
554
; remove unnecessary memory area
556
	mov	ecx,eax
555
	mov	ecx,eax
557
	mcall	SF_SYS_MISC,SSF_MEM_FREE
556
	mcall	SF_SYS_MISC,SSF_MEM_FREE
558
.exit:
557
.exit:
559
	jmp	edit_box.draw_bg_cursor_text
558
	jmp	edit_box_draw.bg_cursor_text
Line 560... Line 559...
560
 
559
 
561
edit_box_key.ctrl_a:
560
edit_box_key.ctrl_a:
562
	mov	eax,ed_size
561
	mov	eax,ed_size
563
	mov	ed_pos,eax
562
	mov	ed_pos,eax
564
	xor	eax,eax
563
	xor	eax,eax
565
	mov	ed_shift_pos,eax
564
	mov	ed_shift_pos,eax
566
	or	word ed_flags,ed_shift_bac+ed_shift_on
565
	or	word ed_flags,ed_shift_bac+ed_shift_on
Line 567... Line 566...
567
	jmp	edit_box.draw_bg_cursor_text
566
	jmp	edit_box_draw.bg_cursor_text
568
 
567
 
569
;==========================================================
568
;==========================================================
570
;=== ®¡à ¡®âª  ¬ëè¨ =======================================
569
;=== ®¡à ¡®âª  ¬ëè¨ =======================================
571
;==========================================================
570
;==========================================================
572
;save for stdcall ebx,esi,edi,ebp
571
;save for stdcall ebx,esi,edi,ebp
573
align 16
572
align 16
574
edit_box_mouse:
573
edit_box_mouse:
575
	pushad
574
	pushad
576
	mov	edi,[esp+36]
575
	mov	edi,[esp+36]
Line 577... Line 576...
577
	test	word ed_flags,ed_disabled
576
	test	word ed_flags,ed_disabled
578
	jnz	edit_box.editbox_exit
577
	jnz	edit_box_exit
579
 
578
 
580
;----------------------------------------------------------
579
;----------------------------------------------------------
Line 588... Line 587...
588
	jnz	edit_box_mouse.mouse_left_button
587
	jnz	edit_box_mouse.mouse_left_button
589
	and	word ed_flags,ed_mouse_on_off
588
	and	word ed_flags,ed_mouse_on_off
590
	mov	ebx,ed_mouse_variable
589
	mov	ebx,ed_mouse_variable
591
	push	0
590
	push	0
592
	pop	dword [ebx]
591
	pop	dword [ebx]
593
	jmp	edit_box.editbox_exit
592
	jmp	edit_box_exit
Line 594... Line 593...
594
 
593
 
595
.mouse_left_button:
594
.mouse_left_button:
596
;----------------------------------------------------------
595
;----------------------------------------------------------
597
;--- ¡«®ª¨à®¢ª  ®â 䮪ãá¨à®¢ª¨ ¢ ¤àã£¨å ¡®ªá å ¯à¨ ¯®¯ ¤ ­¨¨ ­  ­¨å ªãàá®à 
596
;--- ¡«®ª¨à®¢ª  ®â 䮪ãá¨à®¢ª¨ ¢ ¤àã£¨å ¡®ªá å ¯à¨ ¯®¯ ¤ ­¨¨ ­  ­¨å ªãàá®à 
Line 660... Line 659...
660
	mov	ed_pos,eax
659
	mov	ed_pos,eax
661
	mov	ebx,ed_mouse_variable
660
	mov	ebx,ed_mouse_variable
662
	push	edi
661
	push	edi
663
	pop	dword [ebx]
662
	pop	dword [ebx]
664
	bts	word ed_flags,1
663
	bts	word ed_flags,1
665
	call	edit_box.draw_bg
664
	call	edit_box_draw.bg
666
	jmp	edit_box_mouse.m_sh
665
	jmp	edit_box_mouse.m_sh
Line 667... Line 666...
667
 
666
 
668
@@:	cmp	ax,ed_shift_pos
667
@@:	cmp	ax,ed_shift_pos
669
	je	edit_box.editbox_exit
668
	je	edit_box_exit
670
	mov	ed_pos,eax
669
	mov	ed_pos,eax
671
	call	edit_box.draw_bg
670
	call	edit_box_draw.bg
672
	mov	ebp,shift_color
671
	mov	ebp,shift_color
673
	movzx	ebx, word ed_shift_pos
672
	movzx	ebx, word ed_shift_pos
674
	call	edit_box_key.sh_cl_
673
	call	edit_box_key.sh_cl_
675
	or	word ed_flags,ed_mous_adn_b
674
	or	word ed_flags,ed_mous_adn_b
676
edit_box_mouse.m_sh:
675
edit_box_mouse.m_sh:
677
	call	edit_box.draw_text
676
	call	edit_box_draw.text
678
	call	edit_box.draw_cursor
677
	call	edit_box_draw.cursor
679
; ¯à®æ¥¤ãà  ãáâ ­®¢ª¨ 䮪ãá 
678
; ¯à®æ¥¤ãà  ãáâ ­®¢ª¨ 䮪ãá 
Line 680... Line 679...
680
	jmp	edit_box_mouse.drc
679
	jmp	edit_box_mouse.drc
681
	
680
	
682
edit_box_mouse._remove_selection:
681
edit_box_mouse._remove_selection:
Line 683... Line 682...
683
	and	word ed_flags,ed_shift_cl
682
	and	word ed_flags,ed_shift_cl
684
	jmp	edit_box.draw_bg_cursor_text
683
	jmp	edit_box_draw.bg_cursor_text
685
 
684
 
686
edit_box_mouse._blur:
685
edit_box_mouse._blur:
687
	test	word ed_flags,ed_always_focus
686
	test	word ed_flags,ed_always_focus
688
	jne	edit_box_mouse._remove_selection
687
	jne	edit_box_mouse._remove_selection
689
	btr	word ed_flags, bsf ed_focus ;if focused then remove focus, otherwise exit
688
	btr	word ed_flags, bsf ed_focus ;if focused then remove focus, otherwise exit
690
	jnc	edit_box_mouse._remove_selection
689
	jnc	edit_box_mouse._remove_selection
691
	mov	ebp,ed_color
690
	mov	ebp,ed_color
692
	call	edit_box.clear_cursor
691
	call	edit_box.clear_cursor
Line 693... Line 692...
693
edit_box_mouse.drc:
692
edit_box_mouse.drc:
694
	call	edit_box.draw_border
693
	call	edit_box_draw.border
695
	jmp	edit_box_mouse._remove_selection
694
	jmp	edit_box_mouse._remove_selection
696
 
695
 
697
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
696
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
698
;Ž¡é¨¥ ä㭪樨 ®¡à ¡®âª¨
697
;Ž¡é¨¥ ä㭪樨 ®¡à ¡®âª¨
699
;----------------------------------------------------------
698
;----------------------------------------------------------
700
;--- ¯à®æ¥¤ãà  ¯à®à¨á®¢ª¨ ¢ë¤¥«¥­­®© ç á⨠----------------
699
;--- ¯à®æ¥¤ãà  ¯à®à¨á®¢ª¨ ¢ë¤¥«¥­­®© ç á⨠----------------
701
;----------------------------------------------------------
700
;----------------------------------------------------------
702
edit_box.draw_shift:
701
edit_box_draw.shift:
703
	test	word ed_flags,ed_shift_bac ;ãáâ ­®¢ª  ä« £ , ¢ë¤¥«¥­­®© ®¡« áâ¨
702
	test	word ed_flags,ed_shift_bac ;ãáâ ­®¢ª  ä« £ , ¢ë¤¥«¥­­®© ®¡« áâ¨
704
	jz	@f
703
	jz	@f
705
	mov	ebp,shift_color
704
	mov	ebp,shift_color
706
	movzx	ebx, word ed_shift_pos
705
	movzx	ebx, word ed_shift_pos
707
	call	edit_box_key.sh_cl_
706
	call	edit_box_key.sh_cl_
708
@@:	ret
707
@@:	ret
709
;----------------------------------------------------------
708
;----------------------------------------------------------
710
;--- ¯à®æ¥¤ãà  ¯à®à¨á®¢ª¨ ⥪áâ  --------------------------
709
;--- ¯à®æ¥¤ãà  ¯à®à¨á®¢ª¨ ⥪áâ  --------------------------
711
;----------------------------------------------------------
710
;----------------------------------------------------------
712
edit_box.draw_text:
711
edit_box_draw.text:
713
	call	edit_box.get_n
712
	call	edit_box.get_n
Line 749... Line 748...
749
 
748
 
750
txt_pass db '*'
749
txt_pass db '*'
751
;----------------------------------------------------------
750
;----------------------------------------------------------
752
;--- ¯à®æ¥¤ãà  ¯à®à¨á®¢ª¨ ä®­  ----------------------------
751
;--- ¯à®æ¥¤ãà  ¯à®à¨á®¢ª¨ ä®­  ----------------------------
753
;----------------------------------------------------------
752
;----------------------------------------------------------
754
edit_box.draw_bg:
753
edit_box_draw.bg:
755
	mov	ebx,ed_left
754
	mov	ebx,ed_left
756
	inc	ebx
755
	inc	ebx
757
	shl	ebx,16
756
	shl	ebx,16
758
	add	ebx,ed_width
757
	add	ebx,ed_width
759
	dec	ebx
758
	dec	ebx
760
	mov	edx,ed_color
759
	mov	edx,ed_color
761
	test	word ed_flags, ed_disabled
760
	test	word ed_flags, ed_disabled
762
	jz	edit_box.draw_bg_eax
761
	jz	edit_box_draw.bg_eax
763
	mov	edx, 0xCACACA	; TODO: add disabled_color field to editbox struct
762
	mov	edx, 0xCACACA	; TODO: add disabled_color field to editbox struct
764
edit_box.draw_bg_eax:
763
edit_box_draw.bg_eax:
765
	mov	ecx,ed_top
764
	mov	ecx,ed_top
766
	inc	ecx
765
	inc	ecx
767
	shl	ecx,16
766
	shl	ecx,16
768
	add	ecx,ed_height
767
	add	ecx,ed_height
Line 794... Line 793...
794
	cmp	ebx, ed_left ;¯®¯ ¤ ¥â «¨ ªãàá®à ⥪á⮢®¥ ¯®«¥?
793
	cmp	ebx, ed_left ;¯®¯ ¤ ¥â «¨ ªãàá®à ⥪á⮢®¥ ¯®«¥?
795
	jle	@f
794
	jle	@f
796
	mov	edx, ebp
795
	mov	edx, ebp
797
	movzx	ecx, word cl_curs_y
796
	movzx	ecx, word cl_curs_y
798
	cmp	ecx, ed_top
797
	cmp	ecx, ed_top
799
	jg	edit_box.draw_curs
798
	jg	edit_box_draw.curs
800
@@:
799
@@:
801
	ret
800
	ret
Line 802... Line 801...
802
 
801
 
803
edit_box.draw_cursor:
802
edit_box_draw.cursor:
804
	mov	edx, ed_text_color
803
	mov	edx, ed_text_color
805
	mov	eax, ed_pos
804
	mov	eax, ed_pos
806
	sub	eax, ed_offset
805
	sub	eax, ed_offset
807
	mul	dword ed_char_width
806
	mul	dword ed_char_width
Line 810... Line 809...
810
	inc	ebx
809
	inc	ebx
811
	mov	ecx, ed_top
810
	mov	ecx, ed_top
812
	add	ecx, 2
811
	add	ecx, 2
813
	mov	cl_curs_x, bx
812
	mov	cl_curs_x, bx
814
	mov	cl_curs_y, cx
813
	mov	cl_curs_y, cx
815
edit_box.draw_curs:
814
edit_box_draw.curs:
816
	mov	eax, ebx
815
	mov	eax, ebx
817
	shl	ebx, 16
816
	shl	ebx, 16
818
	or	ebx, eax
817
	or	ebx, eax
819
	mov	eax, ecx
818
	mov	eax, ecx
820
	shl	ecx, 16
819
	shl	ecx, 16
Line 825... Line 824...
825
	ret
824
	ret
Line 826... Line 825...
826
 
825
 
827
;----------------------------------------------------------
826
;----------------------------------------------------------
828
;--- ¯à®æ¥¤ãà  à¨á®¢ ­¨ï à ¬ª¨ ----------------------------
827
;--- ¯à®æ¥¤ãà  à¨á®¢ ­¨ï à ¬ª¨ ----------------------------
829
;----------------------------------------------------------
828
;----------------------------------------------------------
830
edit_box.draw_border:
829
edit_box_draw.border:
831
	test	word ed_flags,ed_focus
830
	test	word ed_flags,ed_focus
832
	mov	edx,ed_focus_border_color
831
	mov	edx,ed_focus_border_color
833
	jne	@f
832
	jne	@f
834
	mov	edx,ed_blur_border_color
833
	mov	edx,ed_blur_border_color
Line 914... Line 913...
914
 
913
 
915
edit_box.add_8:
914
edit_box.add_8:
916
	add	ebx,edx
915
	add	ebx,edx
917
edit_box.chk_d:
916
edit_box.chk_d:
918
	mov	ed_offset,ebx
917
	mov	ed_offset,ebx
919
	call	edit_box.draw_bg
918
	call	edit_box_draw.bg
920
	and	word ed_flags,ed_offset_cl
919
	and	word ed_flags,ed_offset_cl
921
	popad
920
	popad
Line 922... Line 921...
922
	ret
921
	ret
Line 950... Line 949...
950
;”㭪樨 ¤«ï à ¡®âë á key
949
;”㭪樨 ¤«ï à ¡®âë á key
951
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
950
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 952... Line 951...
952
 
951
 
953
;Ž¡à ¡®âª  Shift ¤«ï á­ïâ¨ï ¢ë¤¥«¥­¨ï ­¥¨§¢¥áâ­®© ®¡« áâ¨
952
;Ž¡à ¡®âª  Shift ¤«ï á­ïâ¨ï ¢ë¤¥«¥­¨ï ­¥¨§¢¥áâ­®© ®¡« áâ¨
954
edit_box_key.shift:
953
edit_box_key.shift:
955
	call	edit_box.draw_bg
954
	call	edit_box_draw.bg
956
	test	word ed_flags,ed_shift
955
	test	word ed_flags,ed_shift
957
	je	edit_box_key.f_exit
956
	je	edit_box_key.f_exit
958
	mov	ebp,shift_color
957
	mov	ebp,shift_color
959
	or	word ed_flags,ed_shift_bac ;ãáâ ­®¢ª  ä« £ , ¢ë¤¥«¥­­®© ®¡« áâ¨
958
	or	word ed_flags,ed_shift_bac ;ãáâ ­®¢ª  ä« £ , ¢ë¤¥«¥­­®© ®¡« áâ¨
960
	movzx	ebx, word ed_shift_pos
959
	movzx	ebx, word ed_shift_pos
961
	call	edit_box_key.sh_cl_
960
	call	edit_box_key.sh_cl_
Line 962... Line 961...
962
	jmp	edit_box.draw_cursor_text
961
	jmp	edit_box_draw.cursor_text
963
 
962
 
964
edit_box_key.f_exit:
963
edit_box_key.f_exit:
965
	call	edit_box.check_offset
964
	call	edit_box.check_offset
966
	and	word ed_flags,ed_shift_cl
965
	and	word ed_flags,ed_shift_cl
Line 967... Line 966...
967
	call	edit_box_key.enable_null
966
	call	edit_box_key.enable_null
968
	jmp	edit_box.draw_cursor_text
967
	jmp	edit_box_draw.cursor_text
969
 
968
 
970
edit_box_key.sh_cl_:
969
edit_box_key.sh_cl_:
Line 1018... Line 1017...
1018
	inc	ebx
1017
	inc	ebx
1019
	shl	ebx,16
1018
	shl	ebx,16
1020
	inc	eax
1019
	inc	eax
1021
	mov	bx, ax
1020
	mov	bx, ax
1022
	mov	edx,ebp ;shift_color
1021
	mov	edx,ebp ;shift_color
1023
	call	edit_box.draw_bg_eax
1022
	call	edit_box_draw.bg_eax
1024
	jmp	edit_box_key.enable_null
1023
	jmp	edit_box_key.enable_null
Line 1025... Line 1024...
1025
 
1024
 
1026
;“áâ ­®¢ª - á­ï⨥ ¢ë¤¥«¥­¨ï ¢ ®¤¨­ ᨬ¢®«
1025
;“áâ ­®¢ª - á­ï⨥ ¢ë¤¥«¥­¨ï ¢ ®¤¨­ ᨬ¢®«
1027
edit_box_key.drw_sim:
1026
edit_box_key.drw_sim:
Line 1068... Line 1067...
1068
edit_box_key.sh_st_of:
1067
edit_box_key.sh_st_of:
1069
	test	word ed_flags,ed_shift
1068
	test	word ed_flags,ed_shift
1070
	jne	@f
1069
	jne	@f
1071
	test	word ed_flags,ed_shift_bac
1070
	test	word ed_flags,ed_shift_bac
1072
	je	@f
1071
	je	@f
1073
	call	edit_box.draw_bg
1072
	call	edit_box_draw.bg
1074
	mov	ebp,ed_color
1073
	mov	ebp,ed_color
1075
	movzx	ebx, word ed_shift_pos
1074
	movzx	ebx, word ed_shift_pos
1076
	call	edit_box_key.sh_cl_  ;®ç¨á⪠ ¢ë¤¥«¥­®£® äà £¬¥­â 
1075
	call	edit_box_key.sh_cl_  ;®ç¨á⪠ ¢ë¤¥«¥­®£® äà £¬¥­â 
1077
	and	word ed_flags,ed_shift_cl ; ®ç¨á⪠ ®â ⮣®, çâ® ã¡à «¨ ¢ë¤¥«¥­¨¥
1076
	and	word ed_flags,ed_shift_cl ; ®ç¨á⪠ ®â ⮣®, çâ® ã¡à «¨ ¢ë¤¥«¥­¨¥
1078
	jmp	edit_box.draw_cursor_text
1077
	jmp	edit_box_draw.cursor_text
Line 1079... Line 1078...
1079
 
1078
 
1080
@@:	and	word ed_flags,ed_shift_off
1079
@@:	and	word ed_flags,ed_shift_off
1081
	popad
1080
	popad
1082
	ret	4
1081
	ret	4
Line 1148... Line 1147...
1148
	call	edit_box_key.sh_cl_
1147
	call	edit_box_key.sh_cl_
1149
	or	word ed_flags,ed_shift_bac ;ãáâ ­®¢ª  ä« £ , ¢ë¤¥«¥­­®© ®¡« áâ¨
1148
	or	word ed_flags,ed_shift_bac ;ãáâ ­®¢ª  ä« £ , ¢ë¤¥«¥­­®© ®¡« áâ¨
1150
	jmp	edit_box_key.sh_e_end
1149
	jmp	edit_box_key.sh_e_end
Line 1151... Line 1150...
1151
 
1150
 
1152
edit_box_key.sh_exit_:
1151
edit_box_key.sh_exit_:
1153
	call	edit_box.draw_bg
1152
	call	edit_box_draw.bg
Line 1154... Line 1153...
1154
	jmp	edit_box.check_offset
1153
	jmp	edit_box.check_offset
1155
 
1154
 
1156
;äã­ªæ¨ï ¢­¥á¥­¨ï 0 ¯®  ¤à¥áã ed_size+1
1155
;äã­ªæ¨ï ¢­¥á¥­¨ï 0 ¯®  ¤à¥áã ed_size+1
Line 1246... Line 1245...
1246
	inc	ebx
1245
	inc	ebx
1247
	shl	ebx,16
1246
	shl	ebx,16
1248
	inc	eax
1247
	inc	eax
1249
	mov	bx, ax
1248
	mov	bx, ax
1250
	mov	edx,ed_color
1249
	mov	edx,ed_color
1251
	jmp	edit_box.draw_bg_eax
1250
	jmp	edit_box_draw.bg_eax
Line 1252... Line 1251...
1252
 
1251
 
1253
;;;;;;;;;;;;;;;;;;;
1252
;;;;;;;;;;;;;;;;;;;
1254
;;; Ž¡à ¡®âª  ¯à¨¬¨â¨¢®¢
1253
;;; Ž¡à ¡®âª  ¯à¨¬¨â¨¢®¢
1255
;;;;;;;;;;;;;;;;;;;;
1254
;;;;;;;;;;;;;;;;;;;;
Line 1264... Line 1263...
1264
	inc	eax
1263
	inc	eax
1265
	shl	eax,16
1264
	shl	eax,16
1266
	add	eax,ed_char_width
1265
	add	eax,ed_char_width
1267
	mov	ebx,eax
1266
	mov	ebx,eax
1268
	mov	edx,ebp
1267
	mov	edx,ebp
1269
	jmp	edit_box.draw_bg_eax
1268
	jmp	edit_box_draw.bg_eax
Line 1270... Line 1269...
1270
 
1269
 
1271
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1270
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1272
;”㭪樨 ¤«ï à ¡®âë á mouse
1271
;”㭪樨 ¤«ï à ¡®âë á mouse
1273
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1272
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1274
edit_box_mouse.mouse_wigwag:
1273
edit_box_mouse.mouse_wigwag:
1275
	push	eax
1274
	push	eax
1276
	call	edit_box.draw_bg
1275
	call	edit_box_draw.bg
1277
	call	edit_box.draw_shift
1276
	call	edit_box_draw.shift
1278
	pop	eax
1277
	pop	eax
1279
	or	word ed_flags,ed_shift_bac+ed_shift_on+ed_shift
1278
	or	word ed_flags,ed_shift_bac+ed_shift_on+ed_shift
1280
;Ž¡à ¡®âª  ¯®«®¦¥­¨ï ¢ë¤¥«¥­­®£® ⥪áâ , ª®£¤  ¯à®¨á室¨â ¢ë室 §  ¯à¥¤¥«ë editbox
1279
;Ž¡à ¡®âª  ¯®«®¦¥­¨ï ¢ë¤¥«¥­­®£® ⥪áâ , ª®£¤  ¯à®¨á室¨â ¢ë室 §  ¯à¥¤¥«ë editbox
1281
	test	eax,eax
1280
	test	eax,eax
Line 1321... Line 1320...
1321
	mov	ebp,shift_color
1320
	mov	ebp,shift_color
1322
	mov	ebx,ecx
1321
	mov	ebx,ecx
1323
	call	edit_box_key.sh_cl_
1322
	call	edit_box_key.sh_cl_
1324
edit_box_mouse.mwigvag:
1323
edit_box_mouse.mwigvag:
1325
	and	word ed_flags,ed_shift_mcl
1324
	and	word ed_flags,ed_shift_mcl
1326
	jmp	edit_box.draw_cursor_text
1325
	jmp	edit_box_draw.cursor_text
Line 1327... Line 1326...
1327
 
1326
 
1328
edit_box_mouse.mleft:
1327
edit_box_mouse.mleft:
1329
	mov	eax,ed_pos
1328
	mov	eax,ed_pos
1330
	cmp	eax,0
1329
	cmp	eax,0