Subversion Repositories Kolibri OS

Rev

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.       ;events of mouse for EditBox
  186.  
  187.       cmp [eax],dword 6
  188.       jne .editbox_exit
  189.  
  190.         mov esi,[eax+4]
  191.         mov edi,[eax+8]
  192.         mov ecx,[eax+12]
  193.         mov [EditBox.mouseX],esi
  194.         mov [EditBox.mouseY],edi
  195.         mov [ButtonsOfMouse],ecx
  196.  
  197.         mov eax,ecx
  198.  
  199.         test    eax,1
  200.         jnz     .mouse_left_button
  201.         and     word [EditBox.ed_flags],ed_mouse_on_off
  202.         jmp     .editbox_exit
  203.  
  204.        .mouse_left_button:
  205.  
  206.         mov eax,[EditBox.mouseX]
  207.         shl eax,16
  208.  
  209.         ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  210.         ;”ã­ªæ¨ï ®¡à ¡®âª¨  ¬ë誨 ¯®«ã祭¨¥ ª®®à¤¨­ â ¨ ¯à®¢¥àª  ¨å + ¢ë¤¥«¥­¨ï
  211.         ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  212.  
  213.         use_work_mouse ;scr_h,scr_w
  214.  
  215.         ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  216.         ;Ž¡é¨¥ ä㭪樨 ®¡à ¡®âª¨
  217.         ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  218.  
  219.         use_general_func
  220.  
  221.         ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  222.         ;”㭪樨 ¤«ï à ¡®âë á key
  223.         ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  224.  
  225.         use_key_func
  226.  
  227.         ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  228.         ;”㭪樨 ¤«ï à ¡®âë á mouse
  229.         ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  230.  
  231.         use_mouse_func ;scr_w
  232.  
  233.         ;;;;;;;;;;;;;;;;;;;;;;;;;;
  234.         ;Ž¡é¨© ¢ë室 ¨§ editbox ¤«ï ¢á¥å ä㭪権 ¨ ¯®áâ ®¡à ¡®â稪®¢
  235.         ;;;;;;;;;;;;;;;;;;;;;;;;;;
  236.  
  237.       .editbox_exit:
  238.  
  239.       exit_edit_box:
  240.  
  241.       ;save resulatat of work in control
  242.       mov esi,dword EditBox
  243.       mov edi,[PointerForEditBox]
  244.       add edi,control_header_size
  245.       mov ecx,eb_control_data_size
  246.       rep movsb
  247.  
  248.       ret 8
  249.  
  250.