Subversion Repositories Kolibri OS

Rev

Rev 1214 | Rev 1685 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. set_rect_window:
  2.         mov     ebx,set_rect_window_procinfo
  3.         call    get_slot_n
  4.  
  5.         mov     [set_rect_window_slot],ecx
  6.  
  7.         set_events_mask (evm_redraw+evm_key+evm_button+evm_mouse)
  8. .red:
  9.         edit_boxes_set_sys_color rect_input,rect_input_end,sc
  10.         labels_set_sys_color rect_input_labels,rect_input_labels_end,sc
  11.         check_boxes_set_sys_color riw_check_boxes,riw_check_boxes_end,sc
  12.         call    .draw_window
  13. .still:
  14.         wait_event .red,.key,.button,.mouse
  15.  
  16. .key:
  17.         get_key
  18.  
  19.         push    dword rect_input.left
  20.         call    [edit_box_key]
  21.  
  22.         push    dword rect_input.top
  23.         call    [edit_box_key]
  24.  
  25.         push    dword rect_input.width
  26.         call    [edit_box_key]
  27.  
  28.         push    dword rect_input.height
  29.         call    [edit_box_key]
  30. ;        key_edit_boxes rect_input,rect_input_end
  31.  
  32.         call    read_rect
  33.         call    draw_rect_on_screen
  34.  
  35.         jmp     .still
  36.  
  37. .button:
  38.         get_pressed_button
  39.  
  40.         cmp     ah,1
  41.         jne     @f
  42.         btr     dword [flags],3
  43.         jmp     close
  44. @@:
  45.  
  46.         jmp     .still
  47.  
  48. .mouse:
  49.         get_active_window
  50.         cmp     eax,[set_rect_window_slot]
  51.         jne     .still
  52.  
  53.         push    dword rect_input.left
  54.         call    [edit_box_mouse]
  55.  
  56.         push    dword rect_input.top
  57.         call    [edit_box_mouse]
  58.  
  59.         push    dword rect_input.width
  60.         call    [edit_box_mouse]
  61.  
  62.         push    dword rect_input.height
  63.         call    [edit_box_mouse]
  64.  
  65. ;;;;;;;;;;;;;;;;;;;;;;
  66.         push    dword use_rect_active_window
  67.         call    [check_box_mouse]
  68.  
  69. ;        mouse_edit_boxes rect_input,rect_input_end
  70. ;        mouse_check_boxes riw_check_boxes,riw_check_boxes_end
  71.  
  72.         jmp     .still
  73.  
  74. .draw_window:
  75.         start_draw_window
  76.  
  77.         xor     eax,eax
  78.         mov     ebx,100*65536+250
  79.         mov     ecx,100*65536+130
  80.         mov     edx,[sc.work]
  81.         add     edx,0x33000000
  82.         mov     edi,riw_grab_text
  83.         xor     esi,esi
  84.         mcall
  85.  
  86.         draw_labels rect_input_labels,rect_input_labels_end
  87.  
  88.         push    dword rect_input.left
  89.         call    [edit_box_draw]
  90.  
  91.         push    dword rect_input.top
  92.         call    [edit_box_draw]
  93.  
  94.         push    dword rect_input.width
  95.         call    [edit_box_draw]
  96.  
  97.         push    dword rect_input.height
  98.         call    [edit_box_draw]
  99. ;;;;;;;;;;;;;;;;;;;;;;
  100.         push    dword use_rect_active_window
  101.         call    [check_box_draw]
  102. ;        draw_edit_boxes rect_input,rect_input_end
  103. ;        draw_check_boxes riw_check_boxes,riw_check_boxes_end
  104.  
  105.         call    read_rect
  106.         call    draw_rect_on_screen
  107.  
  108.         stop_draw_window
  109. ret
  110.  
  111. ;--------------------------------------------------------------------
  112. ;--- ‘ç¨â뢠­¨¥ ®¡« â¨ ----------------------------------------------
  113. ;--------------------------------------------------------------------
  114. read_rect:
  115.         bt      dword [use_rect_active_window.flags],1
  116.         jc      read_rect_from_active_window
  117.  
  118.         mov     edi,rect_input_buffer.left
  119.         call    zstr_to_int
  120.         cmp     ax,[scr.width]
  121.         jb      @f
  122.         mov     ax,[scr.width]
  123. @@:
  124.         mov     [rect.left],ax
  125.  
  126.         mov     edi,rect_input_buffer.top
  127.         call    zstr_to_int
  128.         cmp     ax,[scr.height]
  129.         jb      @f
  130.         mov     ax,[scr.height]
  131. @@:
  132.         mov     [rect.top],ax
  133.  
  134.         mov     edi,rect_input_buffer.width
  135.         call    zstr_to_int
  136.         mov     bx,[scr.width]
  137.         sub     bx,[rect.left]
  138.         cmp     ax,bx
  139.         jb      @f
  140.         mov     ax,bx
  141. @@:
  142.         mov     [rect.width],ax
  143.  
  144.         mov     edi,rect_input_buffer.height
  145.         call    zstr_to_int
  146.         mov     bx,[scr.height]
  147.         sub     bx,[rect.top]
  148.         cmp     ax,bx
  149.         jb      @f
  150.         mov     ax,bx
  151. @@:
  152.         mov     [rect.height],ax
  153. ret
  154.  
  155. read_rect_from_active_window:
  156.         call    get_active_window_info
  157.  
  158.         mov     eax,[active_app.left]
  159.         mov     [rect.left],ax
  160.         mov     eax,[active_app.top]
  161.         mov     [rect.top],ax
  162.         mov     eax,[active_app.width]
  163.         inc     eax
  164.         mov     [rect.width],ax
  165.         mov     eax,[active_app.height]
  166.         inc     eax
  167.         mov     [rect.height],ax
  168. ret
  169.  
  170. draw_rect_on_screen:
  171.  
  172.         mov     eax,13
  173.         mov     ebx,150*65536+80
  174.         mov     ecx,5*65536+60
  175.         xor     edx,edx
  176.         mcall
  177.  
  178.         ;movzx   eax,word [rect.left]
  179.         ;mul     word [scr.width]
  180.         xor     edx,edx
  181.         movzx   eax,word [scr.width]
  182.         mov     ebx,80
  183.         div     ebx
  184.         mov     ebx,eax
  185.  
  186.         xor     edx,edx
  187.         movzx   eax,word [rect.height]
  188.         div     ebx
  189.         push    ax
  190.  
  191.         xor     edx,edx
  192.         movzx   eax,word [rect.width]
  193.         div     ebx
  194.         push    ax
  195.  
  196.         xor     edx,edx
  197.         movzx   eax,word [rect.top]
  198.         div     ebx
  199.         push    ax
  200.  
  201.         xor     edx,edx
  202.         movzx   eax,word [rect.left]
  203.         div     ebx
  204.         push    ax
  205.  
  206.         pop     bx
  207.         add     bx,150
  208.         shl    ebx,16
  209.  
  210.         pop     cx
  211.         add     cx,5
  212.         shl     ecx,16
  213.  
  214.         pop     bx
  215.         pop     cx
  216.  
  217.         mov     edx,0xffffff
  218.         mov     eax,13
  219.         mcall
  220. ret
  221.  
  222. ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  223. ;DATA ¤ ­­ë¥
  224. ;‚ᥣ¤  ᮡ«î¤ âì ¯®á«¥¤®¢ â¥«ì­®áâì ¢ ¨¬¥­¨.
  225. system_path      db '/sys/lib/'
  226. library_name     db 'box_lib.obj',0
  227. err_message_found_lib   db 'Sorry I cannot load library box_lib.obj',0
  228. head_f_i:
  229. head_f_l        db 'System error',0
  230. err_message_import      db 'Error on load import library box_lib.obj',0
  231.  
  232. myimport:  
  233.  
  234. edit_box_draw   dd      aEdit_box_draw
  235. edit_box_key    dd      aEdit_box_key
  236. edit_box_mouse  dd      aEdit_box_mouse
  237. version_ed      dd      aVersion_ed
  238.  
  239. check_box_draw  dd      aCheck_box_draw
  240. check_box_mouse dd      aCheck_box_mouse
  241. version_ch      dd      aVersion_ch
  242.  
  243. option_box_draw  dd      aOption_box_draw
  244. option_box_mouse dd      aOption_box_mouse
  245. version_op       dd      aVersion_op
  246.  
  247.                 dd      0
  248.                 dd      0
  249.  
  250. aEdit_box_draw  db 'edit_box',0
  251. aEdit_box_key   db 'edit_box_key',0
  252. aEdit_box_mouse db 'edit_box_mouse',0
  253. aVersion_ed     db 'version_ed',0
  254.  
  255. aCheck_box_draw  db 'check_box_draw',0
  256. aCheck_box_mouse db 'check_box_mouse',0
  257. aVersion_ch      db 'version_ch',0
  258.  
  259. aOption_box_draw  db 'option_box_draw',0
  260. aOption_box_mouse db 'option_box_mouse',0
  261. aVersion_op       db 'version_op',0
  262.  
  263. ;width,left,top,color,shift_color,focus_border_color,\
  264. ;       blur_border_color,text_color,max,text,mouse_variable,flags,size,pos
  265.  
  266. rect_input:
  267. .left   edit_box 35,95,5, cl_white,0,0,0,5,rect_input_buffer.left,mouse_dd1,ed_figure_only+ed_focus
  268. .top    edit_box 35,95,25,cl_white,0,0,0,5,rect_input_buffer.top,mouse_dd1,ed_figure_only
  269. .width  edit_box 35,95,45,cl_white,0,0,0,5,rect_input_buffer.width,mouse_dd1,ed_figure_only
  270. .height edit_box 35,95,65,cl_white,0,0,0,5,rect_input_buffer.height,mouse_dd1,ed_figure_only
  271. rect_input_end:
  272. mouse_dd1       rd 1
  273. rect_input_labels:
  274. .left label 10,10,0,rect_input_labels_text.left
  275. .top label 10,30,0,rect_input_labels_text.top
  276. .width label 10,50,0,rect_input_labels_text.width
  277. .height label 10,70,0,rect_input_labels_text.height
  278. rect_input_labels_end:
  279.  
  280. rect_input_labels_text:
  281. .left db 'Žâáâ㯠᫥¢ :',0
  282. .top  db 'Žâáâ㯠ᢥàåã:',0
  283. .width  db '˜¨à¨­ :',0
  284. .height db '‚ëá®â :',0
  285.  
  286. riw_check_boxes:
  287. use_rect_active_window check_box 10,85,5,11,cl_white,0,0,\
  288. riw_check_boxes_text.1,\
  289. riw_check_boxes_text.2-riw_check_boxes_text.1
  290. riw_check_boxes_end:
  291.  
  292. riw_check_boxes_text:
  293. .1 db 'ˆá¯®«ì§®¢ âì ®¡« áâì  ªâ¨¢­®£® ®ª­ '
  294. .2 db ''
  295.  
  296. riw_grab_text db 'Š®®à¤¨­ âë ¨ à §¬¥àë ®¡« áâ¨:',0