Subversion Repositories Kolibri OS

Rev

Rev 675 | Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1.  
  2. eb_control_data_size    = 82
  3.  
  4. ;****************************************************
  5. ;******************craete EditBox*********************
  6. ;****************************************************
  7. ;IN
  8. ;pointer to parend
  9. ;pointer to EditBox's structure
  10. ;OUT
  11. ;pointer to initialized control
  12. align 4
  13.  
  14. craete_edit_box:
  15.  
  16.       push ebx
  17.       push ecx
  18.       push edx
  19.       push esi
  20.       push edi
  21.       push ebp
  22.  
  23.       mov ebx,[esp+24+4]
  24.       mov eax,[esp+24+8]
  25.  
  26.       mov [PointerToStructureForEditBox],eax
  27.  
  28.       mov eax,control_header_size+eb_control_data_size
  29.       call craete_control
  30.  
  31.       ;set all EditBox's parameters in control
  32.       mov [eax],dword edit_box
  33.  
  34.       mov ecx,eb_control_data_size
  35.       mov esi,[PointerToStructureForEditBox]
  36.       mov edi,eax
  37.       add edi,control_header_size
  38.       rep movsb
  39.  
  40.       call get_skin_height
  41.  
  42.       mov ebx,[PointerToStructureForEditBox]
  43.       mov ecx,[ebx+4]   ;x
  44.       mov edx,[ebx+8]   ;y
  45.       mov esi,[ebx]     ;size x
  46.       mov edi,[ebx+70]  ;size y
  47.       add ecx,border_width
  48.       add edx,[skin_height]
  49.       ;copy information to control
  50.       mov [eax+24],ecx
  51.       mov [eax+28],edx
  52.       mov [eax+32],esi
  53.       mov [eax+36],edi
  54.  
  55.  
  56.       pop ebp
  57.       pop edi
  58.       pop esi
  59.       pop edx
  60.       pop ecx
  61.       pop ebx
  62.  
  63.       ret 8
  64.  
  65. ;****************************************************
  66. ;******************Draw EditBox**********************
  67. ;****************************************************
  68. ;include 'editbox_mac.inc'
  69. ;IN
  70. ;pointer to control of EditBox
  71. ;message
  72. ;OUT
  73. ;not returned value
  74. align 4
  75.  
  76. include 'editbox_mac.inc'
  77.  
  78. edit_box:
  79.       ;;;;;;;;;;;;
  80.       ;Structure from libGui  á®æ¨ æ¨ï áâàãªâãà
  81.       ;;;;;;;;;;;;
  82.  
  83.       ;get message
  84.       mov eax,[esp+8]
  85.  
  86.       ;get pointer to control of button
  87.       mov esi,[esp+4]
  88.       mov [PointerForEditBox],esi
  89.  
  90.       ;copy control to local control
  91.       add esi,control_header_size
  92.       mov edi,dword EditBox
  93.       mov ecx,eb_control_data_size
  94.       rep movsb
  95.  
  96.       ;;;;;;;;;;;;
  97.       ;Structure from libGui  á®æ¨ æ¨ï áâàãªâãà
  98.       ;;;;;;;;;;;;
  99.       srt_ed_libgui
  100.  
  101.       push eax
  102.       ;load coordinats and size from control
  103.       mov eax,[PointerForEditBox]
  104.       mov ebx,[eax+24]           ;x
  105.       mov ecx,[eax+28]           ;y
  106.       mov edx,[eax+32]           ;size x
  107.       mov esi,[eax+36]           ;size y
  108.       ;set current coordinats and sizes in EeditBox
  109.       mov [EditBox.ed_left],ebx
  110.       mov [EditBox.ed_top],ecx
  111.       mov [EditBox.ed_width],edx
  112.       mov [EditBox.ed_height],esi
  113.       pop eax
  114.  
  115.       ;events of redraw all EditBox
  116.  
  117.       cmp [eax],dword 1
  118.       jne .no_redraw_all_edit_box
  119.  
  120.  
  121.        call .draw_border
  122.        .draw_bg_cursor_text:
  123.  
  124.        call .check_offset
  125.  
  126.        call .draw_bg
  127.  
  128.        call .draw_shift
  129.        .draw_cursor_text:
  130.  
  131.        test     word[EditBox.ed_flags],ed_focus
  132.        je       @f
  133.        call     .draw_cursor
  134.      @@:
  135.        call     .draw_text
  136.  
  137.       jmp .editbox_exit;exit_edit_box
  138.       .no_redraw_all_edit_box:
  139.  
  140.  
  141.       ;events of keys for EditBox
  142.  
  143.       cmp [eax],dword 2
  144.       jne .no_keys_edit_box
  145.  
  146.        mov ebx,[eax+4]
  147.        shl ebx,8
  148.        mov eax,ebx
  149.  
  150.         test    word [EditBox.ed_flags],ed_focus
  151.         je      .editbox_exit;exit_edit_box;@b
  152.  
  153.         call    .check_shift
  154.  
  155.         ;----------------------------------------------------------
  156.         ;--- ¯à®¢¥à塞, çâ® ­ ¦ â® --------------------------------
  157.         ;----------------------------------------------------------
  158.  
  159.         use_key_process  backspase,delete,left,right,home,end,insert
  160.  
  161.         ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  162.         ;‡ £«ã誠 ­  ®¡à ¡®âªã ª« ¢¨è ¢¢¥àå ¨ ¢­¨§ â.¥. ¯à¨
  163.         ;®¡­ à㦥­¨¨ íâ¨å ª®¤®¢ ¯à®¨á室¨â ¢ë室 ¨§ ®¡à ¡®â稪 
  164.         ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  165.  
  166.         srt_ed_libgui
  167.         use_key_no_process   up,down,esc
  168.  
  169.         ;--- ­ ¦ â  ¤àã£ ï ª« ¢¨è  ---
  170.  
  171.         ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  172.         ;à®¢¥àª  ãáâ ­®¢«¥­ «¨ ä« £ ¯à¨ ª®â®à®¬ ­ã¦­® ¢ë¢®¤¨âì
  173.         ;⮫쪮 æ¨äàë ¢ ­ã¦­®¬ ¡®ªá¥ ¥á«¨ â ª®© ­¥®¡å®¤¨¬®á⨠­¥â
  174.         ;­ã¦­® § ª®¬¥­â¨à®¢ âì ¬ ªà®á
  175.         ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  176.  
  177.         use_key_figures_only
  178.  
  179.         ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  180.         ;¯à®¢¥àª  ­  shift ¡ë« «¨ ­ ¦ â
  181.         ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  182.  
  183.         are_key_shift_press
  184.  
  185.         ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  186.         ; ¯à®¢¥à塞, ­ å®¤¨âáï «¨ ªãàá®à ¢ ª®­æ¥ + ¤ «ì­¥©è ï ®¡à ¡®âª 
  187.         ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  188.  
  189.         are_key_cur_end
  190.  
  191.         ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  192.         ;Ž¡à ¡®âª  ª« ¢¨è insert,delete.backspase,home,end,left,right
  193.         ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  194.  
  195.         use_work_key
  196.  
  197.  
  198.       .no_keys_edit_box:
  199.  
  200.       cmp [eax],dword 3
  201.       je exit_edit_box
  202.  
  203.       ;events of mouse for EditBox
  204.  
  205.       cmp [eax],dword 6
  206.       jne .editbox_exit
  207.  
  208.         mov esi,[eax+4]
  209.         mov edi,[eax+8]
  210.         mov ecx,[eax+12]
  211.         mov [EditBox.mouseX],esi
  212.         mov [EditBox.mouseY],edi
  213.         mov [ButtonsOfMouse],ecx
  214.  
  215.         mov eax,ecx
  216.  
  217.         test    eax,1
  218.         jnz     .mouse_left_button
  219.         and     word [EditBox.ed_flags],ed_mouse_on_off
  220.         jmp     .editbox_exit
  221.  
  222.        .mouse_left_button:
  223.  
  224.         mov eax,[EditBox.mouseX]
  225.         shl eax,16
  226.  
  227.         ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  228.         ;”ã­ªæ¨ï ®¡à ¡®âª¨  ¬ë誨 ¯®«ã祭¨¥ ª®®à¤¨­ â ¨ ¯à®¢¥àª  ¨å + ¢ë¤¥«¥­¨ï
  229.         ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  230.  
  231.         use_work_mouse ;scr_h,scr_w
  232.  
  233.         ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  234.         ;Ž¡é¨¥ ä㭪樨 ®¡à ¡®âª¨
  235.         ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  236.  
  237.         use_general_func
  238.  
  239.         ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  240.         ;”㭪樨 ¤«ï à ¡®âë á key
  241.         ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  242.  
  243.         use_key_func
  244.  
  245.         ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  246.         ;”㭪樨 ¤«ï à ¡®âë á mouse
  247.         ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  248.  
  249.         use_mouse_func ;scr_w
  250.  
  251.         ;;;;;;;;;;;;;;;;;;;;;;;;;;
  252.         ;Ž¡é¨© ¢ë室 ¨§ editbox ¤«ï ¢á¥å ä㭪権 ¨ ¯®áâ ®¡à ¡®â稪®¢
  253.         ;;;;;;;;;;;;;;;;;;;;;;;;;;
  254.  
  255.       .editbox_exit:
  256.  
  257.       exit_edit_box:
  258.  
  259.       ;save resulatat of work in control
  260.       mov esi,dword EditBox
  261.       mov edi,[PointerForEditBox]
  262.       add edi,control_header_size
  263.       mov ecx,eb_control_data_size
  264.       rep movsb
  265.  
  266.       ret 8
  267.  
  268.