Subversion Repositories Kolibri OS

Rev

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

Rev 6677 Rev 6705
Line 205... Line 205...
205
;----------------------------------------------------------
205
;----------------------------------------------------------
206
edit_box.draw_shift:
206
edit_box.draw_shift:
207
        test    word ed_flags,ed_shift_bac ;ãáâ ­®¢ª  ä« £ , ¢ë¤¥«¥­­®© ®¡« áâ¨
207
        test    word ed_flags,ed_shift_bac ;ãáâ ­®¢ª  ä« £ , ¢ë¤¥«¥­­®© ®¡« áâ¨
208
        jz      @f
208
        jz      @f
209
        mov     ebp,shift_color
209
        mov     ebp,shift_color
210
        mov     ebx,ed_shift_pos
210
        movzx   ebx, word ed_shift_pos
211
        call    edit_box_key.sh_cl_
211
        call    edit_box_key.sh_cl_
212
@@:     ret
212
@@:     ret
213
;----------------------------------------------------------
213
;----------------------------------------------------------
214
;--- ¯à®æ¥¤ãà  ¯à®à¨á®¢ª¨ ⥪áâ  --------------------------
214
;--- ¯à®æ¥¤ãà  ¯à®à¨á®¢ª¨ ⥪áâ  --------------------------
215
;----------------------------------------------------------
215
;----------------------------------------------------------
Line 282... Line 282...
282
        xor     edx,edx
282
        xor     edx,edx
283
        div     word ed_char_width
283
        div     word ed_char_width
284
        ret
284
        ret
Line 285... Line 285...
285
 
285
 
286
;----------------------------------------------------------
286
;----------------------------------------------------------
287
;--- ¯à®æ¥¤ãà  à¨á®¢ ­¨ï ªãàá®à  --------------------------
287
;------------------ Draw Cursor Procedure -----------------
288
;----------------------------------------------------------
288
;----------------------------------------------------------
289
;¢å®¤­ë¥ ebp- 梥â
289
; in: ebp = Color
290
edit_box.clear_cursor:
290
edit_box.clear_cursor:
291
        mov     edx,ebp
291
        mov     edx, ebp
292
        mov     ebx,cl_curs_x
292
        movzx   ebx, word cl_curs_x
293
        mov     ecx,cl_curs_y
293
        movzx   ecx, word cl_curs_y   
Line 294... Line 294...
294
        jmp     edit_box.draw_curs
294
        jmp     edit_box.draw_curs
-
 
295
 
295
 
296
edit_box.draw_cursor:
296
edit_box.draw_cursor:
297
        mov     edx, ed_text_color          
297
        mov     eax,ed_pos
298
        mov     eax, ed_pos
298
        sub     eax,ed_offset
299
        sub     eax, ed_offset
299
        mul     dword ed_char_width
300
        mul     dword ed_char_width        
300
        mov     ebx,eax
301
        mov     ebx, eax
301
        add     ebx,ed_left
-
 
302
        inc     ebx
-
 
303
        mov     edx,ebx
-
 
304
        shl     ebx,16
302
        add     ebx, ed_left
305
        add     ebx,edx
303
        inc     ebx    
-
 
304
        mov     ecx, ed_top
-
 
305
        add     ecx, 2        
-
 
306
        mov     cl_curs_x, bx
-
 
307
        mov     cl_curs_y, cx
-
 
308
edit_box.draw_curs:        
-
 
309
        mov     eax, ebx        
306
        mov     ecx,ed_top
310
        shl     ebx, 16
307
        add     ecx,2
311
        or      ebx, eax
308
        mov     edx,ecx
312
        mov     eax, ecx                     
309
        shl     ecx,16
313
        shl     ecx, 16
310
        add     ecx,edx
314
        or      ecx, eax
311
        add     ecx,ed_height
-
 
312
        sub     ecx,3
-
 
313
        mov     cl_curs_x,ebx
-
 
314
        mov     cl_curs_y,ecx
-
 
315
        mov     edx,ed_text_color
315
        add     ecx, ed_height
316
edit_box.draw_curs:
316
        sub     ecx, 3
Line 317... Line 317...
317
        mcall   38
317
        mcall   38
318
        ret
318
        ret
Line 442... Line 442...
442
        call    edit_box.draw_bg
442
        call    edit_box.draw_bg
443
        test    word ed_flags,ed_shift
443
        test    word ed_flags,ed_shift
444
        je      edit_box_key.f_exit
444
        je      edit_box_key.f_exit
445
        mov     ebp,shift_color
445
        mov     ebp,shift_color
446
        or      word ed_flags,ed_shift_bac ;ãáâ ­®¢ª  ä« £ , ¢ë¤¥«¥­­®© ®¡« áâ¨
446
        or      word ed_flags,ed_shift_bac ;ãáâ ­®¢ª  ä« £ , ¢ë¤¥«¥­­®© ®¡« áâ¨
447
        mov     ebx,ed_shift_pos
447
        movzx   ebx, word ed_shift_pos
448
        call    edit_box_key.sh_cl_
448
        call    edit_box_key.sh_cl_
449
        jmp     edit_box.draw_cursor_text
449
        jmp     edit_box.draw_cursor_text
Line 450... Line 450...
450
 
450
 
451
edit_box_key.f_exit:
451
edit_box_key.f_exit:
Line 542... Line 542...
542
 
542
 
543
;¢å®¤­®© ¯ à ¬¥âà ebx - ed_pos
543
;¢å®¤­®© ¯ à ¬¥âà ebx - ed_pos
544
edit_box_key.sh_first_sh:
544
edit_box_key.sh_first_sh:
545
        test    word ed_flags,ed_shift
545
        test    word ed_flags,ed_shift
546
        je      @f
546
        je      @f
547
        mov     ed_shift_pos_old,ebx
547
        mov     ed_shift_pos_old,bx
548
        test    word ed_flags,ed_shift_on
548
        test    word ed_flags,ed_shift_on
549
        jne     @f
549
        jne     @f
550
        mov     ed_shift_pos,ebx
550
        mov     ed_shift_pos,bx
551
        or      word ed_flags,ed_shift_on
551
        or      word ed_flags,ed_shift_on
552
@@:     ret
552
@@:     ret
553
;Ž¡à ¡®âª  ªà ©­¨å ¯®«®¦¥­¨© ¢ editbox ¯à¨ ­ ¦ â®¬ shift
553
;Ž¡à ¡®âª  ªà ©­¨å ¯®«®¦¥­¨© ¢ editbox ¯à¨ ­ ¦ â®¬ shift
554
;¯à®¨§¢®¤¨â á­ï⨥ ¢ë¤¥«¥­¨ï, ¥á«¨ ­¥â shift
554
;¯à®¨§¢®¤¨â á­ï⨥ ¢ë¤¥«¥­¨ï, ¥á«¨ ­¥â shift
Line 558... Line 558...
558
        jne     @f
558
        jne     @f
559
        test    word ed_flags,ed_shift_bac
559
        test    word ed_flags,ed_shift_bac
560
        je      @f
560
        je      @f
561
        call    edit_box.draw_bg
561
        call    edit_box.draw_bg
562
        mov     ebp,ed_color
562
        mov     ebp,ed_color
563
        mov     ebx,ed_shift_pos
563
        movzx   ebx, word ed_shift_pos
564
        call    edit_box_key.sh_cl_  ;®ç¨á⪠ ¢ë¤¥«¥­®£® äà £¬¥­â 
564
        call    edit_box_key.sh_cl_  ;®ç¨á⪠ ¢ë¤¥«¥­®£® äà £¬¥­â 
565
        and     word ed_flags,ed_shift_cl ; ®ç¨á⪠ ®â ⮣®, çâ® ã¡à «¨ ¢ë¤¥«¥­¨¥
565
        and     word ed_flags,ed_shift_cl ; ®ç¨á⪠ ®â ⮣®, çâ® ã¡à «¨ ¢ë¤¥«¥­¨¥
566
        jmp     edit_box.draw_cursor_text
566
        jmp     edit_box.draw_cursor_text
Line 567... Line 567...
567
 
567
 
Line 574... Line 574...
574
        jne     edit_box_key.sh_ext_en ;­ à¨á®¢ âì § ªà è¥­­ë© ¯àאַ㣮«ì­¨ª
574
        jne     edit_box_key.sh_ext_en ;­ à¨á®¢ âì § ªà è¥­­ë© ¯àאַ㣮«ì­¨ª
575
        test    word ed_flags,ed_shift_bac
575
        test    word ed_flags,ed_shift_bac
576
        je      @f
576
        je      @f
577
        call    edit_box.check_offset
577
        call    edit_box.check_offset
578
        mov     ebp,ed_color
578
        mov     ebp,ed_color
579
        mov     ebx,ed_shift_pos
579
        movzx   ebx, word ed_shift_pos
580
        call    edit_box_key.sh_cl_  ;®ç¨á⪠ ¢ë¤¥«¥­­®£® äà £¬¥­â 
580
        call    edit_box_key.sh_cl_  ;®ç¨á⪠ ¢ë¤¥«¥­­®£® äà £¬¥­â 
581
        call    edit_box_key.draw_wigwag_cl
581
        call    edit_box_key.draw_wigwag_cl
582
        and     word ed_flags,ed_shift_cl ; 1¢ à ­¥ ­ã¦­®
582
        and     word ed_flags,ed_shift_cl ; 1¢ à ­¥ ­ã¦­®
583
        ret
583
        ret
Line 589... Line 589...
589
edit_box_key.sh_ext_en:
589
edit_box_key.sh_ext_en:
590
        call    edit_box.check_offset
590
        call    edit_box.check_offset
591
        test    word ed_flags,ed_offset_fl
591
        test    word ed_flags,ed_offset_fl
592
        je      @f
592
        je      @f
593
;¨á®¢ ­¨¥ § ªà è¥­­ëå ¯àאַ㣮«ì­¨ª®¢ ¨ ¨å ®ç¨á⪠
593
;¨á®¢ ­¨¥ § ªà è¥­­ëå ¯àאַ㣮«ì­¨ª®¢ ¨ ¨å ®ç¨á⪠
594
        mov     eax,ed_shift_pos
594
        movzx   eax, word ed_shift_pos
595
        mov     ebx,ed_pos
595
        mov     ebx,ed_pos
596
        mov     ecx,ed_shift_pos_old
596
        movzx   ecx, word ed_shift_pos_old
597
;¯à®¢¥àª  ¨ à¨á®¢ ­¨¥ § ªà è¥­­ëå ®¡« á⥩
597
;¯à®¢¥àª  ¨ à¨á®¢ ­¨¥ § ªà è¥­­ëå ®¡« á⥩
598
        cmp     eax,ecx
598
        cmp     eax,ecx
599
        je      edit_box_key.1_shem
599
        je      edit_box_key.1_shem
600
        jb      edit_box_key.smaller
600
        jb      edit_box_key.smaller
601
        cmp     ecx,ebx
601
        cmp     ecx,ebx
Line 614... Line 614...
614
edit_box_key.sh_e_end:
614
edit_box_key.sh_e_end:
615
        and     word ed_flags,ed_shift_off
615
        and     word ed_flags,ed_shift_off
616
        ret
616
        ret
Line 617... Line 617...
617
 
617
 
618
@@:     mov     ebp,shift_color
618
@@:     mov     ebp,shift_color
619
        mov     ebx,ed_shift_pos
619
        movzx   ebx, word ed_shift_pos
620
        call    edit_box_key.sh_cl_
620
        call    edit_box_key.sh_cl_
621
        jmp     edit_box_key.sh_e_end
621
        jmp     edit_box_key.sh_e_end
622
;äã­ªæ¨ï ¤«ï ®¡à ¡®âª¨ shift ¯à¨ ­ ¦ â¨¨ home and end
622
;äã­ªæ¨ï ¤«ï ®¡à ¡®âª¨ shift ¯à¨ ­ ¦ â¨¨ home and end
623
edit_box_key.sh_home_end:
623
edit_box_key.sh_home_end:
624
        mov     ebp,ed_color
624
        mov     ebp,ed_color
625
        call    edit_box.clear_cursor
625
        call    edit_box.clear_cursor
626
        test    word ed_flags,ed_shift_bac
626
        test    word ed_flags,ed_shift_bac
627
        je      @f
627
        je      @f
628
        mov     ebp,ed_color
628
        mov     ebp,ed_color
629
        mov     ebx,ed_shift_pos_old
629
        movzx   ebx, word ed_shift_pos_old
630
        call    edit_box_key.sh_cl_
630
        call    edit_box_key.sh_cl_
631
@@:
631
@@:
632
        test    word ed_flags,ed_shift
632
        test    word ed_flags,ed_shift
633
        je      edit_box_key.sh_exit_ ;¢ë©â¨
633
        je      edit_box_key.sh_exit_ ;¢ë©â¨
634
        mov     ebp,shift_color
634
        mov     ebp,shift_color
635
        mov     ebx,ed_shift_pos
635
        movzx   ebx, word ed_shift_pos
636
        call    edit_box_key.sh_cl_
636
        call    edit_box_key.sh_cl_
637
        or      word ed_flags,ed_shift_bac ;ãáâ ­®¢ª  ä« £ , ¢ë¤¥«¥­­®© ®¡« áâ¨
637
        or      word ed_flags,ed_shift_bac ;ãáâ ­®¢ª  ä« £ , ¢ë¤¥«¥­­®© ®¡« áâ¨
Line 638... Line 638...
638
        jmp     edit_box_key.sh_e_end
638
        jmp     edit_box_key.sh_e_end
Line 659... Line 659...
659
;‚室­ë¥ ¤ ­­ë¥ edx=ed_size;ecx=ed_pos
659
;‚室­ë¥ ¤ ­­ë¥ edx=ed_size;ecx=ed_pos
660
edit_box_key.del_char:
660
edit_box_key.del_char:
661
        mov     esi,ed_text
661
        mov     esi,ed_text
662
        test    word ed_flags,ed_shift_on
662
        test    word ed_flags,ed_shift_on
663
        je      @f
663
        je      @f
664
        mov     eax,ed_shift_pos
664
        movzx   eax, word ed_shift_pos
665
        mov     ebx,esi
665
        mov     ebx,esi
666
        cmp     eax,ecx
666
        cmp     eax,ecx
667
        jae     edit_box_key.dh_n
667
        jae     edit_box_key.dh_n
668
        mov     ed_pos,eax      ;çâ®¡ë ­¥ ¡ë«® ã¡¥£ ­¨ï ªãàá®à 
668
        mov     ed_pos,eax      ;çâ®¡ë ­¥ ¡ë«® ã¡¥£ ­¨ï ªãàá®à 
669
        mov     ebp,ecx
669
        mov     ebp,ecx
670
        sub     ebp,eax
670
        sub     ebp,eax
671
        add     ebx,eax  ;eax ¬¥­ìè¥
671
        add     ebx,eax  ;eax ¬¥­ìè¥
672
        sub     edx,ecx
672
        sub     edx,ecx
673
        add     esi,ecx
673
        add     esi,ecx
674
        mov     ed_shift_pos,ebp
674
        mov     ed_shift_pos,bp
675
        jmp     edit_box_key.del_ch_sh
675
        jmp     edit_box_key.del_ch_sh
Line 676... Line 676...
676
 
676
 
677
edit_box_key.dh_n:
677
edit_box_key.dh_n:
678
        mov     ebp,eax
678
        mov     ebp,eax
679
        sub     ebp,ecx
679
        sub     ebp,ecx
680
        add     ebx,ecx
680
        add     ebx,ecx
681
        sub     edx,eax
681
        sub     edx,eax
682
        add     esi,eax
682
        add     esi,eax
683
        mov     ed_shift_pos,ebp
683
        mov     ed_shift_pos,bp
Line 684... Line 684...
684
        jmp     edit_box_key.del_ch_sh
684
        jmp     edit_box_key.del_ch_sh
685
 
685
 
686
@@:     add     esi,ecx ;㪠§ â¥«ì + ᬥ饭¨¥ ª ॠ«ì­®¬ã ¡ãä¥àã
686
@@:     add     esi,ecx ;㪠§ â¥«ì + ᬥ饭¨¥ ª ॠ«ì­®¬ã ¡ãä¥àã
Line 846... Line 846...
846
        mov     edx,ed_size
846
        mov     edx,ed_size
847
        mov     ecx, ed_pos
847
        mov     ecx, ed_pos
848
        pusha
848
        pusha
849
; clear input area
849
; clear input area
850
        mov     ebp,ed_color
850
        mov     ebp,ed_color
851
        mov     ebx,ed_shift_pos
851
        movzx   ebx, word ed_shift_pos
852
        call    edit_box_key.sh_cl_
852
        call    edit_box_key.sh_cl_
853
        mov     ebp,ed_size
853
        mov     ebp,ed_size
854
        call    edit_box_key.clear_bg
854
        call    edit_box_key.clear_bg
855
        popa
855
        popa
856
        call    edit_box_key.del_char
856
        call    edit_box_key.del_char
857
        mov     ebx,ed_size
857
        mov     ebx,ed_size
858
        sub     ebx,ed_shift_pos
858
        sub     bx,ed_shift_pos
859
        mov     ed_size,ebx
859
        mov     ed_size,ebx
860
        pop     eax
860
        pop     eax
861
@@:
861
@@:
862
}
862
}
Line 964... Line 964...
964
        dec     dword ed_pos
964
        dec     dword ed_pos
965
edit_box_key.draw_all:
965
edit_box_key.draw_all:
966
        push    edit_box_key.shift
966
        push    edit_box_key.shift
967
        test    word ed_flags,ed_shift_on
967
        test    word ed_flags,ed_shift_on
968
        je      @f
968
        je      @f
969
        mov     eax,ed_shift_pos
969
        movzx   eax, word ed_shift_pos
970
        mov     ebx,ed_size
970
        mov     ebx,ed_size
971
        sub     ebx,eax
971
        sub     ebx,eax
972
        mov     ed_size,ebx
972
        mov     ed_size,ebx
973
        mov     ebp,ed_color
973
        mov     ebp,ed_color
974
        call    edit_box.clear_cursor
974
        call    edit_box.clear_cursor
Line 1157... Line 1157...
1157
        cmp     eax,ed_size
1157
        cmp     eax,ed_size
1158
        ja      edit_box_mouse.mwigvag
1158
        ja      edit_box_mouse.mwigvag
1159
edit_box_mouse.mdraw:
1159
edit_box_mouse.mdraw:
1160
        mov     ed_pos,eax
1160
        mov     ed_pos,eax
1161
;¨á®¢ ­¨¥ § ªà è¥­­ëå ¯àאַ㣮«ì­¨ª®¢ ¨ ¨å ®ç¨á⪠
1161
;¨á®¢ ­¨¥ § ªà è¥­­ëå ¯àאַ㣮«ì­¨ª®¢ ¨ ¨å ®ç¨á⪠
1162
        mov     ecx,ed_shift_pos
1162
        movzx   ecx, word ed_shift_pos
1163
        mov     ebx,ed_shift_pos_old
1163
        movzx   ebx, word ed_shift_pos_old
1164
        mov     ed_shift_pos_old,eax
1164
        mov     ed_shift_pos_old,ax
1165
;¯à®¢¥àª  ¨ à¨á®¢ ­¨¥ § ªà è¥­­ëå ®¡« á⥩
1165
;¯à®¢¥àª  ¨ à¨á®¢ ­¨¥ § ªà è¥­­ëå ®¡« á⥩
1166
        cmp     ecx,ebx
1166
        cmp     ecx,ebx
1167
        je      edit_box_mouse.m1_shem  ;¤¢¨¦¥­¨ï ­¥ ¡ë«® à ­¥¥
1167
        je      edit_box_mouse.m1_shem  ;¤¢¨¦¥­¨ï ­¥ ¡ë«® à ­¥¥
1168
        jb      edit_box_mouse.msmaller ;¡ë«® ¤¢¨¦¥­¨¥ ->
1168
        jb      edit_box_mouse.msmaller ;¡ë«® ¤¢¨¦¥­¨¥ ->
1169
        cmp     ebx,eax
1169
        cmp     ebx,eax
Line 1193... Line 1193...
1193
        cmp     eax,0
1193
        cmp     eax,0
1194
        jbe     edit_box_mouse.mwigvag
1194
        jbe     edit_box_mouse.mwigvag
1195
        dec     eax
1195
        dec     eax
1196
        call    edit_box.check_offset
1196
        call    edit_box.check_offset
1197
        push    eax
1197
        push    eax
1198
        mov     ebx,ed_shift_pos
1198
        movzx   ebx, word ed_shift_pos
1199
        mov     ebp,shift_color
1199
        mov     ebp,shift_color
1200
        call    edit_box_key.sh_cl_
1200
        call    edit_box_key.sh_cl_
1201
        pop     eax
1201
        pop     eax
1202
        jmp     edit_box_mouse.mdraw
1202
        jmp     edit_box_mouse.mdraw
Line 1206... Line 1206...
1206
        mov     ebx,ed_size
1206
        mov     ebx,ed_size
1207
        cmp     eax,ebx
1207
        cmp     eax,ebx
1208
        jae     edit_box_mouse.mwigvag
1208
        jae     edit_box_mouse.mwigvag
1209
        inc     eax
1209
        inc     eax
1210
        call    edit_box.check_offset
1210
        call    edit_box.check_offset
1211
        mov     ebx,ed_shift_pos
1211
        movzx   ebx, word ed_shift_pos
1212
        mov     ebp,shift_color
1212
        mov     ebp,shift_color
1213
        push    eax
1213
        push    eax
1214
        call    edit_box_key.sh_cl_
1214
        call    edit_box_key.sh_cl_
1215
        pop     eax
1215
        pop     eax
1216
        jmp     edit_box_mouse.mdraw
1216
        jmp     edit_box_mouse.mdraw
Line 1251... Line 1251...
1251
edit_box_mouse._mshift:
1251
edit_box_mouse._mshift:
1252
; ᥪæ¨ï ®¡à ¡®âª¨ shift ¨ ¢ë¤¥«¥­¨ï ¯® shift
1252
; ᥪæ¨ï ®¡à ¡®âª¨ shift ¨ ¢ë¤¥«¥­¨ï ¯® shift
1253
        test    word ed_flags,ed_shift_bac
1253
        test    word ed_flags,ed_shift_bac
1254
        je      @f
1254
        je      @f
1255
        mov     ebp,ed_color
1255
        mov     ebp,ed_color
1256
        mov     ebx,ed_shift_pos
1256
        movzx   ebx, word ed_shift_pos
1257
        push    eax
1257
        push    eax
1258
        call    edit_box_key.sh_cl_
1258
        call    edit_box_key.sh_cl_
1259
        and     word ed_flags,ed_shift_bac_cl
1259
        and     word ed_flags,ed_shift_bac_cl
1260
        pop     eax
1260
        pop     eax
1261
@@:
1261
@@:
1262
        test    word ed_flags,ed_mouse_on
1262
        test    word ed_flags,ed_mouse_on
1263
        jne     @f
1263
        jne     @f
1264
        mov     ed_shift_pos,eax
1264
        mov     ed_shift_pos,ax
1265
        or      word  ed_flags,ed_mouse_on
1265
        or      word  ed_flags,ed_mouse_on
1266
        mov     ed_pos,eax
1266
        mov     ed_pos,eax
1267
        mov     ebx,ed_mouse_variable
1267
        mov     ebx,ed_mouse_variable
1268
        push    edi
1268
        push    edi
1269
        pop     dword [ebx]
1269
        pop     dword [ebx]
1270
        bts     word ed_flags,1
1270
        bts     word ed_flags,1
1271
        call    edit_box.draw_bg
1271
        call    edit_box.draw_bg
1272
        jmp     edit_box_mouse.m_sh
1272
        jmp     edit_box_mouse.m_sh
Line 1273... Line 1273...
1273
 
1273
 
1274
@@:     cmp     eax,ed_shift_pos
1274
@@:     cmp     ax,ed_shift_pos
1275
        je      edit_box.editbox_exit
1275
        je      edit_box.editbox_exit
1276
        mov     ed_pos,eax
1276
        mov     ed_pos,eax
1277
        call    edit_box.draw_bg
1277
        call    edit_box.draw_bg
1278
        mov     ebp,shift_color
1278
        mov     ebp,shift_color
1279
        mov     ebx,ed_shift_pos
1279
        movzx   ebx, word ed_shift_pos
1280
        call    edit_box_key.sh_cl_
1280
        call    edit_box_key.sh_cl_
1281
        or      word ed_flags,ed_mous_adn_b
1281
        or      word ed_flags,ed_mous_adn_b
1282
edit_box_mouse.m_sh:
1282
edit_box_mouse.m_sh:
1283
        call    edit_box.draw_text
1283
        call    edit_box.draw_text