Subversion Repositories Kolibri OS

Rev

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

Rev 7906 Rev 7919
Line 1... Line -...
1
macro use_key_no_process  up,down,esc,enter,tab,numl,capsl,scrolll,pgup,pgdown
-
 
2
{
-
 
3
if up eq
-
 
4
else
-
 
5
        cmp     ah,178
-
 
6
        jz      edit_box.editbox_exit
-
 
7
end if
-
 
8
if down eq
-
 
9
else
-
 
10
        cmp     ah,177
-
 
11
        jz      edit_box.editbox_exit
-
 
12
end if
-
 
13
if esc eq
-
 
14
else
-
 
15
        cmp     ah,27   ;ESC - ª« ¢¨è  ))
-
 
16
        jz      edit_box.editbox_exit
-
 
17
end if
-
 
18
if enter eq
-
 
19
else
-
 
20
        cmp     ah,13   ;ENTER - ª« ¢¨è  ))
-
 
21
        jz      edit_box.editbox_exit
-
 
22
end if
-
 
23
if tab eq
-
 
24
else
-
 
25
        cmp     ah,9   ;TAB - ª« ¢¨è  ))
-
 
26
        jz      edit_box.editbox_exit
-
 
27
end if
-
 
28
if numl eq
-
 
29
else
-
 
30
        cmp     ah,4   ;Num Lock - ª« ¢¨è  ))
-
 
31
        jz      edit_box.editbox_exit
-
 
32
end if
-
 
33
if capsl eq
-
 
34
else
-
 
35
        cmp     ah,2   ;Caps Lock - ª« ¢¨è  ))
-
 
36
        jz      edit_box.editbox_exit
-
 
37
end if
-
 
38
if scrolll eq
-
 
39
else
-
 
40
        cmp     ah,1   ;Scroll Lock - ª« ¢¨è  ))
-
 
41
        jz      edit_box.editbox_exit
-
 
42
end if
-
 
43
if pgup eq
-
 
44
else
-
 
45
        cmp     ah,184 ;Page Up - ª« ¢¨è  ))
-
 
46
        jz      edit_box.editbox_exit
-
 
47
end if
-
 
48
if pgdown eq
-
 
49
else
-
 
50
        cmp     ah,183 ;Page Dwon - ª« ¢¨è  ))
-
 
51
        jz      edit_box.editbox_exit
-
 
52
end if
-
 
53
}
-
 
54
 
-
 
55
SCAN_LWIN_RELEASE = 0xDB
1
SCAN_LWIN_RELEASE = 0xDB
56
SCAN_RWIN_RELEASE = 0xDC
2
SCAN_RWIN_RELEASE = 0xDC
Line 57... Line 3...
57
 
3
 
58
align 16
4
align 16
Line 81... Line 27...
81
        add     eax,4
27
	add	eax,4
82
        mov     ed_height,eax
28
	mov	ed_height,eax
83
        call    .draw_border
29
	call	.draw_border
84
.draw_bg_cursor_text:
30
.draw_bg_cursor_text:
85
        ;test   word ed_flags,ed_focus ; for unfocused controls =>
31
	;test    word ed_flags,ed_focus ; for unfocused controls =>
86
        ;jz     .sjip_offset           ; do not recalculate offset (big OS behaviour)
32
	;jz      .skip_offset           ; do not recalculate offset
87
        call    .check_offset
33
	call	.check_offset
88
;.sjip_offset:
34
;.skip_offset:
89
        call    .draw_bg
35
	call	.draw_bg
90
        test    word ed_flags,ed_focus ; for unfocused controls =>
36
	test	word ed_flags,ed_focus ; do not draw selection(named shift)
91
        jz      .draw_cursor_text      ; do not draw selection(named shift)
37
	jz	.draw_cursor_text      ;
92
        call    .draw_shift
38
	call	.draw_shift
93
.draw_cursor_text:
39
.draw_cursor_text:
94
        call    .draw_text
40
	call	.draw_text
95
        test    word ed_flags,ed_focus ; and dosn`t draw cursor
41
	test	word ed_flags,ed_focus ; and dosn`t draw cursor
96
        jz      .editbox_exit
42
	jz	.editbox_exit
Line 114... Line 60...
114
        test    word ed_flags,ed_mouse_on or ed_disabled
60
	test	word ed_flags,ed_mouse_on or ed_disabled
115
        jnz     edit_box.editbox_exit
61
	jnz	edit_box.editbox_exit
116
;--------------------------------------
62
;--------------------------------------
117
; this code for Win-keys, works with
63
; this code for Win-keys, works with
118
; kernel SVN r.3356 or later
64
; kernel SVN r.3356 or later
119
        push    eax
-
 
120
        push    ebx
-
 
121
        mcall   SF_KEYBOARD,SSF_GET_CONTROL_KEYS
65
	mcall	SF_KEYBOARD,SSF_GET_CONTROL_KEYS
122
        test    ax,0x200        ; LWin
-
 
123
        jnz     .win_key_pressed
-
 
124
        test    ax,0x400        ; RWin
66
	test	ah,$06	      ; LWin ($02) & RWin ($04)
125
        jz      @f
-
 
126
.win_key_pressed:
-
 
127
        pop     ebx
-
 
128
        pop     eax
-
 
129
        jmp     edit_box.editbox_exit
67
	jnz	edit_box.editbox_exit
130
 
-
 
131
@@:     pop     ebx
-
 
132
        pop     eax
-
 
133
;--------------------------------------
68
;--------------------------------------
134
;à®¢¥àª  ­ ¦ â shift ?
69
;à®¢¥àª  ­ ¦ â shift ?
-
 
70
	test	al,$03
-
 
71
	je	@f
-
 
72
	or	word ed_flags,ed_shift	 ;ãáâ ­®¢¨¬ ä« £ Shift
-
 
73
@@:
-
 
74
	and	word ed_flags,ed_ctrl_off ; ®ç¨á⨬ ä« £ Ctrl
-
 
75
	test	al,$0C
-
 
76
	je	@f
-
 
77
	or	word ed_flags,ed_ctrl_on   ;ãáâ ­®¢¨¬ ä« £ Ctrl
-
 
78
@@:
135
        call    edit_box_key.check_shift_ctrl_alt
79
	and	word ed_flags,ed_alt_off ; ®ç¨á⨬ ä« £ Alt
-
 
80
	test	al,$30
-
 
81
	je	@f
-
 
82
	or	word ed_flags,ed_alt_on   ;ãáâ ­®¢¨¬ ä« £ Alt
-
 
83
@@:
136
;----------------------------------------------------------
84
;----------------------------------------------------------
137
;--- ¯à®¢¥à塞, çâ® ­ ¦ â® --------------------------------
85
;--- ¯à®¢¥à塞, çâ® ­ ¦ â® --------------------------------
138
;----------------------------------------------------------
86
;----------------------------------------------------------
139
        cmp     ah,8
87
	mov	eax,[esp+28]
140
        jz      edit_box_key.backspace
-
 
141
        cmp     ah,0xb6
-
 
142
        jz      edit_box_key.delete
-
 
143
        cmp     ah,176
-
 
144
        jz      edit_box_key.left
-
 
145
        cmp     ah,179
-
 
146
        jz      edit_box_key.right
-
 
147
        cmp     ah,180
-
 
148
        jz      edit_box_key.home
-
 
149
        cmp     ah,181
-
 
150
        jz      edit_box_key.end
-
 
151
        cmp     ah,185  ;insert
-
 
152
        jz      edit_box_key.insert
-
 
153
 
-
 
154
; get scancode in ah
88
; get scancode in ah
155
        ror     eax,8
89
	ror	eax,8
156
; check for ctrl+ combinations
90
; check for ctrl+ combinations
157
        test    word ed_flags,ed_ctrl_on
91
	test	word ed_flags,ed_ctrl_on
158
        jz      @f
92
	jz	@f
159
        cmp     ah,45 ; Ctrl + X
93
	cmp	ah,SCAN_CODE_X ; Ctrl + X
160
        je      edit_box_key.ctrl_x
94
	je	edit_box_key.ctrl_x
161
        cmp     ah,46 ; Ctrl + C
95
	cmp	ah,SCAN_CODE_C ; Ctrl + C
162
        je      edit_box_key.ctrl_c
96
	je	edit_box_key.ctrl_c
163
        cmp     ah,47 ; Ctrl + V
97
	cmp	ah,SCAN_CODE_V ; Ctrl + V
164
        je      edit_box_key.ctrl_v
98
	je	edit_box_key.ctrl_v
165
        cmp     ah,30 ; Ctrl + A
99
	cmp	ah,SCAN_CODE_A ; Ctrl + A
166
        je      edit_box_key.ctrl_a
100
	je	edit_box_key.ctrl_a
-
 
101
	jmp	edit_box.editbox_exit
167
@@:
102
@@:
-
 
103
	cmp	ah,SCAN_CODE_SPACE
-
 
104
	ja	@F
-
 
105
	cmp	al,ASCII_KEY_BACK
-
 
106
	jz	edit_box_key.backspace
168
        cmp     ah,SCAN_LWIN_RELEASE
107
	cmp	ah,SCAN_CODE_ESCAPE
169
        jz      edit_box.editbox_exit
108
	jz	edit_box.editbox_exit
170
        cmp     ah,SCAN_RWIN_RELEASE
109
	cmp	ah,SCAN_CODE_TAB
171
        jz      edit_box.editbox_exit
110
	jz	edit_box.editbox_exit
-
 
111
	cmp	ah,SCAN_CODE_RETURN
172
; restore ascii code
112
	jz	edit_box.editbox_exit
173
        rol     eax,8
113
	jmp	.printable_character
-
 
114
@@:
-
 
115
	cmp	ah,SCAN_CODE_DELETE
174
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
116
	ja	edit_box.editbox_exit
-
 
117
	cmp	ah,SCAN_CODE_HOME
175
;‡ £«ã誠 ­  ®¡à ¡®âªã ª« ¢¨è ¢¢¥àå ¨ ¢­¨§ â.¥. ¯à¨ ®¡­ à㦥­¨¨
118
	jb	edit_box.editbox_exit
176
;íâ¨å ª®¤®¢ ¯à®¨á室¨â ¢ë室 ¨§ ®¡à ¡®â稪 
119
	cmp	ax,SCAN_CODE_CLEAR shl 8 + ASCII_KEY_CLEAR ; not operate numpad unlocked 5
177
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
120
	jz	edit_box.editbox_exit
178
use_key_no_process   up,down,esc,enter,tab,numl,capsl,scrolll,pgup,pgdown
121
;here best place to filter up,down,pgup,pgdown
-
 
122
	cmp	al,ASCII_KEY_LEFT
-
 
123
	jb	.printable_character
-
 
124
	and	eax,$F
-
 
125
	mov	ebx,.unlock_numpad_filtration
-
 
126
	jmp	dword[ebx+eax*4]
-
 
127
      .unlock_numpad_filtration       \
179
;--- ­ ¦ â  ¤àã£ ï ª« ¢¨è  ---
128
	     dd edit_box_key.left,    \ ; LEFT
-
 
129
		edit_box.editbox_exit,\ ; DOWN
180
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
130
		edit_box.editbox_exit,\ ; UP
-
 
131
		edit_box_key.right,   \ ; RIGHT
181
;à®¢¥àª  ãáâ ­®¢«¥­ «¨ ä« £ ¯à¨ ª®â®à®¬ ­ã¦­® ¢ë¢®¤¨âì 
132
		edit_box_key.home,    \ ; HOME
-
 
133
		edit_box_key.end,     \ ; END
182
;⮫쪮 æ¨äàë ¢ ­ã¦­®¬ ¡®ªá¥
134
		edit_box_key.delete,  \ ; DELETE
-
 
135
		edit_box.editbox_exit,\ ; PGDN
-
 
136
		edit_box.editbox_exit,\ ; PGUP
183
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
137
		edit_box_key.insert	; INSERT
-
 
138
 
-
 
139
.printable_character:
184
        test    word ed_flags,ed_figure_only  ; ⮫쪮 æ¨äàë?
140
	test	word ed_flags,ed_figure_only  ; ⮫쪮 æ¨äàë?
185
        jz      @f
141
	jz	@f
186
        cmp     ah,'0'
142
	cmp	al,'0'
187
        jb      edit_box.editbox_exit
143
	jb	edit_box.editbox_exit
188
        cmp     ah,'9'
144
	cmp	al,'9'
189
        ja      edit_box.editbox_exit
145
	ja	edit_box.editbox_exit
190
@@:
146
@@:
-
 
147
; restore ascii code
-
 
148
	rol	eax,8
Line 191... Line 149...
191
 
149
 
192
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
150
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
193
;¯à®¢¥àª  ­  shift, ¡ë« «¨ ­ ¦ â
151
;¯à®¢¥àª  ­  shift, ¡ë« «¨ ­ ¦ â
194
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
152
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 261... Line 219...
261
 
219
 
262
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
220
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
263
;Ž¡à ¡®âª  ª« ¢¨è insert,delete,backspace,home,end,left,right
221
;Ž¡à ¡®âª  ª« ¢¨è insert,delete,backspace,home,end,left,right
264
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
222
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
265
edit_box_key.insert:
-
 
266
        test    word ed_flags,ed_insert
-
 
267
        je      @f
-
 
268
        and     word ed_flags,ed_insert_cl
-
 
269
        jmp     edit_box.editbox_exit
-
 
270
 
223
edit_box_key.insert:
271
@@:     or      word ed_flags,ed_insert
224
	xor	word ed_flags,ed_insert
Line 272... Line 225...
272
        jmp     edit_box.editbox_exit
225
	jmp	edit_box.editbox_exit
273
 
226
 
274
edit_box_key.ins_v:
227
edit_box_key.ins_v:
Line 872... Line 825...
872
        test    word ed_flags,ed_focus
825
	test	word ed_flags,ed_focus
873
        mov     edx,ed_focus_border_color
826
	mov	edx,ed_focus_border_color
874
        jne     @f
827
	jne	@f
875
        mov     edx,ed_blur_border_color
828
	mov	edx,ed_blur_border_color
876
@@:
829
@@:
-
 
830
       ;mov     edx,$808080
877
        mov     ebx,ed_left
831
	mov	ebx,ed_left
878
        mov     ecx,ebx
832
	mov	eax,ebx
879
        shl     ebx,16
833
	shl	ebx,16
880
        add     ebx,ecx
834
	add	ebx,eax
881
        add     ebx,ed_width
835
	;add     ebx,ed_width
882
        mov     ecx,ed_top
836
	mov	ecx,ed_top
883
        mov     esi,ecx
837
	mov	eax,ecx
884
        shl     ecx,16
838
	shl	ecx,16
885
        add     ecx,esi
839
	add	ecx,eax
886
        mcall   SF_DRAW_LINE ; top
-
 
887
        mov     esi,ecx
840
	push	ecx
888
        inc     ecx
841
	inc	ecx
889
        add     ecx,ed_height
842
	add	ecx,ed_height
890
        mov     ebp,ecx
843
	mcall	SF_DRAW_LINE ; left
891
        shl     ecx,16
844
	xchg	ecx,[esp]
892
        mov     cx,bp
845
	add	ebx,ed_width
893
        mcall   ; bottom
846
	mcall		     ; top
894
        mov     cx,si
847
       ;or      edx,-1
895
        mov     ebp,ebx
848
	pop	ecx
896
        sub     ebx,ed_width
849
	push	cx
897
        mcall   ; left
850
	push	cx
898
        mov     ebx,ebp
851
	push	ebx
-
 
852
	push	bx
899
        shl     ebx,16
853
	push	bx
900
        mov     bx,bp
854
	pop	ebx
901
        mcall   ; right
855
	mcall		     ; right
-
 
856
	pop	ebx
-
 
857
	pop	ecx
-
 
858
	mcall		     ; bottom
902
        ret
859
	ret
Line 903... Line 860...
903
 
860
 
904
;----------------------------------------------------------
861
;----------------------------------------------------------
905
;--- ¯à®¢¥àª , § è¥« «¨ ªãàá®à §  £à ­¨æë ¨, ¥á«¨ ­ ¤®, ---
862
;--- ¯à®¢¥àª , § è¥« «¨ ªãàá®à §  £à ­¨æë ¨, ¥á«¨ ­ ¤®, ---
Line 1306... Line 1263...
1306
        add     eax,ed_char_width
1263
	add	eax,ed_char_width
1307
        mov     ebx,eax
1264
	mov	ebx,eax
1308
        mov     edx,ebp
1265
	mov	edx,ebp
1309
        jmp     edit_box.draw_bg_eax
1266
	jmp	edit_box.draw_bg_eax
Line 1310... Line -...
1310
 
-
 
1311
;;;;;;;;;;;;;;;;;;
-
 
1312
;;à®¢¥àª  ­ ¦ â «¨ shift
-
 
1313
;;;;;;;;;;;;;;;;;;
-
 
1314
edit_box_key.check_shift_ctrl_alt:
-
 
1315
        pusha
-
 
1316
        mcall   SF_KEYBOARD,SSF_GET_CONTROL_KEYS
-
 
1317
        test    al,11b
-
 
1318
        je      @f
-
 
1319
        or      word ed_flags,ed_shift   ;ãáâ ­®¢¨¬ ä« £ Shift
-
 
1320
@@:
-
 
1321
        and     word ed_flags,ed_ctrl_off ; ®ç¨á⨬ ä« £ Ctrl
-
 
1322
        test    al,1100b
-
 
1323
        je      @f
-
 
1324
        or      word ed_flags,ed_ctrl_on   ;ãáâ ­®¢¨¬ ä« £ Ctrl
-
 
1325
@@:
-
 
1326
        and     word ed_flags,ed_alt_off ; ®ç¨á⨬ ä« £ Alt
-
 
1327
        test    al,110000b
-
 
1328
        je      @f
-
 
1329
        or      word ed_flags,ed_alt_on   ;ãáâ ­®¢¨¬ ä« £ Alt
-
 
1330
@@:
-
 
1331
        popad
-
 
1332
        ret
-
 
1333
 
1267
 
1334
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1268
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1335
;”㭪樨 ¤«ï à ¡®âë á mouse
1269
;”㭪樨 ¤«ï à ¡®âë á mouse
1336
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1270
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1337
edit_box_mouse.mouse_wigwag:
1271
edit_box_mouse.mouse_wigwag: