Subversion Repositories Kolibri OS

Rev

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